code-review-graph
Build a persistent knowledge graph of your codebase so Claude reads only what matters — up to 49x fewer tokens on coding tasks.
By reason-machines · 1,221 installs
npx skills add reason-machines/trending-skills --skill code-review-graph
Source repository · Upstream listing
code review graph
Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
code review graph builds a persistent structural map of a codebase using Tree sitter, stores it in a local SQLite graph, and exposes it to Claude via MCP. Instead of re reading entire projects on every task, Claude queries the graph and reads only the files in the blast radius of a change — averaging 6.8× fewer tokens on code reviews and up to 49× on daily coding tasks in large monorepos.
Installation
Claude Code Plugin (recommended)
Restart Claude Code after installation.
pip
Requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).
Optional: semantic search support
Enables vector embeddings via sentence transformers for semantic search nodes tool .
Initial Setup
After installation, open your project in Claude Code and run:
Or use the slash command:
The first build parses the full codebase (~10 seconds for 500 files). After that, the graph updates incrementally on every file save and git commit (under 2 seconds for a 2,900 file project).
CLI Reference
Slash Commands in Claude Code
Command What it does
/code review graph:build graph Build or rebuild the code graph from scratch
/code review graph:review delta Review changes since the last commit
/code review graph:review pr Full PR review with blast radius analysis
MCP Tools (used automatically by Claude)
Once the graph is built, Claude calls these tools without manual prompting:
Tool Purpose
build or update graph tool Build or incrementally update the graph
get impact radius tool Find all files/functions affected by a change
get review context tool Return a token optimised structural summary for review
query graph tool Query callers, callees, tests, imports, inheritance
semantic search nodes tool Search code entities by name or meaning
embed graph tool Compute vector embeddings for semantic search
list graph stats tool Graph size and health statistics
get docs section tool Retrieve documentation sections
find large functions tool Find functions/classes over a line count threshold
Configuration: Ignoring Paths
Create .code review graphignore in the repository root:
The graph will skip these paths during build and update.
Python API
The graph can be queried programmatically for custom tooling or scripts.
Build and update the graph
Query the graph
Blast radius analysis
Semantic search
Find large functions
Common Patterns
Pattern: Review only what changed in the current branch
Claude will:
1. Call build or update graph tool to sync the graph with your edits
2. Call get impact radius tool on changed files
3. Call get review context tool to get a compact structural summary
4. Review only the relevant ~15 files instead of the full codebase
Pattern: Continuous watch during development
Any file save triggers an incremental re parse of only that file and its dependents.
Pattern: Pre commit hook
Makes the graph always current before Claude sees a commit.
Pattern: Visualise the dependency graph
Pattern: Check graph health
Supported Languages
Python, TypeScript, JavaScript, Vue, Go, Rust, Java, C , Ruby, Kotlin, Swift, PHP, Solidity, C/C++
Each language has full Tree sitter grammar support for: functions, classes, imports, call sites, inheritance chains, and test detection.
Adding a New Language
Edit code review graph/parser.py :
Then add a test fixture in tests/fixtures/elixir/ and open a PR.
Where the Graph Is Stored
The graph is stored locally in .code review graph/graph.db (SQLite). There is no external database, no cloud dependency, and no data leaves your machine. Add it to .gitignore if you don't want it committed:
Or commit it to share the pre built graph with your team (saves the ~10 second initial build for each developer).
Troubleshooting
Graph is stale / not reflecting recent changes
MCP server not connecting to Claude Code
Then restart Claude Code.
uv not found
Semantic search not working
A language isn't being parsed
Check that the file extension is in EXTENSION TO LANGUAGE and the corresponding Tree sitter grammar is installed. Run code review graph status to see which languages were detected in your project.
Build is slow on first run
Expected — Tree sitter parses every file. A 500 file project takes ~10 seconds. All subsequent update calls complete in under 2 seconds because only changed files are re parsed (detected via SHA 256 hash comparison).
How the Token Reduction Works
On every review or coding task:
1. Graph query : Claude calls get impact radius tool with the changed files
2. Blast radius tracing : the graph follows call edges, import edges, and test edges to find every affected node
3. Compact summary : get review context tool returns a 156–207 token structural summary (callers, dependents, test coverage gaps, dependency chains)
4. Targeted reading : Claude reads only the ~15 files in the blast radius, not the full codebase
In the Next.js monorepo (27,732 files): without the graph Claude reads ~739K tokens; with the graph it reads ~15K tokens — a 49× reduction.