When you ask Claude Code, Codex or Cursor to review a change in a big repo, the agent usually does one of two things. It reads far too many files and burns your context window, or it reads too few and misses the caller your change breaks. Neither is a great way to spend tokens.
code-review-graph takes a different route. It parses your codebase with Tree-sitter into a local graph of functions, classes, imports, calls and test coverage, then serves a small slice of that graph to your assistant over MCP. The assistant reads only the files a change actually touches. The README reports about 63x fewer tokens per question at the median across six repos. We have not reproduced that number ourselves, so treat it as the author's benchmark.
What you need
- Python 3.10 or newer
- One of the supported AI coding tools: Claude Code, Codex, Cursor, Windsurf, Zed, Continue, OpenCode, Gemini CLI, Copilot and several others
- A repository you want reviewed, ideally a large one where context fills up fast
Install and build
pip install code-review-graph # or: pipx install code-review-graph code-review-graph install # detect installed AI coding tools and configure each one code-review-graph build # parse the codebase The install step detects which AI coding tools you have, writes an MCP server entry for each one, installs hooks and skills where the platform supports them, and adds graph instructions to the platform's rules file. Restart your editor or tool afterwards.
To configure only one tool, pass a platform:
code-review-graph install --platform claude-code code-review-graph install --platform cursor A cold build of a roughly 3,000 file repository took about 40 seconds in the README's measurement. After that, hooks and watch mode keep the graph updated as files change. If some files fail to parse, the build reports a partial status and names them, and those files keep their previous graph rows.
Run a review
Open the project in your assistant and ask:
Build the code review graph for this project Then ask for a review of a branch or diff. The assistant calls the graph's MCP tools to get the blast radius of the change: callers, dependents and the tests that cover it, plus risk scores. That is the "smallest set of files the assistant needs to read."
A prompt you can paste
"Install tirth8205/code-review-graph in this repo, build the graph, and review my current branch through its MCP tools. List which files the review context included, the blast radius of the change, and any tests that cover it."
Removing it cleanly
code-review-graph uninstall --dry-run # preview only code-review-graph uninstall # preview, confirm, apply Uninstall removes only the files and entries it created and leaves your other MCP servers and hooks alone.
Tips
- Check the "files included" list in the review. If the blast radius looks wrong, rebuild the graph before trusting the result.
- Keep watch mode or hooks on, so a stale graph does not hide a new caller.
- This walkthrough follows the README and has not been run end to end by us.
More
Step-by-step card: Give your AI reviewer only the code that matters. More on the repo: code-review-graph use cases.
Source repo: tirth8205/code-review-graph.
Want the setup commands for 50 AI repos people actually ship with? Get the free AI Repos That Actually Ship pack: https://dedupedai.com/ship-pack/?utm_source=devto&utm_medium=article&utm_campaign=shippack
Get one email every Monday with the week's hottest AI repos and exactly how to use them: subscribe free at dedupedai.com