ygrep CLI
A fast local indexed code search in Rust for AI assistants that plugs into Claude Code, OpenCode and Codex.
- 64 ★ on the repository
- Last commit
- MIT
Minimal access
Why this level
- It indexes and reads project files and keeps a background service, leaving project code untouched.
Install
- Works in
Manual install
brew install yetidevworks/ygrep/ygrepThe README's first option for macOS and Linux. Then `ygrep install claude-code`, `ygrep install opencode` or `ygrep install codex`.
Access and checks
How we reviewMinimal accessThe tool runs nothing and makes no network calls.
- It indexes and reads project files and keeps a background service, leaving project code untouched.
This is third-party code. Review the repository files before installing.
What it does
ygrep builds a local code index on Tantivy and answers queries instantly with BM25 ranking. Search is literal by default, like grep, and special characters such as `$variable`, `{% block` and `@decorator` are kept. The `-r` flag enables regular expressions. The tokenizer is code-aware: camelCase and snake_case identifiers are split into parts, so a `send` query finds `sendCampaign` and `send_email`. The `ygrep install claude-code` command installs a plugin that indexes the project in the background at session start and provides a skill teaching Claude to prefer ygrep over built-in search. OpenCode and Codex get a skill install. The AI output format is compact: path, line and match percentage. A background service watches files and updates the index, and a terminal dashboard shows indexes, the service and query statistics. Optional semantic search uses a local model.
Who it is for. Developers with large repositories whose agent spends long searching code with built-in grep and wastes context on surplus output.
Good fit when
- In a large repository the agent's built-in search is slow and noisy.
- You need to find a function by part of its name, for example `sendCampaign` by the word `send`.
- A query with symbols like `->get(` or `{% block` must be searched literally, without regular expressions.
- The index should update by itself while you edit files, with no terminal running.
- Semantic search is wanted next to literal search, and its model must run locally.
Not a fit when
- The repository is small: built-in grep copes without an index.
- The agent is not Claude Code, OpenCode or Codex: there is no automatic install for it.
- ONNX Runtime cannot be installed: the full build with semantics needs it, though a `--no-default-features` variant exists.
Example request
Use ygrep to find where the project builds the email sending queue.Limitations
Automatic installation exists for Claude Code, OpenCode and Codex. In Claude Code, restart after installing and run `/ygrep` at the start of each session, otherwise the agent stays on built-in search. A full source build with semantics needs ONNX Runtime, and a lightweight one builds with `--no-default-features`. The index is stored on disk, and the background service and file watching run until stopped. Building on Windows needs Rust, MSVC Build Tools and C and C++ compile packages.
How to disable. Run `ygrep uninstall claude-code`, `ygrep uninstall opencode` or `ygrep uninstall codex`. Stop the service with `ygrep` tools and delete the index directories by hand.
FAQ
How do I install ygrep?
Through Homebrew on macOS and Linux: `brew install yetidevworks/ygrep/ygrep`. From source: `cargo install --path crates/ygrep-cli`, and a no-ONNX variant builds with `--no-default-features`.
How do I connect ygrep to Claude Code?
Run `ygrep install claude-code`, restart Claude Code and run `/ygrep` at the start of each session. The plugin indexes the project in the background at start, and the skill teaches Claude to choose ygrep over built-in Grep and Glob.
Do I need to build the index beforehand?
No. The first search in a workspace builds a text index and runs the query at once. You can build it ahead with `ygrep index`, and changes are then picked up incrementally by file modification time.
How do I search by regular expression?
Add the `-r` flag, for example `ygrep -r "fn\s+main"` or `TODO|FIXME`. Without it the query is literal and special characters such as `$` and `@` count as part of a word.
What does semantic search add?
An optional HNSW vector index with the local all-MiniLM-L6-v2 model: it finds code by meaning next to literal search. It is enabled separately and needs a build with ONNX Runtime.
Discussion
No questions or reviews yet.
Related
CLI toolsLocal code search for Claude Code and Codex: six fast tools in place of grep and Read, with an index that updates itself.
codesearch searches code across several repositories with hybrid retrieval and runs fully offline, without a GPU or Docker.
A Rust MCP server and CLI with a call graph and hybrid semantic code search for Claude Code and Codex
A Rust CLI that indexes code symbols locally so agents search by structure instead of grep and spend 40-50% fewer tokens.
Structural code search, lint and rewrite on the syntax tree, with patterns written like ordinary code
A local semantic code index: the agent searches by meaning, then follows hits into definitions, callers and dependency paths
README in short
The project is a fast indexed search optimized for assistants: the tokenizer understands code, output is minimal and indexes update on their own. The repository holds comparison measurements of versions 3.5 and 4.0.