Burning tokens on AI code review? 🔥 This tool turns your codebase into a structural graph so the AI reads only relevant files — cutting tokens by a median of 82x.
Title: tirth8205/code-review-graph
URL:
🔥 Overview
A local-first code intelligence tool that persists a structural map (graph) of your codebase via Tree-sitter parsing. It lets AI assistants review by reading only contextually relevant files instead of the whole repository.
❓ Challenges Solved
AI code review tools waste tokens by re-reading large parts of the codebase on every review.
・In large monorepos, context bloats and both cost and latency worsen
・Analyzing change impact required scanning the entire project
💡 Methodology & How It Works
A three-stage pipeline.
・Parsing: Tree-sitter builds ASTs, extracting functions, classes, imports, and call relationships
・Graph storage: nodes and edges persist in SQLite (no external database)
・Analysis: on changes, blast-radius analysis traces affected callers, dependents, and tests, returning minimal context
It supports many languages, incremental updates under 2 seconds, MCP integration (30 tools), a GitHub Action, and D3.js visualization.
📊 Experimental Results
・Token efficiency: 38x-528x reduction (median ~82x across 6 repos)
・Impact prediction F1 score: 0.71 average
・CLI example: full context 12,921 tokens → graph context 762 tokens (~94% saved)
#
CodeReview# #
AIAgents#