git diffの影響を受ける呼び出し元、テスト、およびコントラクトを特定することで、LLMがコードレビューに必要な最小限のコードを選択します。
別名 nikolay-e/diffctx
- スター
- 6
- ツール
- —
- ダウンロード数(30日間)
- 3,869
- 最新バージョン
- 1.20.0
- 最終コミット
- 2026年11月14日
- ライセンス
- Apache-2.0
diffctx MCPとは
diffctxはMCPサーバーです。 git diffの影響を受ける呼び出し元、テスト、およびコントラクトを特定することで、LLMがコードレビューに必要な最小限のコードを選択します。.
プロジェクトのREADMEから生成された概要
diffctx MCP server について
diffctxは、git diffの範囲外にある関連コンテキストを特定することで、開発者やAIエージェントがコード変更の広範な影響を理解するのを支援します。リポジトリ全体を提供するのではなく、変更によって影響を受ける特定の呼び出し元、テスト、およびコントラクトを選択します。このツールは特定のトークン予算内に収まるように設計されており、コンテキストウィンドウの制限が課題となるLLMベースのコードレビューに非常に有用です。
このサーバーはローカルで実行され、維持されたインデックスや外部モデルの呼び出しを必要とせずに決定論的に動作します。Claude Desktop、Cursor、ZedなどのさまざまなMCPクライアントに統合可能です。ユーザーは、gitの範囲、ステージングされた変更、または24hなどの時間指定によって、分析のスコープを定義できます。影響分析や変更箇所の特定などの異なるモードをサポートしており、--budgetフラグを使用してカスタムのトークン予算を設定することも可能です。
できること
- 1コード変更の影響を分析特定のgit diffによって影響を受ける呼び出し元やテストを特定し、変更の範囲を把握します。
- 2LLMレビュー用コンテキストの最適化トークン制限内で、AIエージェントがブランチをレビューするために必要な最小限のコードを提供します。
- 3最近の作業箇所を特定特定の時間枠内で行われたコード変更を、ランク付けされたJSONリストとして取得します。
- 4特定のシンボルをレビューコード変更を伴わずに、特定の関数や名前の影響範囲および周囲のコンテキストを見つけ出します。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
diffctx MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude Codeにdiffctx MCPをインストール
$ claude mcp add diffctx -- uvx diffctxCursorにdiffctx MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}VS Codeにdiffctx MCPをインストール
.vscode/mcp.json
{
"servers": {
"diffctx": {
"type": "stdio",
"command": "uvx",
"args": [
"diffctx"
]
}
}
}VS Code CLIにdiffctx MCPをインストール
$ code --add-mcp '{"name":"diffctx","type":"stdio","command":"uvx","args":["diffctx"]}'Claude Desktopにdiffctx MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Codexにdiffctx MCPをインストール
$ codex mcp add diffctx -- uvx diffctxCodex config.tomlにdiffctx MCPをインストール
~/.codex/config.toml
[mcp_servers.diffctx] command = "uvx" args = ["diffctx"]
Gemini CLIにdiffctx MCPをインストール
$ gemini mcp add -s user diffctx uvx -- diffctxGemini settings.jsonにdiffctx MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}自動チェック
実行日 2026年11月14日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能nikolay-e/diffctx is public and reachablegithub.com/nikolay-e/diffctx ↗合格
- パッケージがこのリポジトリをソースとして指定diffctx names nikolay-e/diffctx as sourcepypi.org/project/diffctx/ ↗合格
- ビルドの来歴 (Sigstore 証明)Sigstore attestation for diffctxpypi.org/project/diffctx/ ↗合格
- オープンソースライセンス (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-11-12github.com/nikolay-e/diffctx ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from diffctx合格
- パッケージおよびその依存関係に重大な勧告なし2 resolved dependencies checked; no critical advisoryosv.dev ↗合格
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見るdiffctx — 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のよくある質問
diffctx MCPをClaude Codeに追加するには
ターミナルでclaude mcp add diffctx -- uvx diffctxを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
diffctx MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
diffctxは、リポジトリ全体をパッキングするツールやコードグラフサーバーとどう違うのですか?
すべてをエクスポートするリポジトリ全体パッカーや、維持されたインデックスを使用するコードグラフサーバーとは異なり、diffctxはdiffを起点(diff-seeded)とします。つまり、特定の変更を入力とし、その変更が影響を与える範囲を出力します。
diffctxの動作にインデックスやモデルの呼び出しは必要ですか?
いいえ、ローカルで動作し、インデックスの維持やモデルの呼び出しを必要とせずに決定論的に動作します。
LLMに送信するコードの量を制限できますか?
はい、--budgetフラグを使用することで、出力を特定のトークン数に制限できます。