tirth8205

code-review-graph: Map Code for AI Reviews

code-review-graph builds a local, persistent map of code structure and serves targeted review context to AI coding tools through MCP and a CLI. It suits teams working in large or interconnected repositories who want impact analysis without repeatedly scanning the whole codebase.

View on GitHub Compare
Stars
31.9k
Forks
2.9k
Stars, last 30 days
+669

Our take

Health score

71/100

How it is scored
Activity
82
Community
68
Issues
56
Pull requests
76

+669 stars in the last 30 days

  • Merges more pull requests than 81% of the projects we track
  • Releases more often than 80% of the projects we track
  • More contributors than 78% of the projects we track

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

32,629

Forks

2,967

Change since Nov 6, 2026: +17 stars·+2 forks

Overview

code-review-graph parses a repository into a graph of code entities and relationships, then uses that structure to identify relevant context for code reviews and other coding tasks. Its goal is to help AI coding tools focus on files and dependencies affected by a change rather than repeatedly reading broad sections of a codebase.

The graph is stored locally in SQLite and can be queried through MCP or the CLI. This is most useful when a change spans multiple files or dependency paths; for small repositories and simple, single-file edits, the extra graph context may not be worthwhile.

Key Features

  • Extracts functions, classes, imports, calls, inheritance, and test relationships using Tree-sitter and other targeted parsers.
  • Traces potential change impact through callers, dependents, and tests to help select review context.
  • Updates the graph incrementally, with hooks and watch mode available to keep it current.
  • Offers MCP tools for graph queries, review context, impact analysis, architecture overviews, and semantic search.
  • Provides a CLI for building and updating graphs, inspecting changes, finding dead code, and exporting visualizations.
  • Includes a GitHub Action that can post risk-scored pull request review comments.
  • Supports many languages and notebooks, with custom language mappings available through configuration.
  • Keeps graph data local by default; external embedding providers are optional.

Use Cases

  • AI-assisted review of changes in large repositories, where developers need a focused view of affected code and tests.
  • Assessing the possible impact of a refactor across callers and dependents before editing or merging.
  • Exploring an unfamiliar codebase, where developers want an architecture overview or paths through connected code.
  • Automating pull request risk summaries in CI for teams that want graph-based context on proposed changes.

Getting Started

Install the package and configure available AI coding tools:

pip install code-review-graph
code-review-graph install
code-review-graph build

See the README for platform setup, configuration, and command details.

Alternatives

  • codegraph: CodeGraph emphasizes retrieving source and call paths for multiple agents, while code-review-graph focuses on targeted review context via MCP and CLI.
  • codebase-memory-mcp: codebase-memory-mcp is an MCP server for architectural queries, while code-review-graph also offers a CLI for review context.
  • GitNexus: GitNexus focuses on tracing dependencies and execution flows through CLI and MCP, while code-review-graph targets code-review context.
  • graphify: Graphify also graphs documentation, schemas, and other project files, while code-review-graph focuses on code structure for review.
ProjectLanguageLicenseStarsStatus
code-review-graphPythonMIT31.9kNot checked yet
codegraphCMIT73.1kActive
codebase-memory-mcpCMIT45.7kActive
GitNexusTypeScriptOther47.7kActive
graphifyPythonApache-2.0124kActive

Considerations

  • Requires Python 3.10 or newer.
  • A graph must be built before it can provide repository context. Build time depends on repository size, and keeping the graph current requires updates, hooks, or watch mode.
  • The project notes that graph context can be more costly than reading a file for trivial, single-file changes. Search ranking and flow detection also have stated limitations, particularly for JavaScript and Go.
  • The reported impact recall uses graph-derived ground truth and is described by the project as a circular upper bound. Its co-change evaluation is not yet a usable measurement.
  • Local storage is the default, but cloud embedding providers are available as optional integrations and receive source-derived text when used.

Repository: tirth8205/code-review-graph · Project website

Found this useful?

Share it with someone who would like code-review-graph.

Comparisons