← Live

A Code Map So Claude Only Reads What Matters Bản đồ code để Claude chỉ đọc đúng chỗ

code-review-graph builds a knowledge graph of your codebase using Tree-sitter — Claude reads only relevant files instead of scanning everything. Average 6.8x token reduction, better review quality. code-review-graph xây dựng knowledge graph từ codebase — Claude không cần scan cả project, chỉ đọc đúng file liên quan. Token giảm trung bình 6.8x, chất lượng review tăng lên.

Every time you ask Claude to do something in your project, it has to read — sometimes a lot. On larger codebases, that means dozens of unrelated files getting pulled into context, tokens burning fast, and results that are sometimes worse because of all the noise.

code-review-graph fixes this by building a knowledge graph of your codebase — storing relationships between files, functions, classes, and imports — so Claude only reads what’s actually relevant to the task.

How it works

The tool uses Tree-sitter to parse the entire repo into ASTs, then stores everything in SQLite. From there, it can:

  • Blast-radius analysis: if file A changes, which files are affected? Which functions call into it? Which tests cover it?
  • Incremental updates: only re-parses modified files using SHA-256 hashing — updates in ~2 seconds
  • Selective context: instead of loading 27,000 files, Claude reads just 15 actually relevant ones

Supports 14 languages: Python, TypeScript, JavaScript, Vue, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++.

Real numbers

ScenarioToken reduction
Average code review6.8x
httpx (medium project)26.2x
Next.js (large project)6.0x
Live coding tasks14.1x avg
Large monorepoup to 49x

Review quality scores go from 7.0–7.5 up to 8.5–9.0 out of 10 — less noise in context means Claude focuses on the right things.

Setup

# Via Claude Code plugin
claude plugin marketplace add tirth8205/code-review-graph

# Or via pip
pip install code-review-graph
code-review-graph install

Then in Claude Code: "Build the code review graph for this project" — initial build takes ~10 seconds for a 500-file project, then auto-updates on edits and commits.

When it’s worth it

Really useful if you:

  • Work with 100+ file projects daily alongside Claude Code
  • Review lots of PRs and want Claude to understand the true blast-radius of a change
  • Are building AI coding tools and need to cut token costs

For small projects the overhead is minimal — the graph builds fast and costs nothing. For large projects, this is the kind of tool you install once and don’t want to work without.


Source: github.com/tirth8205/code-review-graph

Mỗi khi bạn hỏi Claude làm gì đó trong project, nó phải đọc — và đôi khi đọc rất nhiều. Với project lớn, điều này có nghĩa là hàng chục file không liên quan bị kéo vào context, token bay mù, và đôi khi kết quả còn tệ hơn vì quá nhiều nhiễu.

code-review-graph giải quyết vấn đề này bằng cách xây dựng một knowledge graph của codebase — lưu sẵn quan hệ giữa các file, function, class, import — và chỉ cho Claude đọc đúng những gì thực sự liên quan đến task.

Cách hoạt động

Công cụ dùng Tree-sitter để parse toàn bộ repo thành AST, sau đó lưu vào SQLite. Từ đó, nó có thể:

  • Blast-radius analysis: thay đổi ở file A ảnh hưởng đến file nào? Function nào gọi đến đây? Test nào cover nó?
  • Incremental update: chỉ re-parse file vừa thay đổi — dùng SHA-256 để detect, update trong ~2 giây
  • Selective context: thay vì đưa 27,000 file vào context, Claude chỉ đọc 15 file thực sự liên quan

Hỗ trợ 14 ngôn ngữ: Python, TypeScript, JavaScript, Vue, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++.

Số thực tế

ScenarioToken reduction
Code review trung bình6.8x
httpx (medium project)26.2x
Next.js (large project)6.0x
Live coding tasks14.1x avg
Monorepo lớnup to 49x

Chất lượng review tăng từ 7.0–7.5 lên 8.5–9.0 trên thang 10 — vì context ít nhiễu hơn, Claude tập trung đúng hơn.

Cài đặt

# Qua Claude Code plugin
claude plugin marketplace add tirth8205/code-review-graph

# Hoặc qua pip
pip install code-review-graph
code-review-graph install

Sau đó trong Claude Code: "Build the code review graph for this project" — build lần đầu ~10 giây cho project 500 file, sau đó tự update theo commit/edit.

Khi nào nên dùng

Thực sự hữu ích nếu bạn:

  • Làm việc với project 100+ file hàng ngày cùng Claude Code
  • Review nhiều PR và muốn Claude hiểu đúng blast-radius của thay đổi
  • Đang xây tool AI coding và cần giảm chi phí token

Với project nhỏ thì overhead không đáng kể — graph build nhanh, cũng không tốn gì. Còn project lớn thì đây là loại tool mà bạn cài một lần rồi không muốn làm việc thiếu nó.


Source: github.com/tirth8205/code-review-graph

  • #aicoding
  • #claudecode
  • #tooling