Token Economy Under the Hood: Spilling, Compaction, and Small-Model Mode
Why a single 1 MB build log kills your context window and your budget — and how Saturday spills, compacts, deduplicates, and shrinks prompts by up to 99.6% without losing a single byte on disk.
- 1A 1 MB log re-sent on 25 turns is a 25 MB bill.
- 2Saturday writes it to disk once and sends an 8 KB preview.
- 3The model asks for more only when it needs it.

A tool result is never paid for once. The full conversation history is re-sent on every LLM turn, so one verbose pytest run is billed over and over until compaction digests it. A 1 MB webpack log is worse. Earlier hard caps simply truncated the output, which left the model blind to everything past the limit.
Spill once to disk, page on demand
Saturday intercepts every oversized tool payload at one seam, fit_tool_response. That seam covers files, shell, web, MCP, adapters and subagents. Anything over 24,000 characters is written atomically to a content-addressed file under your config home, never into your repository. The prompt then gets a bounded head and tail preview:
[spill] shell output 1,048,576 chars / 13,108 lines -> ~/.saturday/spill/20261127/8f2c1d9a0b3e-shell.txt
[spill] full output kept on disk; showing first 1,600 and last 2,400 chars.
... [1,044,576 chars omitted - read the spill file for the rest] ...
[spill] next: read_file(path=..., offset=1, limit=2000) to page it, or grep(pattern=...) to search it.| Payload size | Inline before | Inline after | Token saving |
|---|---|---|---|
| 200 KB | ~50,000 tokens | ~1,126 tokens | 97.7% |
| 256 KB | ~65,536 tokens | ~1,126 tokens | 98.3% |
| 1 MB | ~262,144 tokens | ~1,127 tokens | 99.6% |
Compaction + history deduplication
Payloads under the 24k spill threshold can still waste thousands of tokens. Progress bars, carriage-return spinners, ANSI escape codes and repeated file reads all cost money. Saturday collapses that noise, measured at 97.7% reduction on noisy logs. It also deduplicates superseded reads across turns, measured at 75.1% history reduction, and keeps the latest ground truth intact.
Automatic small-model optimization (<= 14B)
Small local models, 4B to 14B, choke when handed 72 tool schemas and a massive system prompt. Ollama defaults like num_ctx=4096 will even truncate the tools silently, out of the middle of the prompt. So Saturday detects models of 14B or below, default auto, with no effect on frontier models. It narrows the active tool catalog from 89 to 13 core tools, switches to a compact prompt, -76.0% characters, and cuts schema characters by 54.6%. It masks old observations on the wire and coerces schema arguments. Measured live on Ollama qwen3.5:4b: -62.1% prompt tokens per step.
Questions people ask
What happens to tool output over 24,000 characters?
It is written atomically to a content-addressed file under the Saturday config directory, never your repository, and the prompt keeps a bounded head-and-tail preview with instructions to page or grep the file.
Does spilling delete the rest of the output?
No. The full payload stays on disk. Only the unused part stops being re-sent on every turn, and that repeated re-send is where the saving comes from.
How much does spilling save?
Measured inline token counts in the repository: a 200 KB payload falls from about 50,000 tokens to about 1,126, a 97.7% saving, and a 1 MB payload falls from about 262,144 tokens to about 1,127, a 99.6% saving.
Does this help small local models?
Yes. At 14B parameters and below, Saturday narrows the active tool catalog from 89 to 13, switches to a compact prompt and masks old observations. On Ollama qwen3.5:4b this measured a 62.1% cut in prompt tokens per step.
Try Saturday on your own machine
Free during the beta · 72 built-in tools · 22 providers (19 cloud, 3 local) · no account needed.