HubLensAItirth8205/code-review-graph
// archived 2026-04-24
tirth8205

code-review-graph

AI#AI#Code Review#MCP#Python#Tree-sitter
View on GitHub
35

// summary

code-review-graph builds a structural map of your codebase using Tree-sitter to provide AI assistants with precise, context-aware information. By tracking changes incrementally and calculating the blast radius of modifications, it significantly reduces token consumption during code reviews. The tool integrates seamlessly with various AI coding platforms via the Model Context Protocol to ensure only relevant code is analyzed.

// technical analysis

code-review-graph is a structural analysis tool designed to optimize AI coding assistants by reducing token consumption through intelligent context pruning. By utilizing Tree-sitter to build a persistent graph of code entities and their relationships, it enables AI models to focus only on the 'blast radius' of specific changes rather than scanning entire repositories. This approach addresses the inefficiency of current AI coding tools that often re-read large codebases, providing a significant performance boost and cost reduction in complex development environments.

// key highlights

01
Reduces token usage by an average of 8.2x by providing AI assistants with precise, structurally relevant code context.
02
Performs incremental updates in under 2 seconds by re-parsing only changed files and their immediate dependents.
03
Supports 23 programming languages and Jupyter notebooks, mapping functions, classes, imports, and test coverage.
04
Integrates with AI tools via the Model Context Protocol (MCP), offering 28 specialized tools for tasks like impact analysis and architecture mapping.
05
Features a multi-repo daemon that monitors repositories in the background, ensuring the graph remains up-to-date without manual intervention.
06
Provides advanced architectural insights, including hub/bridge detection, community clustering, and risk-scored change impact analysis.

// use cases

01
Blast-radius analysis to identify affected functions and tests
02
Incremental indexing for rapid updates on file edits and git commits
03
Token-efficient AI code reviews using structural context and MCP

// getting started

To begin, install the package using 'pip install code-review-graph', then run 'code-review-graph install' to auto-configure your AI coding tools. Execute 'code-review-graph build' to parse your codebase into a structural graph. Once configured, you can interact with the graph through your AI assistant using commands like 'Build the code review graph for this project'.