generalized-code-review-graph
AI-powered code review tool that cuts token costs by 8.2x
Build semantic knowledge graphs of your codebase for smarter AI code reviews with Claude, Cursor, Gemini CLI, and more
The Problem
AI coding assistants (Claude Code, Cursor, Gemini CLI) re-read your entire codebase on every review, refactor, or debug task. A 10,000-file monorepo = 10,000 files × N tasks = millions of wasted tokens.
generalized-code-review-graph solves this by building a persistent knowledge graph of your code structure, then giving AI assistants only the minimal context they need via MCP (Model Context Protocol).
How It Works (30 seconds)
- Parse once — generalized-code-review-graph parses your repo using Tree-sitter (19 languages supported)
- Build graph — Stores code structure (functions, classes, imports, calls) in local SQLite
- AI gets context — When you ask for a code review, AI queries the graph instead of reading entire files
- Pay less — AI reads only affected files, parameters, dependencies. Result: 8.2x fewer tokens
Quick Start (3 minutes)
Installation
pip install generalized-code-review-graph
code-review-graph install # Auto-detects Claude Code, Cursor, Gemini CLI, Windsurf, Zed, etc.
code-review-graph build # Parse your codebase (takes ~10s for 500 files)
First Review
Open your IDE and ask your AI assistant:
Build the code review graph for this project
Then:
Review my changes and show impact radius
The graph will show:
- ✅ Which functions/classes are affected
- ✅ Which tests will break
- ✅ Code complexity of changed code
- ✅ Documentation gaps
- ✅ Code smells introduced
Key Features
🎯 Token Efficiency
- 8.2x average cost reduction (benchmarked on 6 real repos)
- Reads only affected files, not entire codebase
- Works with Claude Code, Cursor, Gemini CLI, Windsurf, Zed, Continue, OpenCode, Antigravity
🔍 Intelligent Code Analysis
| Feature | What It Does |
|---|
| Blast-radius analysis | Shows exactly which functions/tests are affected by changes |
| Code complexity metrics | Cyclomatic complexity, cognitive complexity, nesting depth per function |
| AI readability layer | Extracts docstrings, intent tags (TODO/FIXME), documentation gaps |
| Code smell detection | Automatically flags God objects, long parameter lists, deep nesting, magic numbers |
| Execution flow tracing | Trace call chains from entry points, sorted by criticality |
| Architecture overview | Auto-generated codebase maps with coupling analysis |