
diffctx
io.github.nikolay-e由 GitHub 帳號 nikolay-e 發布v1.20.0更新於 Oct 24, 2026
Selects the minimum code an LLM needs to review a git diff
概覽
本機 MCP 伺服器,分析 git 差異或符號,在 token 預算內挑出審閱所需的最少程式碼。
- 可以做什麼
- 分析 git 變更(提交範圍、暫存區或時間區間),找出差異之外的呼叫端、觸及它們的測試以及跨越的契約
- 不需變更即可分析指定符號
- 在 token 預算內打包審閱分支或提交所需的程式碼
- 以排序 JSON 回傳近期工作的位置,不含原始碼內容
- 將整棵程式碼樹匯出為 Markdown
- 適用情境
- 適合助理審閱拉取請求或提交時,需要差異之外的脈絡(呼叫端、受影響的測試、跨模組契約),或需要把脈絡控制在 token 預算內的情況。
- 執行需求
- 以本機程序透過 stdio 執行,用 uvx 從 diffctx 套件(含 mcp 附加元件)啟動,需要 Python。MCP 伺服器依賴 Python 套件,僅原生二進位檔不提供。未宣告驗證、環境變數或標頭。需要本機 git 儲存庫作為分析對象。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 diffctx,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
diffctx — what a git change reaches, and the code to review it
[CI] [PyPI] [crates.io] [npm] [MCP Registry]
diffctx tells an agent or a reviewer what a change reaches outside its diff — the callers, the tests that reach them, the contracts it crosses — and selects the code needed to understand it under a token budget. Local, deterministic, no index, no model calls. Caller resolution is static and per language; where it cannot resolve, the answer says so instead of printing a zero.
Formerly published as
treemapper— every command, flag, and API call works unchanged.
Install
diffctx is a command-line tool; the MCP server, the Claude Code plugin and the GitHub Action run the same engine.
CLI
The native binary — cargo, npm, Docker, Scoop and the
release archives for
Linux, macOS and Windows on x64 and ARM — answers --diff and --symbol in
every mode; whole-tree export, Markdown packs, diffctx graph and the MCP
server need the Python package.
Any MCP client
Registered as io.github.nikolay-e/diffctx.
Cursor, VS Code, Claude Desktop, Windsurf, Zed, Continue and the Python API: integrations.
Claude Code plugin
The MCP server plus /diffctx:impact and hooks that run it on each commit and
push.
CI
The GitHub Action hands a pull request's diff context to any review step.
Usage
--diff takes a git range, staged, or a duration window ending now (24h,
90min, 2w). Every flag, default and exit code:
command-line reference.
How it compares
Whole-repo packers export everything; code-graph servers answer queries against a maintained index. diffctx is diff-seeded: the input is a change, the output is what it touches and what explains it. Measured results, and when the other two fit better: COMPARISON.md.
More
- Documentation site — the pipeline end to end
- Command-line reference — rendered from
diffctx --help - Integrations — install, MCP clients, Python API
- FAQ — heuristic or oracle, ignore rules, monorepos, secrets
- Token counting —
--budgetfor non-GPT models - Benchmarks and the paper
- Changelog · Security
- Parameter strategy
Apache 2.0
來源:README.md,提交 745f593
工具
0版本歷史
11- v1.20.0最新Oct 22, 2026
- v1.19.1Oct 14, 2026
- v1.19.0Oct 14, 2026
- v1.18.4Oct 7, 2026
- v1.18.3Oct 4, 2026
- v1.18.2Oct 2, 2026
- v1.18.1Sep 30, 2026
- v1.18.0Sep 30, 2026
- v1.17.0Sep 23, 2026
- v1.16.0Sep 16, 2026
- v1.15.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分