
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 分