code-review-graph  by tirth8205

Codebase knowledge graph for AI assistants

Created 1 month ago
4,457 stars

Top 10.9% on SourcePulse

GitHubView on GitHub
Project Summary

This project addresses the high token consumption of AI code assistants by constructing a persistent, incremental knowledge graph of a codebase. It enables AI models like Claude to access precise context, significantly reducing token usage for code reviews (up to 6.8x) and daily coding tasks (up to 49x), benefiting engineers and researchers seeking efficient AI-powered development.

How It Works

Code is parsed into an Abstract Syntax Tree (AST) using Tree-sitter, forming a graph of nodes (functions, classes, imports) and edges (calls, inheritance, tests). Upon file changes, a "blast-radius" analysis traces all affected callers, dependents, and tests, allowing AI models to focus only on relevant files. Incremental updates are achieved by diffing changed files and re-parsing only necessary components, with updates completing in under 2 seconds for large projects.

Quick Start & Requirements

Installation via Claude plugin marketplace (claude plugin marketplace add tirth8205/code-review-graph then claude plugin install code-review-graph@code-review-graph) or pip (pip install code-review-graph). Run code-review-graph install and restart Claude Code. Requires Python 3.10+ and uv. Initial builds take ~10 seconds for a 500-file project; updates are automatic in < 2 seconds.

Highlighted Details

  • Achieves significant token reduction for AI code reviews (6.8x average) and coding tasks (49x peak).
  • Supports 12 languages (Python, TypeScript, JavaScript, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, C/C++) with full Tree-sitter grammar support.
  • Features rapid incremental updates (< 2 seconds) via file diffing and SHA-256 hash checks.
  • Provides "blast-radius" analysis to pinpoint all code affected by a change.
  • Includes automatic update hooks for file edits/Git commits, optional semantic search, and interactive D3.js visualization.
  • Stores data locally in SQLite, requiring no external database or cloud dependency.

Maintenance & Community

The README does not detail specific contributors, sponsorships, or community channels. Contributions are encouraged via the GitHub repository.

Licensing & Compatibility

Licensed under the MIT license, permitting commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

The README does not explicitly mention limitations, known bugs, or alpha status. Effectiveness relies on the availability and accuracy of Tree-sitter grammars for supported languages.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
58
Issues (30d)
37
Star History
4,638 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.