← 所有精選

GitHub Trending 精選

每日一個爆紅開源專案

日榜 #12026-07-21

tirth8205/code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

★ 23.1k stars · ▲ +1,833 今日 · 🔶 Python · 📜 MIT · 官網在 GitHub 開啟 ↗
ai-codingclaudeclaude-codecode-reviewgraphragincrementalknowledge-graphllmmcppythonstatic-analysistree-sitter

這是什麼

code-review-graph 是給 AI coding 工具使用的本地優先程式碼知識圖。它解決的核心問題是:AI 在 review 或理解大型專案時,常會反覆讀取大量無關檔案,浪費 token,也不一定抓到真正受影響的相依關係。專案用 Tree-sitter 解析 repo,將函式、類別、import、呼叫、繼承與測試覆蓋等資訊存成圖,再透過 MCP 讓 Claude Code、Cursor、Codex、GitHub Copilot 等工具查詢。當檔案變更時,它可做 blast-radius 分析,找出呼叫者、相依檔案與相關測試,讓 AI 只讀最有關的上下文。換句話說,它把「讓模型自己猜該看哪些檔」改成先由結構圖縮小範圍,再把更乾淨的線索交給模型。

為什麼上榜

它今天以 1,833 顆星的日增量登上日榜,亮點不是再做一個 coding agent,而是替現有 agent 補上可持續更新的程式碼地圖。README 給出的數字也很吸睛:在 6 個真實開源 repo 的評測中,典型問題的中位數 token reduction 約 82x,範圍 38x 到 528x;同時也坦白說 528x 是 fastapi 的最佳案例,不是平均值。這種把效益、方法與限制一起講清楚的 README,比單純宣稱「讓 AI 更懂你的 repo」更有可信度,也更容易被實際開發者拿來評估是否值得導入。

適合誰,可以拿來做什麼

它適合已經把 AI coding 工具放進日常開發流程的團隊,尤其是大型 repo、monorepo、頻繁 PR review 的場景。若你常遇到 AI 掃太多檔、review comment 缺少影響範圍、或希望在 CI 裡自動標出高風險函式與測試缺口,這個工具的定位很明確。上手門檻主要是 Python 與工具整合:README 標示需要 Python 3.10+,並建議安裝 uv;它也強調 local-first,GitHub Action 的建圖與查詢都在 CI runner 上執行,不把原始碼送到外部服務。

上手

README 提供明確 quick start:

pip install code-review-graph                     # or: pipx install code-review-graph
code-review-graph install          # auto-detects and configures all supported platforms
code-review-graph build            # parse your codebase

install 會偵測支援的平台、寫入 MCP 設定,並在支援處安裝 hooks/skills;完成後需要重新啟動 editor 或工具。若只想設定特定平台,也可使用:

code-review-graph install --platform codex
code-review-graph install --platform cursor
code-review-graph install --platform claude-code

README 重點摘要