A developer named Tirth released code-review-graph on GitHub this week. The tool builds a persistent, local-first structural map of a codebase using Tree-sitter, then serves only the relevant context to AI coding assistants through the Model Context Protocol (MCP). The headline number: a median 82x reduction in per-question tokens across six real-world repositories, with a best-case 528x reduction on the FastAPI codebase.
This is not another RAG wrapper. Code-review-graph parses every source file into an AST, stores nodes (functions, classes, imports) and edges (calls, inheritance, test coverage) in a local graph database, then computes the minimal set of files an AI assistant needs for a given review question or change impact. The tool supports 30+ languages out of the box, including Python, TypeScript, Go, Rust, Java, and Solidity, with a custom-language mechanism that requires no fork.
The immediate implication for AI builders is straightforward: the cost of context window waste is no longer an abstract problem. Code-review-graph ships with a GitHub Action that runs entirely on the CI runner, sends zero source code to external services, and posts a single sticky comment with risk-scored functions, affected execution flows, and test gaps. An optional fail-on-risk input turns the review into a merge gate. The tool auto-detects and configures Cursor, Claude Code, Gemini CLI, GitHub Copilot, and several other platforms on install.
The benchmarks are the most concrete part of the release. The automated evaluation runner tests against six open-source repositories (13 commits total) with a fixed seed and deterministic embeddings. The median per-question token reduction is 82x, meaning an agent that would have read the entire FastAPI codebase (951,071 tokens) instead reads roughly 2,169 tokens of targeted graph context. The range runs from 38x (httpx) to 528x (FastAPI). The tool also measures impact accuracy: average F1 of 0.714 across the six repos, with recall at 1.0 as a graph-derived upper bound. The author is honest about the circularity: the ground truth is derived from the same graph edges the predictor walks, so recall is an upper bound by construction. An honest co-change mode grades against files actually co-changed in the same commit, and those numbers will be added once captured by the eval runner.
Build performance is also documented. A 1,122-file project (FastAPI) parses into 6,285 nodes and 27,117 edges in 128 milliseconds for flow detection, with search latency at 1.5 milliseconds. A 60-file project (httpx) takes 96 milliseconds for flow detection and 0.4 milliseconds for search. Incremental updates on a 2,900-file project re-index in under two seconds using SHA-256 hash checks and differential parsing.
The tool has known weaknesses. Small single-file changes can produce graph context that exceeds naive file reads, because the structural metadata for multi-file analysis has overhead. Keyword search MRR is 0.35, meaning the right result lands in the top four for most queries but ranking needs work. The blast-radius analysis deliberately over-predicts: better to flag too many files than miss a broken dependency, as the precision numbers show (average 0.578 across the six repos).
The broader significance is about the economics of AI-assisted development at scale. Large monorepos are where token waste is most painful. Code-review-graph excludes 27,700+ files from review context on a typical monorepo query, reading only about 15 files. For a team running hundreds of PR reviews per week on a monorepo, the token cost savings compound rapidly. The tool is MIT-licensed and installs with a single pip install code-review-graph command.
The MCP integration is the architectural bet that makes this work. By hooking into the Model Context Protocol, code-review-graph becomes a data source that any MCP-compatible AI assistant can query at review time. The tool does not need to know which assistant is calling it. The assistant does not need to know which language the codebase uses. The graph is the interface.
For AI researchers and tool builders, the lesson is about grounding. The most expensive part of an AI coding tool is not the model inference. It is the context window filled with irrelevant files. Code-review-graph demonstrates that a local, deterministic, language-aware index can cut that waste by two orders of magnitude on real codebases. The technique generalizes beyond code review to any task where an AI agent needs to read a subset of a large corpus: documentation search, bug triage, refactoring impact analysis.
The project is young. The co-change benchmark numbers are still pending. The search ranking is weak. The install flow auto-detects platforms but requires a restart of the editor. The token savings estimate, calibrated against OpenAI’s cl100k_base tokenizer, is within 1% of real GPT-4 tokens across 222 sample files. That calibration is a useful data point for anyone building similar tools.
Tirth has published the full reproduction recipe with expected outputs, and a weekly report-only evaluation run lives in the repository’s CI. The tool is dogfooded on its own repo. The README includes benchmarks, methodology, and a list of limitations. This is a serious engineering artifact, not a demo.
The question for the industry is whether the AI coding tool vendors will integrate this kind of structural code intelligence natively, or whether local-first graph tools like code-review-graph will remain a third-party optimization. The MCP integration makes the latter viable today. The benchmarks make the case for the former.