DEV.co
AI Frameworks · tirth8205

code-review-graph

code-review-graph builds a persistent code intelligence graph using Tree-sitter to map your codebase structure and dependencies. It integrates with AI coding tools via MCP to provide targeted context during code review, reducing token usage by analyzing blast radius rather than sending entire repositories.

Source: GitHub — github.com/tirth8205/code-review-graph
19.3k
GitHub stars
2.1k
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorytirth8205/code-review-graph
Ownertirth8205
Primary languagePython
LicenseMIT — OSI-approved
Stars19.3k
Forks2.1k
Open issues180
Latest releasev2.3.6 (2026-06-10)
Last updated2026-06-14
Sourcehttps://github.com/tirth8205/code-review-graph

What code-review-graph is

Python-based static analysis tool that parses source code into an AST with Tree-sitter, stores the graph in SQLite, computes blast-radius analysis on file changes, and exposes results via MCP protocol. Supports incremental updates via file watches and commit hooks; integrates with Claude Code, Cursor, Continue, and other AI platforms.

Quickstart

Get the code-review-graph source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/tirth8205/code-review-graph.gitcd code-review-graph# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Large monorepo code review acceleration

Reduces context bloat in large codebases by computing which files are actually affected by a change, allowing AI reviewers to read ~15 files instead of 27,700+. Claimed 93x token reduction on the project's own repo.

CI/CD pipeline code quality gates

GitHub Action integration posts risk-scored PR reviews with affected functions and test gaps, running entirely on CI runners with no external API calls. Updates in place on each push.

Incremental graph updates in watch mode

Keeps the codebase graph fresh as developers edit, with incremental re-parsing triggered by file saves or hooks. Claims sub-2-second re-index for 2,900-file projects by diffing only changed files.

Implementation considerations

  • Initial build takes ~10 seconds for a 500-file project; plan for full re-index time on first setup and evaluate whether watch mode or hook triggers are feasible in your CI/CD.
  • Requires explicit invocation of 'code-review-graph build' and 'install' commands; integration is not automatic and depends on developer adoption and workflow habits.
  • SQLite graph is stored locally; no built-in backup, sync, or multi-machine sharing mechanism described. Teams with multiple developers should clarify how graph state is managed across branches and machines.
  • Tree-sitter parser coverage is broad but not exhaustive; inspect language coverage diagram for your tech stack before committing. Custom languages require manual TOML configuration.
  • GitHub Action runs locally on CI runners with no external API calls, but requires action configuration (fail-on-risk inputs, etc.) to be tuned per project; one-size-fits-all setup not supported.

When to avoid it — and what to weigh

  • Requires frequent parser customization — Supports 30+ languages via Tree-sitter, but adding a new language requires writing a languages.toml mapping in .code-review-graph/. May not suit teams maintaining many esoteric or proprietary languages.
  • Offline-first not a hard requirement — Tool emphasizes local-first operation, but if your workflow already relies on cloud-based code analysis services, the overhead of maintaining a local SQLite graph may not justify the switch.
  • AI tool ecosystem is rapidly shifting — MCP support is listed for Claude Code, Cursor, Continue, and others, but platform support landscape is evolving. Integrations may lag or break if major platforms change their protocols.
  • Strict dependency on Python 3.10+ — Tool is Python-only and requires Python 3.10 or newer. Teams locked to older Python versions or non-Python-native deployments should evaluate alternatives.

License & commercial use

MIT License. Permissive open-source license allowing commercial use, modification, and distribution with no royalties or restrictions beyond preserving license and copyright notices.

MIT License is permissive and allows commercial use without restrictions. No license check-in or registration required. Teams may use, modify, and deploy code-review-graph in proprietary environments and products. Verify that any custom code extensions or integrations do not introduce incompatible dependencies.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Local-first processing: graph is built and queried entirely on-machine or CI runner; source code is never sent to external services. No network calls or telemetry mentioned. Threat model for SQLite graph storage, file-system access, and commit hook permissions should be evaluated per deployment. Python dependencies should be reviewed for supply-chain risk (tree-sitter bindings, language packs).

Alternatives to consider

GitHub Copilot with native file exclusion

Copilot natively supports .gitignore-style exclusions and codeowners-based context filtering. Does not require a separate knowledge graph tool, but may not compute precise blast-radius or handle monorepos as efficiently.

Continue.dev with custom context providers

Continue is an IDE plugin that allows custom context providers and integrations. Teams already using Continue may build in-house blast-radius logic rather than deploying code-review-graph.

Tree-sitter + custom AST analysis scripts

Teams wanting to avoid a dependency can implement their own Tree-sitter-based analysis for call graphs and dependency tracking. Requires more engineering effort but avoids tool adoption friction.

Software development agency

Build on code-review-graph with DEV.co software developers

Install code-review-graph (pip install), run 'code-review-graph install' to auto-configure your editor, then 'code-review-graph build' to index your codebase. Your AI assistant will use only the files that matter.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

code-review-graph FAQ

How does incremental update work, and does it require a hook?
Incremental updates are triggered by file saves (watch mode) or supported pre-commit/post-commit hooks. The tool diffs changed files, finds affected dependents via SHA-256 checks, and re-parses only changed files. Claims sub-2-second re-index for large projects. Watch mode and hooks are optional; full builds via 'code-review-graph build' always work without them.
Does the tool send source code to any external service?
No. Graph building and querying are entirely local-first. GitHub Action runs on CI runners with no external API calls. The tool does not send code, ASTs, or graph data to cloud services.
What happens if my language is not supported?
For languages not in the default Tree-sitter parsers, create a .code-review-graph/languages.toml file mapping file extensions, grammar names, and node types for functions, classes, imports, and calls. The generic Tree-sitter walker handles extraction from there. Docs/CUSTOM_LANGUAGES.md provides schema and examples.
How do I use the graph in my AI tool if I use Copilot or Gemini?
The 'install' command auto-detects Copilot (VS Code), Copilot CLI, Gemini CLI, and other platforms, writing the correct MCP config. Restart your tool after install. If your platform is not auto-detected, manual MCP configuration may be required; consult troubleshooting docs.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like code-review-graph into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your ai frameworks stack.

Reduce AI Code Review Token Costs Now

Install code-review-graph (pip install), run 'code-review-graph install' to auto-configure your editor, then 'code-review-graph build' to index your codebase. Your AI assistant will use only the files that matter.