Overview
AI coding tools handle review tasks by reading large parts of a repository, and the token bill scales with the repository rather than the change. code-review-graph attacks that directly: it parses your code with Tree-sitter into a structural map, tracks changes incrementally as you work, and exposes that map to your assistant over the Model Context Protocol, so the assistant asks the graph a question instead of reading files until it finds the answer.
The project's headline illustration is a Flask example: reading the whole corpus costs 143,594 tokens where a graph answer costs 2,196 — 71× fewer. The repository ships a reproduction guide for its benchmarks, so the numbers are checkable rather than asserted.
Setup is deliberately one command. code-review-graph install auto-detects which AI coding tools are present on the machine, writes the correct MCP configuration for each, installs platform-native hooks and skills where the platform supports them, and injects graph-aware instructions into that platform's rules file. It detects whether you installed via uvx or pip/pipx and generates the matching configuration. Supported platforms span Codex, Claude Code, CodeBuddy Code, Cursor, Windsurf, Zed, Continue, OpenCode, Antigravity, Gemini CLI, Qwen, Qoder, Kiro, GitHub Copilot and the Copilot CLI; --platform narrows it to one.
It is MIT-licensed Python (3.10+), published on PyPI, runs entirely locally, and also ships a GitHub Action for using the same graph in CI.
What it does
- Tree-sitter parsing into a persistent structural graph of the codebase, updated incrementally as code changes
- MCP server so any MCP-capable coding tool can query the graph instead of reading whole files
- One-command install that configures every supported AI coding tool it detects, including hooks, skills and rules injection
- Local-first: the graph is built and queried on your machine
- Benchmarked context reductions with a published reproduction guide
- A GitHub Action for running the same graph-backed review in CI
Getting started
Python 3.10 or newer. The three commands below are the project's own quick start; restart your editor or tool after installing so it picks up the new MCP configuration.
Install
pip install code-review-graph
# or: pipx install code-review-graphConfigure your tools and build the graph
install auto-detects the supported AI coding tools on your machine and writes each one's MCP configuration; build parses the repository.
code-review-graph install
code-review-graph buildOr target one platform
code-review-graph install --platform codex
code-review-graph install --platform cursorCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Cutting the token cost of AI code review on a large repository by serving structure instead of whole files
- Giving a coding assistant a stable, incrementally-updated map of an unfamiliar codebase
- Standardising the same context layer across several AI coding tools with one install step
- Running graph-backed review in CI through the shipped GitHub Action
How code-review-graph compares
code-review-graph alongside other open-source code indexing & search tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| CodeGraph | ★ 74.3k | Builds a local SQLite knowledge graph of a codebase with a Rust tree-sitter kernel, keeps it in sync through a file watcher, and serves symbols, call paths and blast radius to coding agents over MCP. |
| GitNexus | ★ 47.9k | Indexes a codebase into a knowledge graph of dependencies, call chains and execution flows, then exposes it to Claude Code, Cursor and Codex through MCP tools. |
| codebase-memory-mcp | ★ 46.7k | A native MCP server that indexes a repository into a persistent tree-sitter knowledge graph of functions, call chains and routes, queried by agents through 15 tools. |
| code-review-graph | ★ 32.2k | Builds a Tree-sitter map of your codebase and serves it to AI coding tools over MCP, so they read only the code a task needs |
| Claude Context | ★ 12.6k | An MCP server that indexes your codebase into a vector database so AI coding agents can find relevant code by meaning instead of loading whole folders. |
| Graft | ★ 10.2k | Builds a persistent knowledge graph of your codebase as linked markdown files, then feeds the matching nodes to coding agents so they stop re-exploring the repo on every task. |
| XERJ | ★ 7k | Single-binary, Elasticsearch-compatible search engine whose autoindex command turns any folder of code, docs, logs or PDFs into typed indices that AI coding agents query via CLI or MCP instead of grepping. |
| Semble | ★ 6.2k | A CPU-only code search library and MCP server that indexes a repository with tree-sitter chunking, Model2Vec embeddings and BM25, so an agent retrieves the few relevant snippets instead of grepping and reading whole files. |