Skip to main content
ClaudeWave
EN, English
tirth8205 / Tools

code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

  • 32.3k stars
  • 3k forks
  • 186 open issues
  • Language: Python
  • License: MIT
  • updated

Install

Terminal
git clone https://github.com/tirth8205/code-review-graph
  1. Clone the repository.
  2. Follow the README for installation and usage instructions.

Editor's note

code-review-graph is a Python library that parses a codebase into a persistent knowledge graph using Tree-sitter, storing functions, classes, imports, and their relationships (calls, inheritance, test coverage) in a SQLite database. When a developer asks an AI assistant to review code, the tool computes a "blast radius" by tracing callers, dependents, and affected tests from the changed files, then exposes only that minimal file set to the assistant via MCP-compatible tools. It integrates with Claude Code through an auto-detected MCP configuration written by the `code-review-graph install` command, which also targets Cursor, Copilot, Gemini CLI, and roughly a dozen other platforms in one pass. Incremental re-indexing via file-save hooks or watch mode updates a 2,900-file project in under two seconds. The README benchmarks token reductions between 38x and 528x across six real repositories, making the tool most useful for developers working in large codebases where unfiltered context would otherwise exhaust token budgets during routine review tasks.

README

Tools overview

Full README on GitHub

code-review-graph

target="_blank" rel="noopener noreferrer"> alt="tirth8205%2Fcode-review-graph | Trendshift" width="250" height="55" />

A local code knowledge graph that gives AI coding tools precise review context over MCP. English | 简体中文 | 日本語 | 한국어 | हिन्दी

Usage · Commands · FAQ · Troubleshooting · GitHub Action · Reproducing the benchmarks · Roadmap

AI coding tools often re-read large parts of a codebase to review a change. code-review-graph builds a structural map of the code with Tree-sitter, keeps it updated incrementally, and serves compact context over MCP, so the assistant reads only the files a change touches.


Quick Start

pip install code-review-graph          # or: pipx install code-review-graph
code-review-graph install              # detect installed AI coding tools and configure each one
code-review-graph build                # parse the codebase

install detects which AI coding tools you have, writes an MCP server entry for each, installs hooks and skills where the platform supports them, and adds graph instructions to the platform's rules file. The MCP entry uses poetry run or uv run inside a Poetry or uv project environment, uvx code-review-graph serve when uvx is on PATH, and otherwise the current Python interpreter. Restart the editor or tool afterwards.

To configure one platform, pass --platform with one of codex, claude-code, cursor, windsurf, zed, continue, opencode, antigravity, gemini-cli, qwen, kiro, qoder, copilot, copilot-cli, codebuddy, or hermes:

code-review-graph install --platform cursor
code-review-graph install --platform codebuddy

Config file locations are listed in docs/USAGE.md. Requires Python 3.10+.

uninstall removes CRG-owned files and entries from a Git or SVN working tree and leaves other MCP servers, hooks, skills and JSONC comments alone. Run it from anywhere inside the tree. Shared config files are replaced atomically, so a failed write leaves the original intact.

code-review-graph uninstall --dry-run    # preview only
code-review-graph uninstall              # preview, confirm, apply
code-review-graph uninstall --yes        # apply without prompting
code-review-graph uninstall --all-repos  # also clean every registered repository
code-review-graph uninstall --keep-data  # remove integrations, keep graph databases
code-review-graph uninstall --keep-user-configs --repo .  # this project only

Then open the project and ask the assistant:

Build the code review graph for this project

Build time scales with repository size; a cold build of a ~3,000-file repository took about 40 seconds (measured). After that, hooks and watch mode keep the graph updated. If some files fail to parse, the result has status partial and names them in its summary; the CLI also prints a Warning: line on stderr, and those files keep their previous graph rows.

How It Works

The repository is parsed into ASTs with Tree-sitter and stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage). At review time the graph is queried for the smallest set of files the assistant needs to read.

Blast-radius analysis

When a file changes, the graph traces every caller, dependent and test that could be affected. The assistant reads those files instead of scanning the whole project.

Incremental updates

Hooks, the pre-commit hook and watch mode trigger incremental updates. The update diffs changed files, finds their dependents through the graph's import and call edges, and re-parses only the files whose SHA-256 hash changed. On a ~3,000-file project (django) a two-file edit re-indexes in about 2.5 seconds on the path the hooks use, of which ~1.4 s is process start-up; a no-op update costs only that start-up. See Incremental update latency.

Whole codebase or targeted answer?

Instead of feeding a whole corpus to the model, the graph returns a slice shaped to the question. In the 2026-08-02 capture of this repository at 84bde354, 208,821 source tokens became ~3,190 tokens per question. The repository has grown a lot since that snapshot, so both numbers are larger today.

Language coverage and notebooks

The parser extracts functions, classes, imports, call sites, inheritance and tests, using Tree-sitter where a grammar exists and targeted fallbacks elsewhere. Supported: Python, JavaScript/TypeScript/TSX, Go, Rust, Java, C/C++, C#, VB.NET, Ruby, Kotlin, Swift, PHP, Scala, Solidity, Dart, R, Perl, Lua/Luau, Objective-C, shell scripts, Elixir, Zig, PowerShell, Julia, ReScript, GDScript, Nix, Verilog/SystemVerilog, SQL, Terraform/OpenTofu (.tf; other .hcl files become file nodes only), Ansible YAML (playbooks, roles, tasks), Spring Boot application config (application.properties, application.yml, application.yaml and their application- variants; key names and value types only, never values), Vue/Svelte SFCs, Astro files (parsed with the TypeScript grammar), Jupyter and Databricks notebooks (.ipynb), and Perl XS files (.xs). Other YAML and other .properties files are not treated as source code.

PHP projects also get repository-bounded Composer PSR-4 resolution, Blade template references, and Laravel Route and Eloquent edges when the source shows explicit framework imports, model inheritance and receiver evidence.

Topics
ai-codingclaudeclaude-codecode-reviewgraphragincrementalknowledge-graphllmmcppythonstatic-analysistree-sitter
Frequently asked

What people ask about code-review-graph

What is tirth8205/code-review-graph?

tirth8205/code-review-graph is tools for the Claude AI ecosystem. Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows. It has 32.3k GitHub stars and its last recorded update is dated 2026-10-16.

How do I install code-review-graph?

You can install code-review-graph by cloning the repository (https://github.com/tirth8205/code-review-graph) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is tirth8205/code-review-graph safe to use?

Our security agent has analyzed tirth8205/code-review-graph and assigned a Trust Score of 100/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.

Who maintains tirth8205/code-review-graph?

tirth8205/code-review-graph is maintained by tirth8205. The last recorded GitHub activity is dated 2026-10-16, with 186 open issues.

Are there alternatives to code-review-graph?

Yes. On ClaudeWave you can browse similar tools at /categories/tools, sorted by popularity or recent activity.

Maintain this repo? Show its Trust Score in your README

The badge shows this repository's current Trust Score and verdict, and links back to this page. It follows the catalogue data: nobody can buy or edit the score it displays.

ClaudeWave Trust Score for tirth8205/code-review-graph
Markdown (README)
[![ClaudeWave Trust Score for tirth8205/code-review-graph](https://claudewave.com/api/badge/tirth8205-code-review-graph)](https://claudewave.com/en/repo/tirth8205-code-review-graph)
HTML
<a href="https://claudewave.com/en/repo/tirth8205-code-review-graph"><img src="https://claudewave.com/api/badge/tirth8205-code-review-graph" alt="ClaudeWave Trust Score for tirth8205/code-review-graph" width="320" height="64"></a>

What the badge means and how the score is computed

Alternatives

See all