Code-review-graph: persistent code graph that cuts Claude Code token usage
2 by tirthkanani | 0 comments on Hacker News.
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://ift.tt/C2LDbet PyPI: https://ift.tt/rjcLpm7 Happy to answer questions about the incremental engine, the Tree-sitter integration, or the benchmark methodology.
Don't forget to subscribe our youtube channel Click here:- http://www.youtube.com/c/techgk Product of the day
Post Top Ad
Responsive Ads Here
Home
Latest technews
New ask Hacker News story: Code-review-graph: persistent code graph that cuts Claude Code token usage
New ask Hacker News story: Code-review-graph: persistent code graph that cuts Claude Code token usage
Share This
Subscribe to:
Post Comments (Atom)
Post Bottom Ad
Responsive Ads Here
Author Details
Templatesyard is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates which are professionally designed and perfectlly seo optimized to deliver best result for your blog.
No comments:
Post a Comment