Code Review Graph
raw JSON → 2.3.3 verified Sat May 09 auth: no python
Persistent incremental knowledge graph for token-efficient, context-aware code reviews with Claude Code. Current version 2.3.3, requires Python >=3.10. Active development with frequent releases (~biweekly).
pip install code-review-graph Common errors
error ModuleNotFoundError: No module named 'code_review_graph' ↓
cause Package installed as 'code-review-graph' (hyphen) but import uses underscores.
fix
Use 'from code_review_graph import CodeReviewGraph' (underscores).
error Hang on build_or_update_graph_tool on Windows ↓
cause Windows event-loop policy issue in Python <3.14, partially fixed in v2.3.1 but may still hang for some.
fix
Upgrade to Python 3.14+ or run on Unix. Ensure uvx --reinstall code-review-graph.
error ValueError: Cannot determine repo root ↓
cause Repository root not provided and not detected automatically (no .git directory).
fix
Pass explicit --repo /path/to/repo or set REPO_ROOT environment variable.
Warnings
breaking fastmcp upgraded from 1.0 to >=2.14.0,<3 in v2.2.4 due to CVEs. This is a breaking dependency change; ensure your environment resolves the new constraint. ↓
fix pip install -U code-review-graph
gotcha On Windows, 'build_or_update_graph_tool' and 'embed_graph_tool' MCP tools may hang indefinitely on Python <3.14. v2.3.1 fixed the event-loop policy but hang persists for some users. ↓
fix Upgrade to v2.3.1+ and ensure uvx/pip is reinstall.
deprecated The 'CRG_DATA_DIR' environment variable is now the canonical config directory; older 'CRG_CONFIG_DIR' may still work but is non-standard. ↓
fix Use CRG_DATA_DIR instead of CRG_CONFIG_DIR.
gotcha The 'serve --repo <X>' flag is ignored by 21 of 24 MCP tools in versions <2.2.3.1. Only get_docs_section_tool respects it. ↓
fix Upgrade to v2.2.3.1 or later.
breaking Hook schema changed in v2.2.3. You must re-run 'code-review-graph install' to rewrite .claude/settings.json after upgrading. ↓
fix code-review-graph install
Install
uvx --reinstall code-review-graph Imports
- CodeReviewGraph wrong
from code-review-graph import CodeReviewGraphcorrectfrom code_review_graph import CodeReviewGraph
Quickstart
from code_review_graph import CodeReviewGraph
import os
graph = CodeReviewGraph(repo_root=os.environ.get('REPO_ROOT', '.'))
graph.build()
# Get minimal context for a file
context = graph.get_context("path/to/file.py", detail='minimal')
print(context)