cd /news/ai-tools/cut-tokens-on-ai-code-reviews-with-c… · home › topics › ai-tools › article
[ARTICLE · art-162866] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Cut tokens on AI code reviews with code-review-graph

A developer released code-review-graph, an open-source tool that parses a codebase with Tree-sitter into a local graph of functions, classes, imports, calls and test coverage, then serves a slice of that graph to AI coding assistants like Claude Code, Codex and Cursor over MCP so reviews read only the files a change touches. The README reports roughly 63x fewer tokens per question at the median across six repos, a figure the writeup says was not independently reproduced, and a cold build of a ~3,000-file repository took about 40 seconds. The tool installs MCP entries, hooks and rules for detected platforms and supports incremental updates via watch mode.

by read2 min views2 publishedNov 3, 2026

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.

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.

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

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

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.

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

── more in #ai-tools 4 stories · sorted by recency
── more on @code-review-graph 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/cut-tokens-on-ai-cod…] indexed:0 read:2min 2026-11-03 · —