Skip to content

search_code grep phase misses CommonJS (.js) files #201

@speeed76

Description

@speeed76

Bug

search_code does not find functions in CommonJS .js files. The grep phase appears to skip them entirely, even though the same functions are correctly indexed in the graph (findable via search_graph name_pattern and query_graph Cypher).

Version: 0.5.7

Reproduction:

codebase-memory-mcp cli search_code '{"project":"my-project","pattern":"evaluateOffer"}'
# Returns: 0 results

codebase-memory-mcp cli search_graph '{"project":"my-project","name_pattern":"evaluateNew"}'
# Returns: evaluateNewOffers in decision_service.js (correct)

The project has a Node.js/Express backend using CommonJS require() — all files are .js (not .mjs or .ts). The tree-sitter indexer parses them correctly (nodes exist in the graph), but search_code's grep phase doesn't search these files.

Workaround: Use search_graph with name_pattern or query_graph with Cypher for CJS codebases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions