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

> Source: <https://dev.to/dedupedai/cut-tokens-on-ai-code-reviews-with-code-review-graph-2njp>
> Published: 2026-11-03 02:11:16+00:00

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](https://github.com/tirth8205/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](https://dedupedai.com/use-cases/tirth8205-code-review-graph/cut-tokens-on-ai-code-reviews/?utm_source=devto&utm_medium=article&utm_campaign=howto_codereviewgraph). More on the repo: [code-review-graph use cases](https://dedupedai.com/use-cases/tirth8205-code-review-graph/?utm_source=devto&utm_medium=article&utm_campaign=howto_codereviewgraph).

Source repo: [tirth8205/code-review-graph](https://github.com/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](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](https://dedupedai.com/join/?utm_source=devto&utm_medium=article&utm_campaign=howto_codereviewgraph)**
