# Distil

Folds tool output into reversible handles and hands back the exact original bytes when asked. Useful when agent context and bills keep growing.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 20
- Author: dshakes
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dshakes/distil
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/distil

## What it does

Distil takes what your tools return, drops the bulk and leaves a handle the agent can trade back for the original through the `distil_expand` tool. Compression is lossless by default, and the folded bytes stay in a local store. The design keeps the provider's prompt cache intact: bytes still cached are never rewritten, older context shifts only once that cache has expired.

It also tells you what the saving is worth. `distil savings` reports it from your own traffic, `distil audit` replays a capped sample as a named compressor would shape it and says helped, hurt or too early to tell. Shadow mode replays requests against both the plain and the compressed context; if harm goes past the budget, the proxy stays lossless-only.

Launch goes through `uvx`, so `uv` has to be on the machine. Agent coverage comes from the `distil wrap -- <agent>` wrapper, with presets named for `claude`, `codex`, `gemini`, `copilot` and others. On short coding tasks the published comparison does not show a cost win over no compression at all, so expect the savings figure to depend on the task.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add distil -- uvx distil-llm
```
uvx runs the command named after the package; if the README names another one, use uvx --from distil-llm <command>

### Codex

**Platform CLI**
```bash
codex mcp add distil -- uvx distil-llm
```
uvx runs the command named after the package; if the README names another one, use uvx --from distil-llm <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "distil": {
            "command": "uvx",
            "args": [
                "distil-llm"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from distil-llm <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "distil": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "distil-llm"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from distil-llm <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add distil uvx distil-llm
```
uvx runs the command named after the package; if the README names another one, use uvx --from distil-llm <command>

## When to use it
- shrink tool output while keeping the original data
- pull the exact original back mid-task
- see the actual saving on your own traffic
- check whether compression changed the agent's next step
- compare compressors by dollars per solved task

## Example prompts
- Compress this command's output and leave a handle I can pull back with `distil_expand`
- Run `distil savings` and show me what it saved on my requests
- Check with `distil audit --compressor anthropic-context-editing` whether it helped or hurt

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
