A memory system costs tokens to maintain: an index read every session, knowledge files retrieved, a distillation pass after work ends. Does it give more back than it takes? We mined 40 days of the developer's real Claude Code transcripts to price distill's overhead precisely, measured what friction knowledge actually prevents, and stress-tested a cheaper index. Numbers are reported tokens-first; dollar figures are API-equivalent counterfactuals (real usage runs on a flat-rate subscription).
The intuition: distill saves tokens in the long run because errors stop repeating and sessions start with knowledge instead of re-exploration. But the intuition had never been priced. Three sub-questions:
Subagent transcripts don't persist to the projects directory — every figure is a main-loop floor. Session titles and personal file names never leave the machine; the published dataset carries aggregates and pseudonymized paths only.
40 days of heavy use moved 656M tokens for 4.2M tokens of actual output — an API-equivalent of $868, 100% of it on the two most expensive models (Fable 5, Opus 4.8). Decomposed:
| Component | Tokens | Share of cost |
|---|---|---|
| Cache reads (context re-read every request) | 635M | 51–57% |
| Cache writes (context growth, 1h TTL) | 16.3M | 22–34% |
| Output (the actual work) | 4.2M | 15–21% |
| Fresh uncached input | 0.5M | <1% |
~85% of spend is moving context around, not generating anything. The median request drags 153k tokens of resident context (p90: 389k); that number grew 5× between May and June as sessions became marathons. Any cost strategy that doesn't address context posture is optimizing the 15%.
Spend is also concentrated: the top 5 sessions (deck-building and masterclass marathons) account for 69% of everything. The other 28 sessions average ~$10 API-equivalent. Routing small sessions to small models would save almost nothing; the leverage is inside the big sessions.
Sensitivity, not savings: re-pricing the window with mean context capped at 100k/60k tokens yields −40%/−57% — an unachievable upper bound (the work used much of that context), quoted only to size the lever. TTL note: observed usage is ~100% 1-hour-TTL cache writes; the re-price scales the observed hit pattern linearly.
| Overhead item | Measured | Window total (API-equiv) |
|---|---|---|
| Session-start floor (SPINE 3.6k + monitor rules) | ~5.5k tokens/session | $0.18 as reads |
| SPINE carried in resident context, re-read every request | 3.6k × 3,360 requests | $12.10 |
| /distill main-loop turns | 12 invocations, median $1.31 | $29.94 |
| /distill subagent (invisible in transcripts) | live samples 46–328k tokens | ≈$6–18 (estimate) |
| Knowledge-file retrievals | 36 reads, median file ~1k tokens | <$1 |
≈$50 per 40-day window — 5–6% of total spend. The index carry (SPINE re-read every request) costs more than every knowledge retrieval combined; the retrieval risk worth worrying about is under-retrieval, not cost. SPINE was Read-tool-loaded in only 17 of 33 sessions.
We scanned command output (Bash/PowerShell/Edit tool results only) for error signatures tied to encoded knowledge, and tracked recurrence over the window. A methodology trap first: a naive scan over all text inflated counts 3–10× — because reading a knowledge file that describes an error puts its signature into the context. Count errors only where they can actually happen.
This is the first hard measurement of a thesis distill already carried as a principle: encoded knowledge prevents lookup-shaped failures, while habit-shaped failures need structural checkpoints, not more prose. Each friction event costs a median 5–18k output tokens of self-recovery (upper bound; ≈$0.3–1 each).
Honest accounting: friction non-recurrence saved roughly $10–30 over the window — real, but small next to the context tax. The larger claimed benefit (avoided re-exploration and wrong turns in marathon sessions) has no counterfactual in this dataset: we never run the same session without knowledge. The distill-benchmark measures quality deltas; it doesn't yet record token deltas. That instrumentation is the top follow-up this study produces. Best external proxies: 40–60% of real agent-trajectory input tokens measured as redundant (AgentDiet, arXiv:2509.23586); Anthropic's memory + context-editing eval reporting 84% token reduction on 100-turn tasks (vendor-internal).
Update, September 2026: the index has grown since this was measured. It now carries 65 entries at a median 133 tokens each. The file is an estimated 13.8k–18.6k tokens (3.8–5.2× the 3.6k below) and the turn that reads it measures 21,247 tokens (5.9×) — growth driven by verbosity per entry rather than entry count. See Local Decision Models. The figures on this page stand as measured in July 2026.
The SPINE is 3.6k tokens, re-read constantly. A clean-context agent (which never saw the test set) compressed it by a mechanical rule — every entry becomes [Title](path) — ≤8-word trigger, all 59 entries preserved — landing at 1.2k tokens. A second clean agent (which never saw the diet SPINE) authored 6 held-out retrieval probes, paraphrased so string-matching can't win. Both arms ran on the same pinned model, N=2 per held-out probe.
The diet SPINE saves ~2.4k tokens of carry per session plus ~29% of retrieval-read volume — and measurably loses recall on paraphrased probes (1 of 6 held-out domains, consistently). Under this project's release rule — optimizations that change distill's output need explicit opt-in — this ships, if at all, as a documented option. A v2 compression rule that must preserve distinctive nouns is the obvious next test. Also noteworthy: even the full SPINE missed once on the secondary set — retrieval is not a solved problem at any index size.