Skip to content

[Feature] Replace Hand-rolled JS File Search with Ripgrep #889

Description

@akramcodez

Description

Replace the manual filesystem walk and regex search in source/utils/file-search.ts with a bundled rg (ripgrep) binary to drastically improve file search speeds.

Use Case

On large repositories, the current JS-based file search (lstat, readdir, per-line regex) is 10–50x slower than ripgrep. search_file_contents is one of the most frequently called tools, so this causes noticeable lag.

Proposed Solution

Vendor a ripgrep binary (similar to how VS Code does it) and shell out to it for search_file_contents.

Alternatives Considered

Offloading the JS walk to a worker thread (Tier 2 improvement, but still much slower than ripgrep).

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • This feature aligns with the project's goals (local-first AI assistance)

Implementation Notes

This is the biggest raw speed win for large codebases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions