# code-review-graph

A local, incrementally updated code knowledge graph that serves AI coding tools only the files relevant to a change, over MCP or a CLI, instead of having them re-read large parts of the codebase.

code-review-graph parses a codebase into ASTs with Tree-sitter and stores the result as a graph of functions, classes and imports connected by call, inheritance and test-coverage edges. When a file changes, it traces every caller, dependent and test that could be affected and serves just that slice of context to the connected AI coding tool rather than the whole repository. An install command detects installed AI coding tools, including Claude Code, Cursor, Windsurf, Zed, Continue and OpenCode among others, and configures an MCP server entry, hooks and skills for each one automatically; an uninstall command removes only its own entries and leaves other tools' configuration alone.

Updates after the initial build are incremental: hooks, a pre-commit hook, and a watch mode re-parse only files whose content hash actually changed and follow the graph's edges to find their dependents, rather than rebuilding from scratch. As measured examples, the project reports a roughly 40-second cold build and a roughly 2.5-second incremental re-index after a two-file edit on an approximately 3,000-file repository.

It requires Python 3.10 or higher and is licensed under the MIT license.

Website: https://code-review-graph.com
