Claude Code · Token Savings

I cut my Claude Code token usage by 8x with a free pip install

Every query reads your entire project from scratch. This tool builds a map so Claude doesn't have to. Here's what happened when I ran it on a real codebase.

Without it
16
files manually read
57
usage lines to parse
~45s
to get started
?
risk score
With it
1
command
319ms
total time
0.35
risk score (auto)
1
untested fn flagged

Claude Code burns tokens because of how it works by default. Ask it anything about your codebase — "which files use this function?", "what breaks if I change this table?" — and it reads every file it thinks might be relevant. On a 30-file project, that's expensive. On a 200-file project, it's a budget problem.

code-review-graph by Tirth Patel fixes this. It builds a dependency graph of your entire project — every file, every function, every import chain — and stores it locally. Claude reads the map instead of re-scanning source files on every query.

Free, open source, MIT licensed. Works on any Python project. Two commands to set up.
Setup

Two commands

Install it, go to your project directory, and build the graph:

$ pip install code-review-graph
✓ Successfully installed code-review-graph 2.1.0

$ code-review-graph build
Scanning project...
Parsing 32 Python files...
Resolving imports and call chains...
✓ Graph built | 486 nodes · 5,273 edges · 0.9s

That's it. The graph lives in your project directory. From that point forward, Claude reads the map before diving into files.

The test

Same question, two ways

I ran this on my outreach automation project — 32 Python files, a Supabase backend, a dozen modules. The question:

"Which files break if I add a column to the outreach_prospects table?"
Without code-review-graph
With code-review-graph
$ grep -rl 'outreach_prospects'
16 files returned

Then grep each file manually
to understand how they use it

57 usage lines to read
No risk score
Untested functions: unknown
~45 seconds just to start
$ code-review-graph detect-changes --brief

Completed in 319ms
Risk score: 0.35 (medium)
Test gap: _store_prospect
23 affected functions mapped
Zero manual file reads

The _store_prospect function it flagged was genuinely untested — I checked. Without the graph, I would have changed that function without knowing.

Why it matters

The token math

On a 32-file project, Claude reads roughly 130,000 tokens per query when it scans the full codebase. With the graph, it reads the map instead — a fraction of that. The bigger your project, the worse the default behaviour gets.

The graph also gives you something grep never could: a risk score, test gap analysis, and transitive dependency tracing. You know what's safe to change before you change it.

Install it
Get started
$ pip install code-review-graph
$ cd your-project
$ code-review-graph build

Requires Python 3.8+. Works on any Python project. The graph rebuilds automatically when your files change.

Tested on a 32-file Python project. Results vary by project size and structure. Tool is MIT licensed, no affiliation.