nogrep
NOGREP(1) Agent Commands NOGREP(1)

NAME

nogrep — code context for AI agents, without the grep-and-read loop

SYNOPSIS

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.

DESCRIPTION

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.

BENCHMARKS

SWE-bench Verified, 150 tasks across 12 repositories. File recall at a fixed token budget, against the strongest text baseline:

budgetBM25nogrep
2K tokens0.2650.674nogrep at 2K beats BM25 at 8K by 21 points
4K tokens0.3550.667(50-task budget sweep)
8K tokens0.4640.705p < 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.

TOOLS

Fourteen MCP tools. The agent picks them itself; you just ask questions.

nogrep_get_context
Issue text in, the relevant slice of the codebase out, within a token budget.
nogrep_callers / nogrep_callees
Who calls this function; what it calls.
nogrep_impact
Blast radius — every transitive dependent of a change.
nogrep_trace
Shortest call chain between two functions.
nogrep_dead_code / nogrep_cycles / nogrep_hotspots
Unreachable functions, circular dependencies, load-bearing bridge points.
nogrep_search / nogrep_module / nogrep_communities / nogrep_health / nogrep_quality / nogrep_index
Symbol search ranked by PageRank, per-file maps, detected module structure, graph stats, ten structural quality signals, and the indexer that builds it all.

EXAMPLES

# 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.

INSTALL

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.

HISTORY

Until June 2026 this project was called CodeGraph. The domain was taken.

SEE ALSO

grep(1) — still the right tool for everything else.
github.com/erphq/nogrep · SWE-bench Verified · Model Context Protocol