Выбирает минимально необходимый объем кода для ревью git diff с помощью LLM, определяя затронутые вызывающие функции, тесты и контракты.
Также известен как nikolay-e/diffctx
- Звёзды
- 6
- Инструменты
- —
- Загрузки, 30 дней
- 3 869
- Последняя версия
- 1.20.0
- Последний коммит
- 14 нояб. 2026 г.
- Лицензия
- Apache-2.0
Что такое diffctx MCP?
diffctx — это MCP server. Выбирает минимально необходимый объем кода для ревью git diff с помощью LLM, определяя затронутые вызывающие функции, тесты и контракты.
Сводка сгенерирована из README проекта
О diffctx MCP server
diffctx помогает разработчикам и AI-агентам понять масштаб последствий изменений кода, определяя релевантный контекст за пределами git diff. Вместо передачи всего репозитория инструмент выбирает конкретные вызывающие функции, тесты и контракты, затронутые модификацией. diffctx спроектирован так, чтобы укладываться в заданный бюджет токенов, что делает его полезным для ревью кода с помощью LLM, когда ограничение контекстного окна является критичным.
Сервер запускается локально и работает детерминировано, не требуя поддержания индекса или внешних вызовов моделей. Его можно интегрировать в различные MCP-клиенты, такие как Claude Desktop, Cursor или Zed. Пользователи могут указать диапазон git, подготовленные (staged) изменения или даже временной интервал, например 24h, чтобы определить область анализа. Инструмент поддерживает различные режимы, такие как анализ влияния или поиск изменений, и позволяет устанавливать пользовательский бюджет токенов с помощью флага --budget.
Что вы можете с ним делать
- 1Анализ влияния изменений кодаОпределяйте вызывающие функции и тесты, затронутые конкретным git diff, чтобы понять масштаб изменений.
- 2Оптимизация контекста для ревью через LLMПредоставляйте AI-агенту минимально необходимый код для ревью ветки, не выходя за пределы лимита токенов.
- 3Поиск недавних измененийПолучайте ранжированный список изменений кода в формате JSON, внесенных за определенный период времени.
- 4Ревью конкретных символовНаходите область влияния и окружающий контекст для конкретной функции или имени без необходимости вносить изменения в код.
Взято из README проекта. Каждый вариант использования проверен на соответствие цитате из него.
Как установить diffctx MCP
Форматы проверены 10 ноя 2026Добавить в CursorДобавить в GooseУстановка diffctx MCP в Claude Code
$ claude mcp add diffctx -- uvx diffctxУстановка diffctx MCP в Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Установка diffctx MCP в VS Code
.vscode/mcp.json
{
"servers": {
"diffctx": {
"type": "stdio",
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Установка diffctx MCP в VS Code CLI
$ code --add-mcp '{"name":"diffctx","type":"stdio","command":"uvx","args":["diffctx"]}'Установка diffctx MCP в Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Установка diffctx MCP в Codex
$ codex mcp add diffctx -- uvx diffctxУстановка diffctx MCP в Codex config.toml
~/.codex/config.toml
[mcp_servers.diffctx] command = "uvx" args = ["diffctx"]
Установка diffctx MCP в Gemini CLI
$ gemini mcp add -s user diffctx uvx -- diffctxУстановка diffctx MCP в Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"diffctx": {
"command": "uvx",
"args": [
"diffctx"
]
}
}
}Автоматические проверки
Запущено 14 нояб. 2026 г.Полный отчёт →Прошло наши автоматизированные проверки. Это не аудит безопасности: изучите код и предоставьте серверу минимально необходимый доступ. Как работают проверки
- Связанный и доступный исходный репозиторий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/ ↗Пройдено
- Open source лицензия (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Пройдено
- Коммит или релиз за последний год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
Открыть на 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
Вопросы о diffctx MCP
Как добавить diffctx MCP в Claude Code?
Выполните claude mcp add diffctx -- uvx diffctx в терминале. Добавьте --scope user, чтобы сервер был доступен во всех проектах.
Как добавить diffctx MCP в Cursor?
Откройте ~/.cursor/mcp.json и добавьте сервер в mcpServers, используя конфигурацию Cursor из раздела установки выше.
Чем diffctx отличается от упаковщиков всего репозитория или серверов графа кода?
В отличие от упаковщиков, которые экспортируют всё содержимое, или серверов графа кода, использующих поддерживаемый индекс, diffctx работает на основе diff: входными данными служит конкретное изменение, а результатом — то, на что это изменение влияет.
Требуется ли для работы diffctx индекс или вызовы моделей?
Нет, он работает локально и детерминировано, не требуя создания индекса или выполнения вызовов моделей.
Можно ли ограничить объем кода, отправляемого в LLM?
Да, вы можете использовать флаг --budget, чтобы ограничить объем выходных данных определенным количеством токенов.