
diffctx
io.github.nikolay-ePublished by GitHub account nikolay-ev1.20.0Updated Oct 24, 2026
Selects the minimum code an LLM needs to review a git diff
Overview
Local MCP server that analyzes a git diff or symbol and selects the minimum code an assistant needs to review it, within a token budget.
- What you can do
- Analyze a git change (range, staged, or a time window) to find callers outside the diff, the tests that reach them, and contracts it crosses
- Analyze a named symbol without needing a change
- Pack the code needed to review a branch or commit under a token budget
- Return ranked JSON locations for recent work without source bodies
- Export a whole tree as Markdown
- When to use it
- Useful when an assistant reviews pull requests or commits and needs the surrounding context — callers, affected tests, cross-cutting contracts — rather than the diff alone, or when context must fit a token budget.
- Requirements
- Runs as a local process over stdio, started with uvx from the diffctx package with the mcp extra (Python). The MCP server requires the Python package; the native binary alone does not provide it. No authentication, environment variables, or headers are declared. Needs a local git repository to analyze.
Installation
In SourceWeft
- Open diffctx in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Source: README.md at commit 745f593
Tools
0Version history
11- v1.20.0LatestOct 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
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts