code-review-graph (CRG) is a local-first tool that parses your codebase into a structural graph and exposes it to AI coding assistants through MCP, plus a CLI for direct use. It's built for developers using AI tools like Claude Code, Cursor, Codex, or GitHub Copilot who are tired of watching those tools re-read entire repositories just to review a small change.
Instead of letting an AI assistant scan every file, CRG uses Tree-sitter to build a graph of functions, classes, imports, and their relationships (calls, inheritance, test coverage). When a file changes, it computes the "blast radius": every caller, dependent, and test that could be affected. The assistant then reads only that minimal set of files instead of the whole project.
install auto-detects supported AI coding platforms (Codex, Claude Code, Cursor, Windsurf, Zed, Gemini CLI, Kiro, GitHub Copilot, and others) and writes the correct MCP config for each.languages.toml file mapping extensions and node types to any grammar bundled in tree_sitter_language_pack, no fork needed.uninstall command removes only CRG-owned config and hooks, leaving other MCP servers and settings untouched.CRG fits teams running AI coding assistants against medium-to-large codebases or monorepos, where an assistant re-reading the whole repo on every review burns tokens and time. It's especially useful for PR review workflows: hook it into CI via the GitHub Action to get risk-scored comments on pull requests without shipping code to a third-party service.
It also helps in day-to-day editor use with tools like Claude Code or Cursor: once installed and built, the assistant can ask the graph for blast-radius context instead of grepping the repo itself.
It's not a good fit for small scripts or single-file projects, where the overhead of building and maintaining a graph isn't worth it. It also assumes you're using an AI coding tool that supports MCP or the GitHub Action; if you don't use AI assistants for review, there's little reason to install it. Note the benchmark numbers: the ~82x median token reduction is measured against a whole-corpus baseline, not against what a competent agent already does with grep, so real-world savings will vary by workflow.
Requires Python 3.10+. Installing uv is recommended; the MCP config prefers uvx when available and falls back to the code-review-graph command otherwise.
pip install code-review-graph # or: pipx install code-review-graph
code-review-graph install # auto-detects and configures all supported platforms
code-review-graph build # parse your codebase
To target one platform specifically:
code-review-graph install --platform cursor
code-review-graph install --platform claude-code
code-review-graph install --platform copilot
Restart your editor or AI tool after installing. Then, inside your project, ask your assistant to "Build the code review graph for this project." A 500-file project builds in about 10 seconds; watch mode and supported hooks keep it updated after that.
To remove it cleanly:
code-review-graph uninstall --dry-run # preview actions, write nothing
code-review-graph uninstall --yes # apply without prompting
For CI, add the GitHub Action to a workflow:
on:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: tirth8205/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}