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.
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.
Two commands
Install it, go to your project directory, and build the 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.
Same question, two ways
I ran this on my outreach automation project — 32 Python files, a Supabase backend, a dozen modules. The question:
outreach_prospects table?"
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
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.
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.
$ code-review-graph build
Requires Python 3.8+. Works on any Python project. The graph rebuilds automatically when your files change.