frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Code-review-graph: persistent code graph that cuts Claude Code token usage

2•tirthkanani•2h ago
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.

Ask HN: What Are You Working On? (March 2026)

260•david927•21h ago•958 comments

Ask HN: Is GitHub getting less reliable, or is it just me?

2•_pdp_•28m ago•0 comments

Ask HN: Can I repurpose a Bluetooth voice remote as input device for a PC?

10•albert_e•1d ago•15 comments

Code-review-graph: persistent code graph that cuts Claude Code token usage

2•tirthkanani•2h ago•0 comments

Ask HN: Please restrict new accounts from posting

679•Oras•1d ago•477 comments

Ask HN: How to be alone?

635•sillysaurusx•1d ago•525 comments

Ask HN: Most beautiful personal blog UI you have ever seen?

116•ms7892•23h ago•46 comments

Ask HN: Which book are you reading these days?

4•chistev•1h ago•3 comments

Ask HN: Who Needs Help?

11•surprisetalk•6h ago•4 comments

A job ad for Agentic AI Advocate

4•greenpinia•6h ago•1 comments

Ask HN: Are showlang and thelang HN endpoints not being maintained?

3•freakynit•7h ago•0 comments

Tell HN: I'm 60 years old. Claude Code has re-ignited a passion

1057•shannoncc•2d ago•961 comments

All tmux sessions as a single terminal

2•lygten•16h ago•1 comments

OpenAI might end up on the right side of history

12•shoman3003•1d ago•10 comments

Ask HN: Are we going to see more job postings asking for only agentic coding?

5•ronbenton•20h ago•6 comments

Ask HN: How are you adapting your career in this AI era?

9•sarthaksaxena•8h ago•4 comments

Ask HN: How are you handling persistent memory across local Ollama sessions

5•null-phnix•1d ago•0 comments

Ask HN: How are you monitoring AI agents in production?

4•jairooh•1d ago•5 comments

Ask HN: Anyone else feel this community has changed recently?

53•kypro•2d ago•29 comments

Ask HN: What is your oldest living presence on the World Wide Web?

2•dhruv3006•11h ago•1 comments

Whisker – Self hosted e-commerce cart, pure PHP, zero dependencies

7•eLohith•2d ago•3 comments

I replaced my freelance SaaS stack with 5 single-file HTML tools

4•AnnSri•1d ago•2 comments

Ask HN: Why Is Phil Wang / Lucidrains Off GitHub?

3•vessenes•1d ago•4 comments

Ask HN: Can we talk about AI Astroturfing?

48•overgard•2d ago•39 comments

PhD interrupted by personal safety issues, now publication record is thin

4•qthrwaway•2d ago•2 comments

Tell HN: The proposed KIDS Act (HR 7757) effectively mandates biometric browsing

18•fokdelafons•3d ago•0 comments

Add llms.txt and fix robots.txt for AI agent discoverability

3•nishiohiroshi•1d ago•2 comments

Ask HN: Do You Enjoy Your Career in Tech Nowadays?

29•karakoram•4d ago•31 comments

Ask HN: Last time you wrote code?

5•blinkbat•1d ago•15 comments

How do teams prevent duplicate LLM API calls and token waste?

3•cachelogic•2d ago•1 comments