What hitting the context limit actually costs you
Running out of context is not a wall, it is a fork. The agent picks one of three exits, compress the history, truncate it, or start over, and each one has a different price. Most people never see which one got taken, which is why the cost feels arbitrary.
Compression is the common one. The model summarises the conversation so far and the session continues with the summary in place of the raw history. It is not free: producing the summary is output tokens, and every turn afterward re-sends the summary instead of the original. You pay once to compress, then discount the compression on every remaining turn.
Truncation is cheaper per turn and more expensive per session. Old turns get dropped outright, the agent loses context it previously had, and it re-reads files or re-asks questions it already resolved. The savings on input get spent on duplicated work.
Starting over is the most expensive and the most predictable. Everything the session had learned has to be re-established from scratch, which means re-reading the same files and re-sending the same context you already paid for once.
https://aicomp.ai/v1).
Create one free →
The arithmetic of one compression
Compressing a 200k-token context on Claude Sonnet 5 means generating a summary and then re-sending it. The generation is output tokens at $5 per million; the re-send is input at $1 per million. A compression that runs five times in a day is not a rounding error once you multiply it by a month.
A day of work on this page's workload is 320k input and 55k output tokens — 6.4M input and 1.1M output across a 20-day month. Sessions that hit the limit repeatedly land at the top of that range, and sessions that end cleanly land near the bottom. Same work, same model.
| Model | Gateway rate in / out per 1M tokens | One day | 20 days |
|---|---|---|---|
| claude-sonnet-5 | $1.00 / $5.00 | $0.59 | $11.90 |
| claude-opus-5-5 | $2.00 / $10.00 | $1.19 | $23.80 |
| gpt-5 | $0.625 / $5.00 | $0.48 | $9.50 |
| glm-5.3 | $0.70 / $2.2 | $0.34 | $6.90 |
| deepseek-v4-flash | $0.15 / $0.60 | $0.08 | $1.62 |
One day = 320k input + 55k output on this page's workload. 20 days = 6.4M input and 1.1M output. Rates checked 2026-10-22 (gateway rates move with upstream promotions), so verify the current number in your dashboard before committing to a budget.
The relevant column is output. Compression and re-establishment are both output-heavy events, and output is where the models separate most.
Three ways to stop paying it
End sessions earlier. Cost on the input side grows with turns because every turn re-sends the history. A session that finishes in eight turns never reaches the limit at all, which is strictly cheaper than any of the three exits.
Read only what you need. Every file read becomes context that gets re-sent on every subsequent turn and gets compressed when the limit arrives. Reading a large file speculatively is a cost you pay repeatedly, not once.
Watch for the reset. Some tools reset context usage on a schedule or on a new session. If your usage counter drops to zero, the accumulated context is gone, and the next turn will spend tokens rebuilding it.
FAQ
FAQ
What happens when an agent runs out of context?
One of three things: the history is compressed into a summary, old turns are truncated, or the session restarts. Compression costs output tokens plus a permanent re-send overhead; truncation causes duplicated work; restarting re-pays the full setup.
Is compression cheaper than starting a new session?
Usually, for a session that is nearly done. It is not cheaper for a session that is nowhere near done (continuing to accumulate from a compressed base re-sends the summary every turn), and a fresh start may beat that.
Does a bigger context window solve this?
It changes when you hit the limit, not whether. A larger window means more tokens re-sent per turn, so each turn costs more even though you hit the wall later. Shorter sessions beat bigger windows on cost.
Why does my usage reset on its own?
Most tools meter context usage per session or per billing window, and a new session starts from zero. The context is gone, so the next turn pays to rebuild whatever the agent needs again.