[HN Gopher] Code-review-graph: persistent code graph that cuts C...
___________________________________________________________________
Code-review-graph: persistent code graph that cuts Claude Code
token usage
Author : tirthkanani
Score : 10 points
Date : 2026-03-09 19:22 UTC (3 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| tirthkanani wrote:
| Hi HN I'm Tirth. I built code-review-graph because I got tired of
| watching Claude Code re-read my entire codebase on every single
| task.
|
| When you ask Claude Code to review a commit or add a feature, it
| reads files to understand the codebase. On a small project that's
| fine. On FastAPI (2,915 files) or Next.js (27,732 files) it scans
| thousands of files that have nothing to do with your change.
| You're paying for tokens that add zero value, and more noise
| makes the review worse.
|
| code-review-graph builds a persistent structural map of your code
| using Tree-sitter. Every function, class, import, call, and
| inheritance relationship lives in a local SQLite database. When
| you edit a file or commit, it re-parses only the changed files
| and their dependants in under 2 seconds. Claude then queries the
| graph, finds what changed and what depends on it, and reads only
| the relevant files.
|
| Benchmarks on production repos with real commits:
|
| * httpx (125 files): 26.2x fewer tokens * FastAPI (2,915 files):
| 8.1x fewer tokens * Next.js (27,732 files): 6.0x fewer tokens on
| reviews, 49x on a live coding task * Review quality: 8.8 vs 7.2
| out of 10
|
| Some technical details:
|
| * SQLite WAL mode for concurrent reads, no external DB *
| Qualified names (src/auth.py::AuthService.login) for collision-
| free node identity without scope resolution * SHA-256 hash skip:
| files touched but not modified are skipped entirely * Optional
| vector search stored as binary blobs in the same SQLite file, no
| separate vector DB * NetworkX for BFS graph traversal with a
| cached directed graph that rebuilds on writes * 12 languages via
| Tree-sitter: Python, TypeScript, JavaScript, Go, Rust, Java, C#,
| Ruby, Kotlin, Swift, PHP, C/C++
|
| No cloud. No telemetry. No sign-ups. One SQLite file in .code-
| review-graph/ and that's it. PostEdit and PostGit hooks keep the
| graph current automatically. Your workflow doesn't change.
|
| Setup takes about 30 seconds: pip install code-
| review-graph code-review-graph install
|
| Or as a Claude Code plugin: claude plugin add tirth8205/code-
| review-graph
|
| MIT licence. Around 3,700 lines of typed Python with 770 lines of
| tests.
|
| GitHub: https://github.com/tirth8205/code-review-graph PyPI:
| https://pypi.org/project/code-review-graph/
|
| Happy to answer questions about the incremental engine, the Tree-
| sitter integration, or the benchmark methodology.
| chreniuc wrote:
| I tried installing it using the recommended option, via Claude,
| it didn't work. I opened an issue and I've added what I have
| tried and what errors I did encounter.
___________________________________________________________________
(page generated 2026-03-09 23:01 UTC)