Steven Gonsalvez

Software Engineer

← Back to Tools & Tips
Free|

code-review-graph: Stop Your Agent Reading the Whole Repo

Builds a local knowledge graph of your codebase with Tree-sitter so AI assistants read only the files that matter. Claims 6.8x fewer tokens on reviews.

Visit tool →

You know what annoys me? Watching Claude burn through tokens reading files that have nothing to do with the change I'm reviewing. It reads everything. Every. Single. File. Like a student who highlights the entire textbook and calls it studying.

code-review-graph fixes that. It parses your codebase with Tree-sitter into a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage). When a file changes, it traces every caller, dependent, and test that could be affected. That's your blast radius. Your AI assistant reads only those files instead of scanning the whole project.

pip install code-review-graph
code-review-graph install
code-review-graph build

It plugs in via MCP for the code graph. If you're not keen on the MCP context tax (and you shouldn't be), use mcporter to call it from the command line instead of wiring it into your agent's MCP client. The graph updates incrementally on every edit and commit, so it stays fresh without you having to rebuild anything.

The numbers they claim are 6.8x fewer tokens on reviews and up to 49x on daily coding tasks. I haven't verified those exact figures, but the difference is obvious when you watch it work. Reviews that used to chew through your context window now barely make a dent.

There's also a visualize command that spits out interactive HTML graphs of your codebase structure. Handy for getting your head around a new repo, even if you're not using it for reviews.

Reckon this one's going to become bog standard in most agent setups before long. The token savings alone pay for the thirty seconds of setup.

Share𝕏in

Comments & Reactions