Distil is a context compression tool for agent runtimes. Its core goal is to measure the cost and decision impact on the context toolchain of coding agents and to provide reversible compression capabilities. It emphasizes a "quality contract": cache-aware, causal pruning, and certified as non-inferior across 7 domains.
In terms of use, Distil mainly addresses the token consumption and cost problems caused by agents repeatedly sending large amounts of tool output, logs, and history during long sessions. Through reversible compression, it collapses large tool outputs into handles, and the agent can restore the original bytes on demand during a task through the distil_expand tool. At the same time, it provides measurement tools to evaluate the actual impact of any compressor (including a provider's own compression) on dollar cost and changes in agent decisions.
Main capabilities include: reversible compression (lossless by default, every byte recoverable); cache-aware, without rewriting bytes already cached by the provider; shadow mode, which compares original and compressed context by replaying requests and reports decision equivalence; auditing, which replays samples of user requests with a named compressor and reports help/harm/inconclusive; support for multiple integration methods, including library calls, proxy, wrapper, MCP server, and framework hooks; and observability such as a live status line, session profiling, OTel spans, and Prometheus metrics.
In terms of usage, Distil provides multiple installation paths (curl, Homebrew, pipx, Windows, etc.). It can be used as a library: from distil import compress_messages; there is also a corresponding npm package for TypeScript. It can run as a proxy, pointing any base_url client to it, supporting Anthropic Messages, OpenAI Chat Completions and Responses API, Azure OpenAI, and Gemini generateContent. It can wrap agents: distil wrap -- <agent>, providing 18 presets (aider, claude, codex, gemini, copilot, etc.). Hooks can be set up: distil setup --hooks, for Claude Code, Cursor, Gemini CLI, and Codex CLI. Shell output can also be shaped at the source through distil sh -- <command>.
Applicable scenarios include: long-session context management for coding agents, tool output compression, cost measurement and auditing, and a unified compression mechanism in multi-provider environments. Regarding limitations, the material shows that no compressor has been proven to save costs on short coding tasks; long-session pilot results are inconclusive; on fixed-rate subscriptions there is no per-token billing to cut, but rate-limit windows can be saved; compression effectiveness depends on the workload, with verbose JSON and repeated logs compressible by 25–99%, while prose and unique-line output compress by about 0%.