Wählt den minimalen Code aus, den ein LLM für einen git diff Review benötigt, indem es betroffene Caller, Tests und Contracts identifiziert.
Auch bekannt als nikolay-e/diffctx
- Stars
- 6
- Tools
- —
- Downloads, 30 Tage
- 3.869
- Neueste Version
- 1.20.0
- Letzter Commit
- 14. Nov. 2026
- Lizenz
- Apache-2.0
Was ist diffctx MCP?
diffctx ist ein MCP server. Wählt den minimalen Code aus, den ein LLM für einen git diff Review benötigt, indem es betroffene Caller, Tests und Contracts identifiziert.
Zusammenfassung generiert aus dem README des Projekts
Über diffctx MCP server
diffctx hilft Entwicklern und AI Agents, die breiteren Auswirkungen von Codeänderungen zu verstehen, indem es relevanten Kontext außerhalb eines git diff identifiziert. Anstatt ein gesamtes Repository bereitzustellen, wählt es gezielt die Caller, Tests und Contracts aus, die von einer Modifikation betroffen sind. Dieses Tool ist darauf ausgelegt, innerhalb eines bestimmten Token-Budgets zu bleiben, was es besonders nützlich für LLM-basierte Code Reviews macht, bei denen die Limits des Context Windows eine Rolle spielen.
Der Server läuft lokal und arbeitet deterministisch, ohne einen gepflegten Index oder externe Model-Calls zu benötigen. Er kann in verschiedene MCP Clients wie Claude Desktop, Cursor oder Zed integriert werden. Nutzer können einen git range, staged changes oder sogar einen Zeitraum wie 24h angeben, um den Umfang der Analyse zu definieren. Es unterstützt verschiedene Modi wie Impact Analysis oder das Lokalisieren von Änderungen und erlaubt es, ein benutzerdefiniertes Token-Budget über das --budget Flag festzulegen.
Was du damit machen kannst
- 1Auswirkungen von Codeänderungen analysierenIdentifiziere die Caller und Tests, die durch einen spezifischen git diff betroffen sind, um das Ausmaß einer Änderung zu verstehen.
- 2LLM Review-Kontext optimierenVersorge einen AI Agent mit dem minimal notwendigen Code für einen Branch-Review, während du unter einem Token-Limit bleibst.
- 3Aktuelle Arbeiten findenRufe eine sortierte JSON-Liste von Codeänderungen ab, die innerhalb eines bestimmten Zeitfensters vorgenommen wurden.
- 4Spezifische Symbole reviewenFinde die Auswirkungen und den umliegenden Kontext für eine bestimmte Funktion oder einen Namen, auch ohne dass eine Codeänderung vorliegt.
Geschrieben aus dem README des Projekts. Jeder Use Case wurde gegen ein Zitat daraus geprüft.
So installierst du diffctx MCP
Formate geprüft am 10. Nov. 2026Zu Cursor hinzufügenZu Goose hinzufügendiffctx MCP in Claude Code installieren
$ claude mcp add diffctx -- uvx diffctxdiffctx MCP in Cursor installieren
~/.cursor/mcp.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}diffctx MCP in VS Code installieren
.vscode/mcp.json
{
"servers": {
"diffctx": {
"type": "stdio",
"command": "uvx",
"args": [
"diffctx"
]
}
}
}diffctx MCP in VS Code CLI installieren
$ code --add-mcp '{"name":"diffctx","type":"stdio","command":"uvx","args":["diffctx"]}'diffctx MCP in Claude Desktop installieren
claude_desktop_config.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}diffctx MCP in Codex installieren
$ codex mcp add diffctx -- uvx diffctxdiffctx MCP in Codex config.toml installieren
~/.codex/config.toml
[mcp_servers.diffctx] command = "uvx" args = ["diffctx"]
diffctx MCP in Gemini CLI installieren
$ gemini mcp add -s user diffctx uvx -- diffctxdiffctx MCP in Gemini settings.json installieren
~/.gemini/settings.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Automatisierte Checks
Geluften am 14. Nov. 2026Vollständiger Bericht →Unsere automatisierten Checks bestanden. Das ist kein Security-Audit: Lies den Code und gib dem Server nur den minimal notwendigen Zugriff. Wie die Checks funktionieren
- Source Repository verknüpft und erreichbarnikolay-e/diffctx is public and reachablegithub.com/nikolay-e/diffctx ↗Bestanden
- Paket nennt dieses Repository als Quellediffctx names nikolay-e/diffctx as sourcepypi.org/project/diffctx/ ↗Bestanden
- Build-Provenienz (Sigstore-Attestierung)Sigstore attestation for diffctxpypi.org/project/diffctx/ ↗Bestanden
- Open Source Lizenz (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Bestanden
- Commit oder Release im letzten JahrLast commit or release 2026-11-12github.com/nikolay-e/diffctx ↗Bestanden
- OpenSSF ScorecardNicht geprüft
- Package-Name ähnelt keinem populären PackageNo popular package one edit away from diffctxBestanden
- Keine kritischen Advisories im Paket oder seinen Abhängigkeiten2 resolved dependencies checked; no critical advisoryosv.dev ↗Bestanden
- Keine versteckten Anweisungen an das Modell0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersBestanden
- Destruktive Tools sind markiertNicht geprüft
- Remote-Endpoint beantwortet den MCP-HandshakeNicht geprüft
README
Auf GitHub ansehendiffctx — what a git change reaches, and the code to review it
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
uvx diffctx . --diff HEAD~1 # zero-install, run once via uv
pipx install diffctx # isolated CLI
pip install diffctx # into an active environment
cargo install diffctx # native binary from crates.io, no Python
npx diffctx . --diff HEAD~1 # npm wrapper over the native binary
docker run --rm -v "$PWD:/repo" ghcr.io/nikolay-e/diffctx . --diff HEAD~1
scoop bucket add diffctx https://github.com/nikolay-e/diffctx # Windows
scoop install diffctx/diffctx
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.
claude mcp add diffctx -- uvx --from 'diffctx[mcp]' diffctx-mcp
codex mcp add diffctx -- uvx --from 'diffctx[mcp]' diffctx-mcp
gemini mcp add diffctx uvx -- --from 'diffctx[mcp]' diffctx-mcp
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.
claude plugin marketplace add nikolay-e/diffctx
claude plugin install diffctx@diffctx
CI
The GitHub Action hands a pull request's diff context to any review step.
Usage
diffctx . --diff --mode impact # uncommitted work: callers outside the diff, their tests, contracts
diffctx . --symbol parse_config # the same for a name, no change needed
diffctx . --diff main...feature # the code to review a branch, packed under the auto budget
diffctx . --diff HEAD~1 --budget 12000 # the last commit, capped at 12k o200k tokens
diffctx . --diff 24h --mode locate # today's work as ranked JSON, no source bodies
diffctx . # whole-tree export, Markdown
--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
diffctx MCP Fragen
Wie füge ich diffctx MCP zu Claude Code hinzu?
Führe claude mcp add diffctx -- uvx diffctx in deinem Terminal aus. Füge --scope user hinzu, damit der Server in jedem Projekt verfügbar ist.
Wie füge ich diffctx MCP zu Cursor hinzu?
Öffne ~/.cursor/mcp.json und füge den Server unter mcpServers hinzu, mit der Cursor-Config aus dem Installationsabschnitt oben.
Wie unterscheidet sich diffctx von Whole-Repo Packers oder Code-Graph Servern?
Im Gegensatz zu Whole-Repo Packers, die alles exportieren, oder Code-Graph Servern, die einen gepflegten Index nutzen, ist diffctx diff-basiert. Das bedeutet, der Input ist eine spezifische Änderung und der Output ist das, was diese Änderung beeinflusst.
Benötigt diffctx einen Index oder Model-Calls, um zu funktionieren?
Nein, es läuft lokal und deterministisch ab, ohne einen Index zu benötigen oder Model-Calls zu tätigen.
Kann ich die Menge des an das LLM gesendeten Codes begrenzen?
Ja, du kannst das --budget Flag nutzen, um den Output auf eine bestimmte Token-Anzahl zu begrenzen.