| name | code-review-graph |
| description | Build a persistent knowledge graph of your codebase so Claude reads only what matters — up to 49x fewer tokens on coding tasks. |
| triggers | ["build the code review graph","set up code-review-graph for this project","review changes since last commit with graph","analyze blast radius of my changes","reduce tokens when reviewing code","incremental graph update for codebase","find what files are affected by this change","install code review graph mcp"] |
code-review-graph
Skill by 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)
claude plugin marketplace add tirth8205/code-review-graph
claude plugin install code-review-graph@code-review-graph
Restart Claude Code after installation.
pip
pip install code-review-graph
code-review-graph install
Requires Python 3.10+ and uv.
Optional: semantic search support
pip install code-review-graph[embeddings]
Enables vector embeddings via sentence-transformers for semantic_search_nodes_tool.
Initial Setup
After installation, open your project in Claude Code and run:
Build the code review graph for this project
Or use the slash command:
/code-review-graph:build-graph
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
code-review-graph install
code-review-graph build
code-review-graph update
code-review-graph status
code-review-graph watch
code-review-graph visualize
code-review-graph serve
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:
generated/**
*.generated.ts
vendor/**
node_modules/**
dist/**
__pycache__/**
*.pyc
migrations/**
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
from code_review_graph import GraphBuilder
builder = GraphBuilder(repo_path="/path/to/your/project")
stats = builder.build()
print(f"Nodes: {stats['nodes']}, Edges: {stats['edges']}")
update_stats = builder.update()
print(f"Re-parsed: {update_stats['files_updated']} files")
Query the graph
from code_review_graph import GraphQuery
query = GraphQuery(repo_path="/path/to/your/project")
callers = query.get_callers("authenticate_user")
print(callers)
callees = query.get_callees("process_payment")
print(callees)
tests = query.get_tests_for("payments/processor.py")
print(tests)
parents = query.get_inheritance("AdminUser")
print(parents)
Blast-radius analysis
from code_review_graph import ImpactAnalyzer
analyzer = ImpactAnalyzer(repo_path="/path/to/your/project")
impact = analyzer.get_impact_radius("auth/models.py")
print(impact)
changed_files = ["auth/models.py", "payments/processor.py"]
combined_impact = analyzer.get_impact_radius(changed_files)
Semantic search
from code_review_graph import SemanticSearch
search = SemanticSearch(repo_path="/path/to/your/project")
search.embed()
results = search.search("rate limiting middleware", top_k=5)
for r in results:
print(r["node"], r["file"], r["score"])
Find large functions
from code_review_graph import GraphQuery
query = GraphQuery(repo_path="/path/to/your/project")
large = query.find_large_functions(threshold=50)
for item in large:
print(f"{item['name']} in {item['file']}: {item['lines']} lines")
Common Patterns
Pattern: Review only what changed in the current branch
/code-review-graph:review-delta
Claude will:
- Call
build_or_update_graph_tool to sync the graph with your edits
- Call
get_impact_radius_tool on changed files
- Call
get_review_context_tool to get a compact structural summary
- Review only the relevant ~15 files instead of the full codebase
Pattern: Continuous watch during development
code-review-graph watch
Any file save triggers an incremental re-parse of only that file and its dependents.
Pattern: Pre-commit hook
code-review-graph update
Makes the graph always current before Claude sees a commit.
Pattern: Visualise the dependency graph
code-review-graph visualize
Pattern: Check graph health
code-review-graph status
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:
EXTENSION_TO_LANGUAGE = {
".ex": "elixir",
".exs": "elixir",
}
_CLASS_TYPES["elixir"] = {"defmodule"}
_FUNCTION_TYPES["elixir"] = {"def", "defp"}
_IMPORT_TYPES["elixir"] = {"alias", "import", "use", "require"}
_CALL_TYPES["elixir"] = {"call"}
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:
echo ".code-review-graph/" >> .gitignore
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
code-review-graph update
code-review-graph build
MCP server not connecting to Claude Code
code-review-graph install
claude mcp list
Then restart Claude Code.
uv not found
curl -LsSf https://astral.sh/uv/install.sh | sh
pip install uv
Semantic search not working
pip install "code-review-graph[embeddings]"
code-review-graph embed
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:
- Graph query: Claude calls
get_impact_radius_tool with the changed files
- Blast-radius tracing: the graph follows call edges, import edges, and test edges to find every affected node
- Compact summary:
get_review_context_tool returns a 156–207 token structural summary (callers, dependents, test coverage gaps, dependency chains)
- 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.