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

VerifiedSTDIODesktop onlyKnowledge & MemoryDeveloper Tools

Overview

AI-generated 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.
Before you install
It reads repository source code and sends the selected code to the connected assistant, so review what leaves the machine. Caller resolution is static and per language and reports when it cannot resolve rather than guessing. The README's FAQ mentions secrets handling; check it before pointing the tool at sensitive repositories.

Installation

In SourceWeft

  1. Open diffctx in the dashboard and add it to a workspace.
  2. 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

bash
uvx diffctx . --diff HEAD~1             # zero-install, run once via uvpipx install diffctx                    # isolated CLIpip install diffctx                     # into an active environmentcargo install diffctx                   # native binary from crates.io, no Pythonnpx diffctx . --diff HEAD~1             # npm wrapper over the native binarydocker run --rm -v "$PWD:/repo" ghcr.io/nikolay-e/diffctx . --diff HEAD~1
powershell
scoop bucket add diffctx https://github.com/nikolay-e/diffctx   # Windowsscoop 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.

bash
claude mcp add diffctx -- uvx --from 'diffctx[mcp]' diffctx-mcpcodex mcp add diffctx -- uvx --from 'diffctx[mcp]' diffctx-mcpgemini 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.

bash
claude plugin marketplace add nikolay-e/diffctxclaude plugin install diffctx@diffctx

CI

The GitHub Action hands a pull request's diff context to any review step.

Usage

bash
diffctx . --diff --mode impact          # uncommitted work: callers outside the diff, their tests, contractsdiffctx . --symbol parse_config         # the same for a name, no change neededdiffctx . --diff main...feature         # the code to review a branch, packed under the auto budgetdiffctx . --diff HEAD~1 --budget 12000  # the last commit, capped at 12k o200k tokensdiffctx . --diff 24h --mode locate      # today's work as ranked JSON, no source bodiesdiffctx .                               # 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.

[diffctx demo]

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

Apache 2.0

Source: README.md at commit 745f593

Tools

0
SourceWeft started this package once in an isolated sandbox, without credentials, to list its tools. That failed: the server did not start.

Version history

11
  1. v1.20.0LatestOct 22, 2026
  2. v1.19.1Oct 14, 2026
  3. v1.19.0Oct 14, 2026
  4. v1.18.4Oct 7, 2026
  5. v1.18.3Oct 4, 2026
  6. v1.18.2Oct 2, 2026
  7. v1.18.1Sep 30, 2026
  8. v1.18.0Sep 30, 2026
  9. v1.17.0Sep 23, 2026
  10. v1.16.0Sep 16, 2026
  11. 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