nogrep — code context for AI agents, without the grep-and-read loop
claude mcp add --scope user nogrep /path/to/nogrep-mcp
One Rust binary. No runtime dependencies. Speaks MCP to Claude Code, Cursor, Windsurf, and anything else that does.
An agent working from grep has to read whole files to find anything. A typical multi-step bug fix costs about 220,000 input tokens this way, most of them spent on code that turns out to be irrelevant.
nogrep parses the repository into a graph — every function, call, import, and inheritance edge, via tree-sitter, across 8 languages — and answers structural questions directly: who calls this, what breaks if it changes, which 8,000 tokens of code actually matter for this issue. The same bug fix costs about 14,000 tokens.
Relevance is computed by personalized PageRank diffusion from the issue text
over typed edges, so it surfaces code with zero keyword overlap with the query —
the middleware that calls session.validate(), the model that inherits
from SessionMixin. Keyword search cannot find these. The graph walks
straight to them.
SWE-bench Verified, 150 tasks across 12 repositories. File recall at a fixed token budget, against the strongest text baseline:
| budget | BM25 | nogrep | |
|---|---|---|---|
| 2K tokens | 0.265 | 0.674 | nogrep at 2K beats BM25 at 8K by 21 points |
| 4K tokens | 0.355 | 0.667 | (50-task budget sweep) |
| 8K tokens | 0.464 | 0.705 | p < 0.0001, Wilcoxon signed-rank |
Structural queries (callers, dead code, module maps) replace whole-file reads
outright: ~270 tokens per answer where grep-and-read averages ~84,000. The
evaluation is reproducible from the repository with python reproduce.py.
Fourteen MCP tools. The agent picks them itself; you just ask questions.
# inside a Claude Code session, after indexing:
> Show me everything that calls validate_session.
> What is the blast radius if I change it?
> Any circular dependencies in the auth module?
> The login flow breaks after a password reset —
find the relevant code.
The last one is the point. The answer includes files that share no words with the question, found through the call graph, inside an 8K-token budget. The agent never opens the other 47 files.
curl -fsSL https://nogrep.com/install.sh | sh
Builds the nogrep CLI and nogrep-mcp server via cargo
and registers the MCP server with Claude Code if the claude CLI is
present. Or by hand:
git clone https://github.com/erphq/nogrep cd nogrep/nogrep-rs cargo build --release --bin nogrep-mcp claude mcp add --scope user nogrep \ "$(pwd)/target/release/nogrep-mcp"
Apache-2.0. The Python research lane — evaluation pipeline, visualization, the algorithm papers-in-waiting — lives in the same repository.
Until June 2026 this project was called CodeGraph. The domain was taken.
grep(1) — still the right tool for everything else.
github.com/erphq/nogrep ·
SWE-bench Verified ·
Model Context Protocol