Memilih kode minimal yang dibutuhkan LLM untuk meninjau git diff dengan mengidentifikasi caller, test, dan contract yang terdampak oleh sebuah perubahan.
Juga dikenal sebagai nikolay-e/diffctx
- Stars
- 6
- Tools
- —
- Unduhan, 30 hari
- 3.869
- Versi terbaru
- 1.20.0
- Commit terakhir
- 12 Nov 2026
- Lisensi
- Apache-2.0
Apa itu diffctx MCP?
diffctx adalah MCP server. Memilih kode minimal yang dibutuhkan LLM untuk meninjau git diff dengan mengidentifikasi caller, test, dan contract yang terdampak oleh sebuah perubahan.
Ringkasan dibuat dari README proyek
Tentang diffctx MCP server
diffctx membantu developer dan AI agent memahami dampak luas dari perubahan kode dengan mengidentifikasi konteks relevan di luar git diff. Alih-alih memberikan seluruh repositori, tool ini memilih caller, test, dan contract spesifik yang terdampak oleh sebuah modifikasi. Tool ini dirancang untuk tetap berada dalam budget token tertentu, sehingga sangat berguna untuk code review berbasis LLM di mana batasan context window menjadi kendala.
Server ini berjalan secara lokal dan beroperasi secara deterministik tanpa memerlukan index yang dikelola atau model calls eksternal. Anda dapat mengintegrasikannya ke berbagai MCP client seperti Claude Desktop, Cursor, atau Zed. Pengguna dapat menentukan git range, staged changes, atau bahkan durasi waktu seperti 24h untuk menentukan cakupan analisis. Tool ini mendukung berbagai mode seperti impact analysis atau locating changes, serta memungkinkan pengguna untuk mengatur custom token budget menggunakan flag --budget.
Apa yang bisa Anda lakukan dengannya
- 1Analisis dampak perubahan kodeIdentifikasi caller dan test yang terdampak oleh git diff tertentu untuk memahami cakupan dari sebuah perubahan.
- 2Optimasi konteks review LLMMemberikan kode minimal yang diperlukan kepada AI agent untuk meninjau sebuah branch sambil tetap berada di bawah limit token.
- 3Melacak pekerjaan terbaruMendapatkan daftar JSON terurut dari perubahan kode yang dilakukan dalam jendela waktu tertentu.
- 4Meninjau symbol spesifikMenemukan dampak dan konteks di sekitar fungsi atau nama tertentu tanpa perlu melakukan perubahan kode.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal diffctx MCP
Format diverifikasi 10 Nov 2026Instal diffctx MCP di Claude Code
$ claude mcp add diffctx -- uvx diffctxInstal diffctx MCP di Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Instal diffctx MCP di VS Code
.vscode/mcp.json
{
"servers": {
"diffctx": {
"type": "stdio",
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Instal diffctx MCP di Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Instal diffctx MCP di Codex
~/.codex/config.toml
[mcp_servers.diffctx] command = "uvx" args = ["diffctx"]
Instal diffctx MCP di Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Pengecekan otomatis
Berjalan 14 Nov 2026Laporan lengkap →Lolos checks otomatis kami. Ini bukan audit keamanan: baca kodenya dan berikan server akses paling terbatas yang dibutuhkannya. Cara kerja checks
- Source repository terhubung dan dapat dijangkaunikolay-e/diffctx is public and reachablegithub.com/nikolay-e/diffctx ↗Lolos
- Paket menyebut repo ini sebagai sumbernyadiffctx names nikolay-e/diffctx as sourcepypi.org/project/diffctx/ ↗Lolos
- Provenance build (atestasi Sigstore)Sigstore attestation for diffctxpypi.org/project/diffctx/ ↗Lolos
- Lisensi open source (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Lolos
- Ada commit atau release dalam satu tahun terakhirLast commit or release 2026-11-12github.com/nikolay-e/diffctx ↗Lolos
- OpenSSF ScorecardTidak diperiksa
- Nama package tidak mirip dengan package populerNo popular package one edit away from diffctxLolos
- Tidak ada advisory kritis di paket maupun dependensinya2 resolved dependencies checked; no critical advisoryosv.dev ↗Lolos
- Tidak ada instruksi tersembunyi untuk model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersLolos
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Endpoint remote menjawab handshake MCPTidak diperiksa
README
Lihat di GitHubdiffctx — 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
Pertanyaan tentang diffctx MCP
Bagaimana cara menambahkan diffctx MCP ke Claude Code?
Jalankan claude mcp add diffctx -- uvx diffctx di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan diffctx MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
Apa perbedaan diffctx dengan whole-repo packers atau code-graph servers?
Berbeda dengan whole-repo packers yang mengekspor segalanya atau code-graph servers yang menggunakan index yang dikelola, diffctx berbasis diff-seeded, yang berarti inputnya adalah perubahan spesifik dan outputnya adalah apa yang disentuh oleh perubahan tersebut.
Apakah diffctx memerlukan index atau model calls agar bisa bekerja?
Tidak, tool ini berjalan secara lokal dan deterministik tanpa memerlukan index atau melakukan model calls.
Bisakah saya membatasi jumlah kode yang dikirim ke LLM?
Ya, Anda dapat menggunakan flag --budget untuk membatasi output pada jumlah token tertentu.