← all repositories
tirth8205/code-review-graph

Stop burning tokens: a blast-radius map for AI review

It builds a persistent structural map of your codebase so AI assistants read only the files in a change's blast radius instead of the whole repo.

code-review-graph
Velocity · 7d
+831
★ / day
Trend
accelerating
star history

What it does

code-review-graph ingests your repository through Tree-sitter and stores a local SQLite graph of functions, classes, imports, calls, inheritance, and test coverage. When an AI assistant asks for review context over MCP, the tool computes the minimal file set your assistant actually needs to read instead of dumping the entire codebase into the prompt.

The interesting bit

The tool deliberately over-predicts impacted files to maintain 100% recall on the 13 evaluation commits documented in its benchmarks, accepting lower precision so it never misses a broken dependency. This conservative blast-radius analysis is where the token savings come from—though the README is upfront that trivial single-file diffs can sometimes cost more than naive reads.

Key highlights

  • Automated benchmarks across six real-world repos report 38x–528x token reduction for typical agent questions, with 100% impact recall and 0.71 average F1.
  • Incremental updates rely on SHA-256 diffing to re-parse only changed files and their dependents, re-indexing a 2,900-file project in under two seconds.
  • Broad language coverage via Tree-sitter and targeted fallbacks, spanning Python, JavaScript/TypeScript, Go, Rust, Java, C/C++, C#, and roughly two dozen others, including Jupyter and Databricks notebooks.
  • Runs fully offline as a local-first SQLite graph and auto-configures MCP integration for a wide range of AI coding platforms.

Caveats

  • Trivial single-file changes can consume more tokens than a naive read because of the structural metadata overhead.
  • Keyword search scores an MRR of 0.35 and struggles with module-pattern naming in repos like Express.
  • Flow detection reliably finds entry points only in Python frameworks; JavaScript and Go support is described as needing work.

Verdict

Try it if you are feeding large repos or monorepos into AI review tools and need to shrink context windows. Pass if your work is mostly small, single-file scripts where graph overhead will not pay for itself.

Frequently asked

What is tirth8205/code-review-graph?
It builds a persistent structural map of your codebase so AI assistants read only the files in a change's blast radius instead of the whole repo.
Is code-review-graph open source?
Yes — tirth8205/code-review-graph is open source, released under the MIT license.
What language is code-review-graph written in?
tirth8205/code-review-graph is primarily written in Python.
How popular is code-review-graph?
tirth8205/code-review-graph has 25.3k stars on GitHub and is currently accelerating.
Where can I find code-review-graph?
tirth8205/code-review-graph is on GitHub at https://github.com/tirth8205/code-review-graph.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.