The Problem

AI coding assistants re-read the entire codebase on every task, burning tokens and slowing down reviews. code-review-graph addresses this by building a persistent structural map of the codebase using Tree-sitter, so the assistant only reads the files relevant to the current change.

What This Does

The project is a Python package (codereviewgraph/) that parses code into a graph database, tracks changes incrementally, and exposes the graph to AI tools via MCP. The core pipeline lives in parser.py, graph.py, and incremental.py. The tools/ directory contains MCP tool definitions for querying the graph, analyzing blast radius, and reviewing diffs.

A separate VS Code extension (code-review-graph-vscode/) provides a UI for exploring the graph, with features like blastRadius.ts and reviewAssistant.ts. The eval/ directory includes benchmarks for token efficiency and search quality, and the skills/ folder has prompt templates for common workflows like review-changes and refactor-safely.

How To Use It

Setup: Install via pip install code-review-graph or pipx. The pyproject.toml confirms a standard Python package. The VS Code extension has its own package.json and can be built with npm.

Configuration: Run code-review-graph install to auto-detect AI platforms (Claude Code, Cursor, Codex, etc.) and write MCP configs. The .mcp.json file at the root is the MCP server config. Platform-specific rules are injected into AGENTS.md or CLAUDE.md.

Running: Build the graph with code-review-graph build. Then ask your AI assistant to "Build the code review graph for this project". The graph updates automatically on file edits and git commits via the daemon (daemon.py).

pip install code-review-graph code-review-graph install code-review-graph build

Real-World Use

For a team using Claude Code on a large monorepo, this fits between the AI tool and the codebase. The assistant queries the graph via MCP to find the blast radius of a change. The blastRadius feature in the VS Code extension identifies affected files, and the review-changes skill produces a focused review without scanning the whole repo. Token usage drops from reading 10,000 files to reading the 50 that matter.

Code Health & Issues

Med - Duplicate files: Multiple files with " 2" and " 3" suffixes (analysis 2.py, enrich 2.py, exports 3.py, graph_diff 2.py) suggest merge conflicts or accidental copies. These are dead code and a maintenance hazard. Med - Test coverage gaps: tests/ has 31 fixture files but only one actual test file (sqlite.test.ts). The Python side has no test files, despite the eval/benchmarks/ directory. CI exists (.github/workflows/ci.yml) but the breadth of testing is unclear. Low - Mixed language detection: The analysis detected React, Flask, FastAPI, and Express, but the actual code is Python and TypeScript. The eval configs (flask.yaml, fastapi.yaml, express.yaml) are benchmarks, not the app itself. Low - Missing docs for edge cases: docs/TROUBLESHOOTING.md exists, but there's no documentation on the incremental update failure modes or how to rebuild a corrupted graph.

The Bottom Line

This is a practical tool for teams using AI coding assistants on large codebases. The token reduction claims are plausible given the architecture, and the MCP integration is well-thought-out. The duplicate files and thin test coverage are concerns, but the core design is sound. Best suited for teams already invested in AI-assisted development who want to control token costs.