explaingit

tirth8205/code-review-graph

16,360PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A Python tool that maps your codebase as a knowledge graph so AI coding assistants like Claude Code or Cursor only read the files they actually need, cutting token costs and making code reviews faster and more focused.

Mindmap

mindmap
  root((code-review-graph))
    What It Does
      Maps codebase structure
      Finds blast radius
      Feeds AI only relevant files
    How It Works
      Tree-sitter parsing
      SQLite graph storage
      Git hook re-indexing
    AI Tool Support
      Claude Code
      Cursor and Windsurf
      GitHub Copilot
      Gemini CLI
    Audience
      Developers
      Monorepo teams
      AI power users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Cut AI code review token costs by automatically giving Claude Code or Cursor only the relevant files for each task

USE CASE 2

Find all callers, dependents, and tests affected by changing a function in a large monorepo in under 2 seconds

USE CASE 3

Connect the code graph to any MCP-compatible AI tool with a single pip install and auto-configure

USE CASE 4

Track code impact across 24 supported languages including Python, TypeScript, and Jupyter notebooks

Tech stack

PythonSQLiteTree-sitterMCP

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Python 3.10+ and a compatible AI coding tool, auto-configures Claude Code, Cursor, and others on install.

In plain English

code-review-graph is a Python tool that solves a specific problem with AI coding assistants: by default they re-read large chunks of your codebase every time you ask them to review or change something, which burns through a lot of tokens (the unit those models bill in). This project builds a structural map, a "knowledge graph", of your code once, keeps it up to date in the background, and then hands the AI just the slice of files that actually matter for the current task. Under the hood it uses Tree-sitter, a parsing library that understands code in many languages, to break your repository into nodes (functions, classes, imports) and edges (which function calls which, what inherits from what, which tests cover which code). The graph is stored in SQLite, and a "blast radius" query figures out, for any changed file, all the callers, dependents and tests that could be affected, so only that minimal set has to be read. A git hook re-parses just the changed files on every commit or save, which the README says keeps a 2,900-file project re-indexing in under two seconds. The graph is exposed to the AI assistant through the Model Context Protocol (MCP), and the install command auto-configures the integration for a long list of AI coding tools including Claude Code, Cursor, Codex, Windsurf, Zed, Continue, GitHub Copilot, Gemini CLI and others. It supports 24 languages plus Jupyter notebooks. You would use it when you work in a sizeable repository, especially a monorepo, and want your AI assistant's code reviews and edits to be cheaper, faster and more focused. Installation is via pip or pipx and requires Python 3.10+. The full README is longer than what was provided.

Copy-paste prompts

Prompt 1
How do I install code-review-graph and connect it to Claude Code so it automatically limits context to relevant files?
Prompt 2
Using code-review-graph, find all functions and tests affected by changing a specific module in my Python project
Prompt 3
Walk me through setting up code-review-graph with Cursor for a TypeScript monorepo, include the MCP configuration
Prompt 4
How does code-review-graph determine the blast radius of a code change and which files to include?
Prompt 5
Write a script that uses code-review-graph to list all callers of a given function across my entire codebase
Open on GitHub → Explain another repo

← tirth8205 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.