How DistilCode saves tokens
DistilCodeBack to homeHow they are saved
We apply 14 optimisations on your context, to reduce your input tokens. Optimisations keep your context history byte identical so your cache isn't broken. Each one is listed on this page:AutoJev model selection
The first normal prompt in a new session is routed to a model class suited to the work.Explore techniqueSmart compaction
Old conversation is compacted while actionable facts, constraints, and file state are carried forward.Explore techniquePonytail mode
The agent works like a lazy senior developer: reuse what exists and write the shortest diff that works.Explore techniqueCaveman mode
Terse replies: the answer, not the essay, so output tokens stop piling up.Explore techniqueBash output trimmer
Keeps errors and the tail of shell output, and drops progress bars, repeats and boilerplate.Explore techniqueJSON compressor
Collapses repetitive arrays and keys into a compact shape, keeping the rows that matter.Explore techniqueLog compressor
Folds repeated build and test lines and keeps failures, warnings and stack traces.Explore techniqueDiff compressor
Trims unchanged context so only the hunks that matter remain.Explore techniqueGrep/glob compressor
Groups search matches by file and caps runaway result lists.Explore techniqueExtend cache
Keeps the provider’s prompt cache alive between turns so the prefix stays cheap.Explore techniqueCold cache reformatter
When the cache has expired anyway, stale tool results are collapsed before paying full price.Explore techniqueDynamic delegation of tasks
Bounded work can move into a specialist child session with an appropriate model class and tool permissions.Explore techniqueCodebase graphing and traversal
Get the relevant source, call paths, and change impact from a local repository graph.Explore techniqueTask-specific tool adaptation
Give each specialist the capabilities its job needs and match editing tools to the active model.Explore technique
How they were evaluated
Built to mirror real work.
AgencyBench V2
Evaluated on AgencyBench V2—long, multi-subtask agentic work rather than single isolated issues.Multi-subtask runs
Each run chains several dependent subtasks, so early decisions and context carry into later ones.Built to fill the 1M context window
Runs are designed to consume the whole 1M-token context window, where wasted tokens hurt the most.Real agentic work
Models worked the way they would in practice—in a live repository.Same LLMs, two harnesses
Identical models faced the same problems: one on a conventional agentic loop (opencode) and one on our harness.What we measured
Cost, tokens used and correct answers, compared run for run: 66% lower cost, 80% fewer tokens and 18% more correct answers.
The benchmark, including the detailed methodology and results, has been published at github.com/DistilCode/distilcode-study.