Loading...
Loading...
Build a persistent knowledge graph of your codebase so Claude reads only what matters — up to 49x fewer tokens on coding tasks.
npx skill4agent add aradotso/trending-skills code-review-graphSkill by ara.so — Daily 2026 Skills collection.
code-review-graphclaude plugin marketplace add tirth8205/code-review-graph
claude plugin install code-review-graph@code-review-graphpip install code-review-graph
code-review-graph install # registers the MCP server with Claude Codepip install code-review-graph[embeddings]sentence-transformerssemantic_search_nodes_toolBuild the code review graph for this project/code-review-graph:build-graph# Register MCP server with Claude Code
code-review-graph install
# Parse entire codebase into the graph (first run)
code-review-graph build
# Re-parse only changed files (subsequent runs)
code-review-graph update
# Show graph statistics: node count, edge count, language breakdown
code-review-graph status
# Auto-update the graph as you save files (continuous watch mode)
code-review-graph watch
# Generate an interactive D3.js HTML visualisation of the graph
code-review-graph visualize
# Start the MCP server manually (Claude Code does this automatically)
code-review-graph serve| Command | What it does |
|---|---|
| Build or rebuild the code graph from scratch |
| Review changes since the last commit |
| Full PR review with blast-radius analysis |
| Tool | Purpose |
|---|---|
| Build or incrementally update the graph |
| Find all files/functions affected by a change |
| Return a token-optimised structural summary for review |
| Query callers, callees, tests, imports, inheritance |
| Search code entities by name or meaning |
| Compute vector embeddings for semantic search |
| Graph size and health statistics |
| Retrieve documentation sections |
| Find functions/classes over a line-count threshold |
.code-review-graphignoregenerated/**
*.generated.ts
vendor/**
node_modules/**
dist/**
__pycache__/**
*.pyc
migrations/**from code_review_graph import GraphBuilder
builder = GraphBuilder(repo_path="/path/to/your/project")
# Full build (first time)
stats = builder.build()
print(f"Nodes: {stats['nodes']}, Edges: {stats['edges']}")
# Incremental update (subsequent runs — only parses changed files)
update_stats = builder.update()
print(f"Re-parsed: {update_stats['files_updated']} files")from code_review_graph import GraphQuery
query = GraphQuery(repo_path="/path/to/your/project")
# Find all callers of a function
callers = query.get_callers("authenticate_user")
print(callers)
# ['api/views.py::login_view', 'tests/test_auth.py::test_login']
# Find all callees (functions called by a function)
callees = query.get_callees("process_payment")
print(callees)
# Find tests that cover a file
tests = query.get_tests_for("payments/processor.py")
print(tests)
# Get inheritance chain for a class
parents = query.get_inheritance("AdminUser")
print(parents)
# ['BaseUser', 'PermissionMixin']from code_review_graph import ImpactAnalyzer
analyzer = ImpactAnalyzer(repo_path="/path/to/your/project")
# What is affected if this file changes?
impact = analyzer.get_impact_radius("auth/models.py")
print(impact)
# {
# "direct_callers": ["api/views.py", "middleware/auth.py"],
# "transitive_dependents": ["api/tests/test_views.py", "integration/test_flow.py"],
# "test_files": ["tests/test_auth.py"],
# "blast_radius_size": 7
# }
# Multiple changed files (e.g., from a git diff)
changed_files = ["auth/models.py", "payments/processor.py"]
combined_impact = analyzer.get_impact_radius(changed_files)from code_review_graph import SemanticSearch
# Requires: pip install code-review-graph[embeddings]
search = SemanticSearch(repo_path="/path/to/your/project")
# Embed the graph (one-time, cached)
search.embed()
# Search for code entities by concept
results = search.search("rate limiting middleware", top_k=5)
for r in results:
print(r["node"], r["file"], r["score"])from code_review_graph import GraphQuery
query = GraphQuery(repo_path="/path/to/your/project")
# Find functions/classes over 50 lines (good for refactoring targets)
large = query.find_large_functions(threshold=50)
for item in large:
print(f"{item['name']} in {item['file']}: {item['lines']} lines")# In Claude Code, after making changes:
/code-review-graph:review-deltabuild_or_update_graph_toolget_impact_radius_toolget_review_context_tool# Terminal 1: keep the graph fresh as you code
code-review-graph watch
# Terminal 2: your normal development workflow# .git/hooks/pre-commit
#!/bin/sh
code-review-graph updatecode-review-graph visualize
# Opens an interactive D3.js force-directed graph in your browser
# Toggle edge types: calls, imports, inheritance, test coverage
# Search nodes by namecode-review-graph status
# Example output:
# Graph: .code-review-graph/graph.db
# Nodes: 4,821 (functions: 2,103 | classes: 487 | files: 312)
# Edges: 11,204 (calls: 7,891 | imports: 2,108 | inherits: 205 | tests: 1,000)
# Languages: Python (180), TypeScript (98), JavaScript (34)
# Last updated: 2026-03-26 01:22:11 (3 files changed)code_review_graph/parser.py# 1. Add file extension mapping
EXTENSION_TO_LANGUAGE = {
# ... existing entries ...
".ex": "elixir",
".exs": "elixir",
}
# 2. Add AST node type mappings for the new language
_CLASS_TYPES["elixir"] = {"defmodule"}
_FUNCTION_TYPES["elixir"] = {"def", "defp"}
_IMPORT_TYPES["elixir"] = {"alias", "import", "use", "require"}
_CALL_TYPES["elixir"] = {"call"}tests/fixtures/elixir/.code-review-graph/graph.db.gitignoreecho ".code-review-graph/" >> .gitignorecode-review-graph update # incremental re-parse of changed files
# or, if something seems wrong:
code-review-graph build # full rebuild from scratch# Re-register the MCP server
code-review-graph install
# Verify it's registered
claude mcp listuv# Install uv (required by the MCP server runner)
curl -LsSf https://astral.sh/uv/install.sh | sh
# or
pip install uv# Install the embeddings extra
pip install "code-review-graph[embeddings]"
# Compute embeddings (required once after install)
code-review-graph embed # or call embed_graph_tool via ClaudeEXTENSION_TO_LANGUAGEcode-review-graph statusupdateget_impact_radius_toolget_review_context_tool