Skip to main content
ClaudeWave
ES, Spanish
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 estrellas
  • 3k forks
  • 186 issues abiertos
  • Lenguaje: Python
  • Licencia: MIT
  • actualizado

Instalación

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

Nota editorial

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

Resumen de Tools

README completo en 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
Preguntas frecuentes

Lo que la gente pregunta sobre code-review-graph

¿Qué es tirth8205/code-review-graph?

tirth8205/code-review-graph es tools para el ecosistema de Claude AI. 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. Tiene 32.3k estrellas en GitHub y su última actualización registrada es del 2026-10-16.

¿Cómo se instala code-review-graph?

Puedes instalar code-review-graph clonando el repositorio (https://github.com/tirth8205/code-review-graph) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar tirth8205/code-review-graph?

Nuestro agente de seguridad ha analizado tirth8205/code-review-graph y le ha asignado un Trust Score de 100/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.

¿Quién mantiene tirth8205/code-review-graph?

tirth8205/code-review-graph es mantenido por tirth8205. La última actividad registrada en GitHub es del 2026-10-16, con 186 issues abiertos.

¿Hay alternativas a code-review-graph?

Sí. En ClaudeWave puedes explorar tools similares en /categories/tools, ordenados por popularidad o actividad reciente.

¿Mantienes este repo? Muestra su Trust Score en tu README

La insignia muestra el Trust Score y el veredicto actuales de este repositorio y enlaza a esta página. Sigue los datos del catálogo: nadie puede comprar ni editar la puntuación que enseña.

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>

Qué significa la insignia y cómo se calcula la puntuación

Alternativas

Ver todas