Your context window bills you every turn
Your context window bills you every turn Claude Code compacted my session for the fourth time this week, and my first reaction was the normal one: annoyance. It just erased everything and I have to re-explain half of it. Then I pointed Claude Code at its own transcript files and did the arithmetic instead of the complaining. The transcripts are just JSONL on disk — every request, every token…
Claude Code charges you every turn for the entire conversation that has occurred so far. It does not remember anything for free. A 900K-token context gets re-read on turn 901, in some discounted form. Across three sessions, Claude Code read 1.99 billion tokens from cache and wrote 62 million tokens to it, representing a 32:1 ratio.
At different points in the sessions, four auto-compactions took place, each taking 108-140 seconds of wall-clock time. Despite the recompaction, the accumulated context is discarded and replaced with a summary. Running the token mix through cached and uncached pricing formulas, running the sessions with caching costs roughly $4,500, compared to $31,000 without caching.
This results in an estimated 86% reduction in cost due to caching alone, before compaction even fires. However, it's important to note that the $4,500 figure is a ratio, not an actual bill, and list price, not effective price, is used. The discount provided by caching is real, but it is still a recurring charge every turn that the token remains in the context window.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.