Metadata-Version: 2.4
Name: diffctx
Version: 1.18.4
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Dist: pathspec>=0.11,<2.0
Requires-Dist: black>=23.0.0,<27.0 ; extra == 'dev'
Requires-Dist: charset-normalizer>=3.0,<4.0 ; extra == 'dev'
Requires-Dist: coverage>=7.0,<8.0 ; extra == 'dev'
Requires-Dist: hypothesis>=6.0,<7.0 ; extra == 'dev'
Requires-Dist: import-linter>=2.0,<3.0 ; extra == 'dev'
Requires-Dist: mypy>=1.0,<3.0 ; extra == 'dev'
Requires-Dist: pre-commit>=3.0,<5.0 ; extra == 'dev'
Requires-Dist: pygit2>=1.12,<2.0 ; extra == 'dev'
Requires-Dist: pytest>=7.0,<10.0 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23,<2.0 ; extra == 'dev'
Requires-Dist: pytest-cov>=3.0,<8.0 ; extra == 'dev'
Requires-Dist: pytest-timeout>=2.1,<3.0 ; extra == 'dev'
Requires-Dist: pytest-xdist>=3.0,<4.0 ; extra == 'dev'
Requires-Dist: pyyaml>=6.0.2,<8.0 ; extra == 'dev'
Requires-Dist: radon>=6.0,<7.0 ; extra == 'dev'
Requires-Dist: ruff>=0.4,<1.0 ; extra == 'dev'
Requires-Dist: tiktoken>=0.9,<1.0 ; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0,<7.0 ; extra == 'dev'
Requires-Dist: charset-normalizer>=3.0,<4.0 ; extra == 'full'
Requires-Dist: anyio>=4.5,<5.0 ; extra == 'mcp'
Requires-Dist: mcp>=2.3,<3 ; extra == 'mcp'
Provides-Extra: dev
Provides-Extra: full
Provides-Extra: mcp
License-File: LICENSE
Summary: Selects the minimum code an LLM needs to review a git diff
Keywords: ai,chatgpt,claude,code-analysis,code-context,code-review,code-to-prompt,codebase,context,context-selection,diff-context,directory-tree,export,git-diff,json,llm,llm-context,mcp,model-context-protocol,tree,yaml
Home-Page: https://diffctx.com/
Author-email: Nikolay Eremeev <nikolay.eremeev@outlook.com>
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Author, https://nikolay-eremeev.com
Project-URL: Changelog, https://github.com/nikolay-e/diffctx/blob/main/CHANGELOG.md
Project-URL: Documentation, https://diffctx.com/
Project-URL: Homepage, https://diffctx.com/
Project-URL: Issues, https://github.com/nikolay-e/diffctx/issues
Project-URL: Paper, https://doi.org/10.5281/zenodo.18824579
Project-URL: Repository, https://github.com/nikolay-e/diffctx

# diffctx — what a git change reaches, and the code to review it

[![CI](https://github.com/nikolay-e/diffctx/actions/workflows/ci.yml/badge.svg)](https://github.com/nikolay-e/diffctx/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/diffctx)](https://pypi.org/project/diffctx/)
[![crates.io](https://img.shields.io/crates/v/diffctx)](https://crates.io/crates/diffctx)
[![npm](https://img.shields.io/npm/v/diffctx)](https://www.npmjs.com/package/diffctx)
[![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.nikolay--e%2Fdiffctx-blue)](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.nikolay-e/diffctx)

**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

```bash
# Claude Code: the MCP server, /diffctx:impact, and hooks that run it before commit and push
claude plugin marketplace add nikolay-e/diffctx
claude plugin install diffctx@diffctx

# any MCP client
claude mcp add diffctx -- uvx --from 'diffctx[mcp]' diffctx-mcp

# CLI, zero-install
uvx diffctx . --diff HEAD~1
```

pipx, pip, cargo, npm, Docker, Scoop, other MCP clients and the Python API:
[integrations](docs/product/integrations.md).

## Usage

```bash
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](docs/product/cli.md).

![diffctx demo](https://raw.githubusercontent.com/nikolay-e/diffctx/main/docs/demo/demo.gif)

## 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](COMPARISON.md).

## More

- [Documentation site](https://diffctx.com/) — the pipeline end to end
- [Command-line reference](docs/product/cli.md) — rendered from `diffctx --help`
- [Integrations](docs/product/integrations.md) — install, MCP clients, Python API
- [FAQ](docs/product/faq.md) — heuristic or oracle, ignore rules, monorepos, secrets
- [Token counting](docs/product/token-budget.md) — `--budget` for non-GPT models
- [GitHub Action](docs/product/github-action.md) — diff context as a CI step
- [Benchmarks](BENCHMARKS.md) and the [paper](https://doi.org/10.5281/zenodo.18824579)
- [Changelog](CHANGELOG.md) · [Security](SECURITY.md)
- [Parameter strategy](docs/engineering/parameter-strategy.md)

Apache 2.0

<!-- mcp-name: io.github.nikolay-e/diffctx -->
<!-- Ownership marker read from the PyPI description by the MCP registry. -->
<!-- Must survive edits verbatim: one space after the colon, case-sensitive. -->

