In short.
code-review-graph is a local command-line tool for developers using AI coding assistants; it maps code relationships to help identify which files a change may affect. It also runs as an MCP server, so MCP-capable assistants can review a change by reading only the affected files. Its main catch is that the large headline token savings compare against reading the whole codebase, while the README's own more realistic grep-style baseline gives a much smaller median. It uses Tree-sitter to parse code into functions, classes, imports, calls and tests, stores them in one SQLite file, and answers questions such as blast radius, risk-scored changes, execution flows and test gaps through 30 MCP tools. It installs into many AI coding tools with one command, updates incrementally through hooks or a watcher, and has an optional GitHub Action for pull request comments. The software is MIT licensed. Everything here comes from the README and licence text at one revision. Nothing was installed or run, and the benchmark figures are the project's own.
Researched and written by an AI model and checked by a second AI model. How it works
The selected scope is the single README.md at [https://github.com/tirth8205/code-review-graph/blob/staging/README.md], captured at revision bbdda4b9e4b4818a9f04d7ef96ac0e50da13f208, together with the LICENSE notice at the same revision. Everything in this report comes from those two files. Not covered: the source code, the PyPI package, images and diagrams, and the linked documents (USAGE, COMMANDS, FAQ, TROUBLESHOOTING, REPRODUCING, CHANGELOG, GITHUB_ACTION, ROADMAP). Nothing was installed, built or run, so install behaviour, hooks, MCP tool outputs, benchmark numbers and privacy claims are the project's own statements and were not tested or independently verified.
The overview
What it is
code-review-graph is a local command-line tool for developers using AI coding assistants; it maps code relationships to help identify which files a change may affect. It is a Python package by Tirth Kanani, published under the MIT licence with a 2026 copyright notice. The README describes it as a local code knowledge graph that gives AI coding tools precise review context over the Model Context Protocol (MCP). Its command is code-review-graph, and a separate crg-daemon command is also mentioned. The project website is given as [https://code-review-graph.com] and the package as code-review-graph on PyPI.
The reviewed file is the README at revision bbdda4b9e4b4818a9f04d7ef96ac0e50da13f208 on the staging branch. It names version 2.4.0 in its GitHub Action example and upgrade notes. The README is the only project file reviewed besides the licence.
Overall assessment
On the README alone, this looks like a substantial, carefully documented tool. It covers install, preview, uninstall, a doctor check, upgrade warnings, Windows and Docker notes, an environment variable table and a section of named limitations. It is also candid about its benchmarks: it labels recall 1.0 as circular, says the co-change benchmark returned no predictions because of a path bug, and says the reported numbers will change once the benchmarks are re-run.
The main caution is that the largest efficiency claim (about 63x median, up to 358x) compares a graph answer with the tokens of the whole corpus. The README itself calls that an upper bound no real agent pays. Against a grep-style baseline it reports a median of 6.65x. Whether you would see savings on your own repository and assistant is not established by this evidence. No end-to-end measurement of an agent that opens the files the graph names is reported; the README lists that as open work.
Nothing was executed for this review, so every behaviour below is as documented by the project, not observed.
Who it is for
It is for developers who use an AI coding assistant and want it to review or navigate changes in a repository without re-reading large parts of it. The README lists the assistants it can set up: Codex, Claude Code, CodeBuddy Code, Cursor, Windsurf, Zed, Continue, OpenCode, MiMo Code, Antigravity, Gemini CLI, Qwen Code, Qoder, Kiro, GitHub Copilot, GitHub Copilot CLI, Hermes Agent and DeepSeek Harness. Compatibility with MCP clients beyond those named in the README is unknown.
Teams can also use the GitHub Action to get a risk-scored comment on pull requests, with an optional merge gate. The README says small repositories, trivial single-file diffs and one-off questions are cases where it may not be worth using. It points to its FAQ for that, and the FAQ was not captured.
Beginners should note that this is a command-line tool that edits your assistant's configuration. It is not a chat app. Its main interfaces are the command line and MCP server; the README also documents an interactive HTML graph.
What it can do
The README groups the features as follows. Mapping: functions, classes, imports, calls and tests become one graph. Blast radius: the callers, dependents and tests a change can reach, with a risk score. Updating: hooks and watch mode re-parse only changed files. Integration: one install command configures each supported tool it finds. Storage: one SQLite file on your machine.
The feature table adds the following. Semantic and full-text hybrid search, with optional embeddings from sentence-transformers, Google Gemini, MiniMax, Voyage AI or any OpenAI-compatible endpoint. Execution flows from entry points. Community detection with Leiden clustering. Hub and bridge detection. Surprise scoring for unexpected coupling. Knowledge-gap analysis such as untested hotspots and import cycles. Edge confidence tiers (EXTRACTED, INFERRED, AMBIGUOUS, UNRESOLVED). Graph traversal with a token budget. Rename preview, dead-code detection and refactoring suggestions. Markdown wiki generation. A multi-repo registry and daemon. Exports to GraphML, Neo4j Cypher, Obsidian, JSON and SVG. An interactive D3.js visualisation.
The server exposes 30 MCP tools. The README says 25 are read-only and carry a readOnlyHint, and five write: build_or_update_graph_tool, run_postprocess_tool, embed_graph_tool, apply_refactor_tool and generate_wiki_tool. It also provides five MCP prompts: review_changes, architecture_map, debug_issue, onboard_developer and pre_merge_check. For Claude Code, Gemini CLI, CodeBuddy Code, Hermes Agent and Qoder, install writes four skills: explore-codebase, review-changes, debug-issue and refactor-safely.
Language coverage is broad: Python, JavaScript, TypeScript, Go, Rust, Java, C and C++, C#, Ruby, Kotlin, Swift, PHP, Scala and many more, plus Terraform, Ansible YAML, SQL, Jupyter and Databricks notebooks, Vue and Svelte files and others. There are framework-aware paths for PHP (Composer PSR-4, Blade, Laravel routes and Eloquent) and Java (Spring injection, endpoints, events, AOP and Temporal). Further languages can be added through a languages.toml file that maps extensions to a bundled Tree-sitter grammar.
Using it
Requirements
Python 3.10 or newer is required. The README shows installation with uv tool install, pipx or pip. Optional dependency groups add features: embeddings (sentence-transformers), google-embeddings, communities (igraph), enrichment (Jedi call resolution for Python), eval (benchmarks and SVG export through matplotlib), wiki and all.
You need an AI coding tool that supports MCP for the main workflow. Hooks and skills are written only for platforms that support them. Tools such as Windsurf and Zed are described as having no hooks from install, so the README suggests the daemon for keeping the graph fresh.
The README does not state hardware requirements, disk space or memory needs. The only memory note is that the optional CRG_VECTOR_CACHE setting costs RAM in proportion to the number of vectors times their dimensions. Build times are given only as examples: about 40 seconds for a cold build of a roughly 3,000-file repository.
For the optional GitHub Action you need a repository on GitHub with the workflow permissions shown (contents read, pull-requests write).
How it works
The repository is parsed into abstract syntax trees with Tree-sitter, using targeted fallbacks where no grammar exists. The result is stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage) in a single SQLite file inside .code-review-graph/. At review time the graph is queried for the smallest set of files the assistant needs to read.
Incremental updates are triggered by editor hooks, git hooks (pre-commit, post-checkout, post-merge, post-rewrite) and a watch mode. An update diffs the changed files, finds their dependents through import and call edges, and re-parses only files whose SHA-256 hash changed. The README reports about 2.5 seconds for a two-file edit on a roughly 3,000-file project (Django), of which about 1.4 seconds is process start-up.
Impact analysis walks callers, dependents and tests from the changed code, with default limits you can change through environment variables (for example CRG_MAX_IMPACT_DEPTH defaults to 2 and CRG_MAX_IMPACT_NODES to 500). The README says the analysis is deliberately conservative, so it may flag extra files rather than miss a dependency.
Search is hybrid: SQLite FTS5 keyword search combined with optional vector similarity. For embeddings, the README says the text sent is identifiers, signatures, structural context and a bounded first-paragraph docstring summary, and that function bodies are not sent. Cloud providers receive that source-derived text.
Each response from the review and impact tools carries an estimated context_savings figure. The README says calibration over 222 sample files puts the estimate within about 1% of real tokens in aggregate, and that --verify cross-checks it with the cl100k_base tokenizer.
Setup
The Quick Start has four commands: install the package (uv tool install code-review-graph, or pipx or pip), run code-review-graph install to configure the AI coding tools found on the machine, run code-review-graph build to parse the codebase, and optionally run code-review-graph detect-changes --brief. Then restart the editor or tool, open the project and ask the assistant to review your changes.
Before running install, note what it does. For each tool it finds, it writes an MCP server entry, installs hooks and skills where the tool supports them, and adds graph instructions to the tool's rules file. It lists the files it will change and asks about instruction files before writing. With no terminal, as when an AI agent runs it, it takes the default answer (yes) and says so. Options to control it: install --dry-run shows diffs and writes nothing, --no-instructions skips the rules files, --platform NAME sets up one named platform even if it was not found, and --gitignore adds the files it created to a marked block in .gitignore. Files written are recorded in .code-review-graph/install-manifest.json.
Undo with code-review-graph uninstall, with --dry-run, --yes, --all-repos, --keep-data and --keep-user-configs variants. The README says it removes only its own entries and leaves other MCP servers, hooks and skills alone, and that shared config files are replaced atomically. code-review-graph doctor checks copies, MCP entries, hooks and graph state and changes nothing.
Upgrading from 2.3.x needs care. The README says every copy must be upgraded, install re-run, and build run once. From 2.4.0 the graph moves to schema 15, a 2.3.9 copy then refuses it, and an older 2.3.x copy can break it. The VS Code extension needs version 0.4.0 to read it. On Windows, the README says not to wrap the Claude Code config in cmd /c, and to point it at the .exe with PYTHONUTF8 set.
No Docker image is published. The README gives steps to build one from a release tag and run it on a mounted repository, with Podman and SELinux notes. Graphs built in the container store container paths, so a host update on the same graph can fail until you rebuild on the host.
Worked example
This is a documented flow, not something run for this review. In a project root you would run code-review-graph install, then code-review-graph build, make a change, and run code-review-graph detect-changes --brief. After editing, if hooks or a watcher have not refreshed the graph, run code-review-graph update --brief first. detect-changes --brief only reads the existing graph. According to the README, detect-changes --brief prints up to three things to review first, each with file and line, a risk score out of 1.00, its callers and its tests. A Token Savings panel follows it.
The README's sample panel reads: full context would be 12,921 tokens, graph context used 762 tokens, saved 12,159 tokens (about 94%), with a breakdown by functions, tests, risk and other. Treat that as an illustration from the README, not a result for any particular repository. In practice you would then ask your assistant, for example, to review your changes, and the assistant would call MCP tools such as get_minimal_context_tool, detect_changes_tool and get_review_context_tool.
For CI, the README gives a workflow that runs on pull_request, checks out the code, and uses tirth8205/code-review-graph@v2.4.0 with a GitHub token. It posts one sticky comment with risk-scored functions, affected flows and test gaps, updated on every push. The optional fail-on-risk input makes it a merge gate.
Assessment & evidence
Limitations and risks
The README lists five known limits. First, impact recall of 1.0 is circular, because the ground truth comes from the same graph the predictor walks, so it is an upper bound. Second, graph context can exceed a plain file read for trivial single-file edits. Third, search ranking needs work, and Express queries can return no hits because of module-pattern naming. Fourth, flow detection is strongest for Python and PHP/Laravel, and JavaScript and Go need work. Fifth, impact analysis is conservative, so large dependency graphs produce false positives. The reported average precision is 0.546 and average F1 0.693 across 13 commits in 6 repositories.
Benchmark caveats: the figures come from a 2026-08-02 capture (crg 2.3.7) and the 2026-09-22 agent baseline capture, and some are stated to be out of date. The code-review-graph row is a snapshot of an earlier revision. The co-change benchmark returned zero predicted files in that capture because of a path bug, and no co-change number is quoted. The agent_baseline figure predates a ranking change, so re-running the command now gives different numbers.
Operational risks: install edits several tools' config files and rule files, and writes hooks that run on commit. The pre-commit hook prints a short review on each commit. The MCP entry and hooks run the copy of the tool that ran install, so mismatched copies after an upgrade can fail, and an old copy can break a newer graph. A partial build keeps old graph rows for files that failed to parse. Gitignored files are skipped by default. Whether a stale graph can mislead an assistant depends on keeping hooks or the daemon running.
The Codex skill falls back to a read-only CLI and never builds or updates an empty or stale graph implicitly. Behaviour on very large monorepos, memory use and results for languages beyond those benchmarked are not established by this evidence.
Reasoning behind the assessment
The README supports a specific, usable resource: concrete commands, a defined storage model, named MCP tools and documented preview and rollback paths. Its caveats are unusually explicit, which raises confidence that the documentation matches how the tool behaves, though no behaviour was verified here.
The efficiency claim is the part to read carefully. The 63x median compares the graph answer with the entire source corpus, which the README calls an upper bound. The more realistic grep-style comparison gives a 6.65x median (mean 14.8x, range 4.2x to 72.6x) on 18 questions across 6 repositories, and the ratio grows with repository size. The README also says the benchmark measures retrieval cost, not the tokens an agent spends after opening the files. A reasonable reading is that savings are likely larger on big repositories and cross-file questions and smaller on small or single-file work, and that you should measure on your own project.
The benchmark suite is small (6 open-source repositories, 13 commits) and the project's own maintainers run it, so the numbers are project-reported evidence, not independent results. The README says the runs are reproducible, with pinned upstream SHAs, a fixed Leiden seed and deterministic CPU embeddings. This review did not reproduce them.
Alternatives
The README compares itself with three approaches, through FAQ links that were not captured, so only its summary lines are available. Against language servers (LSP), it offers one persistent cross-language graph instead of per-language daemons, and says LSP stays more precise per symbol. Against RAG and embeddings, it says its edges are parsed from the AST, not similarity chunks, and embeddings are optional. Against grep or agentic search, it says grep wins on one-hop lookups and the graph wins on multi-hop questions such as impact radius, callers of callers, tests-for and affected flows.
For many projects the practical alternative is to do nothing extra and let your assistant use its built-in search and file reading, which needs no configuration changes. The trade-off is potentially more context spent per review. Other graph or indexing tools exist, but the evidence does not name or compare any, so no comparison is made here.
Evidence base
Two captured files were read in full: the README (58,266 bytes) at revision bbdda4b9e4b4818a9f04d7ef96ac0e50da13f208, and the LICENSE (1,069 bytes) at the same revision. All statements above come from those two files. The README is the project's own description, so benchmark numbers, timings, platform support and privacy claims are self-reported and unverified here. No source code, tests, CI results, package contents or linked documents (USAGE, COMMANDS, FAQ, TROUBLESHOOTING, REPRODUCING, CHANGELOG, GITHUB_ACTION) were available. No tool was installed or run.
Access & freshness
Costs
The README gives no price for the software, and the MIT licence permits free use. No paid plan, subscription or hosted service is described. The graph is stored locally and the README says there is no cloud service.
Possible indirect costs are not quantified. Cloud embedding providers (Google Gemini, MiniMax, Voyage AI, or an OpenAI-compatible endpoint) receive source-derived text and, in the README's words, may charge for it. Their prices are unknown from this evidence. Local embeddings through sentence-transformers are an optional extra, and their disk and compute cost is not stated. The cost of the AI assistant or model you pair it with is outside this evidence.
Time costs the README does state: a cold build of about 3,000 files took about 40 seconds in the project's measurement, and an incremental two-file update took about 2.5 seconds. Enabling Jedi enrichment adds about a second per Python file. Other timings are unknown.
Licence and data handling
The LICENSE file is the standard MIT licence with the notice Copyright (c) 2026 Tirth Kanani. It permits use, copying, modification, merging, publishing, distribution, sublicensing and sale, provided the copyright and permission notice stay in all copies or substantial portions. The software is provided as is, without warranty. The README states MIT in its badge and in its Licence section.
Data handling according to the README: the graph is a local SQLite file; there is no telemetry (the FAQ summary says it does not phone home, but the FAQ itself was not captured); cloud embeddings are opt-in and trigger an egress warning unless the endpoint is localhost or CRG_ACCEPT_CLOUD_EMBEDDINGS=1 is set. The GitHub Action builds and queries the graph on your CI runner, and the README says no source code is sent to an external service. JSON exports are written inside the local data directory and can contain absolute paths and code-structure metadata, so inspect them before publishing. The optional context-history log holds token counts, tool names, timestamps and counts, not file names, paths or source text.
These are the project's claims. No code was audited or network behaviour observed for this review.
Freshness
The content was captured on 2026-11-15 from revision bbdda4b9e4b4818a9f04d7ef96ac0e50da13f208 on the staging branch. The README itself says staging is the default branch, can hold changes not yet released, and that releases are tagged from main. The version named in the README's examples is v2.4.0.
Some figures in the README are dated earlier than the capture: the benchmark tables on 2026-08-02 (crg 2.3.7), the agent baseline on 2026-09-22, and the build stats on 2026-08-02. The README says the repository has grown since the snapshot and that some numbers will change when benchmarks are re-run. Treat the numbers as historical. The README does not list a release date for 2.4.0, and the release history was not captured.
Suggested next steps
If you want to try it, start on a non-critical repository. Install the package, run code-review-graph install --dry-run first to see every file change, then install for real, run build and doctor, and ask your assistant to review a small change. Compare how many files and tokens your assistant uses with and without the graph on a few of your own questions, since the README's headline ratios may not match your case.
Use install --no-instructions if you do not want rules files edited, and consider --gitignore if your team does not want the generated files committed. Check what the hooks do before relying on them, especially the pre-commit output. Keep graph and tool versions aligned after upgrades, and re-run install so hooks and the MCP entry point to the new copy.
If you consider cloud embeddings, check the provider's pricing and data terms first, since source-derived text is sent. Before adopting it for a team or CI gate, read the linked docs (USAGE, FAQ, TROUBLESHOOTING and the GitHub Action page), which were not part of this review, and decide whether the fail-on-risk merge gate suits your process.
