A bigger context window does not make any step cheaper. An agent re-sends its whole context on every step, so filling a 1M window multiplies the cost of each step. Without compaction, doubling a session's length roughly quadruples the tokens processed.
This is for founders and developers choosing models and settings for AI agents or long chats. As of October 2026, most current Claude models have a 1M token window by default, per Anthropic's context windows docs, and other providers offer similar sizes.
In short:
- Folding (summarizing old turns) at 110K tokens processed 2.9 times fewer tokens over 200 calls.
- Recall drops as context grows. Anthropic calls this context rot.
- Cold restarts, after the cache expires, cost in proportion to context size.
- Big windows suit one-off reads of large inputs.
You pay for the whole context every step
Model APIs are stateless. Each request carries the system prompt, the tool definitions and the full history, and the model reads it all before writing.
In an agent, one step is one such request. A single task can take hundreds of steps: read a file, edit it, run the analyzer, read the error, edit again. Prompt caching cuts the price of the repeated part to about 0.1 times input, but each step still pays for all of it.
Twice the session, nearly four times the tokens
Picture a build agent that starts at 35,000 tokens and grows by 1,800 tokens per call, close to what we measured on long app builds. It makes 200 calls. Folding the context at 110K cuts the total tokens by almost three times.
| Strategy | Last call's context | Tokens over 200 calls |
|---|---|---|
| Never compact | about 393K | 42.8 million |
| Fold to 40K at 110K | under 110K | 14.7 million |
At 400 calls, the unfolded run processes 157.6 million tokens. That is 3.7 times more for twice the work. The folded run processes 29.4 million, so the gap grows to 5.4 times.
These are tokens, not dollars. Most of them are cheap cache reads, and each fold forces one cache rewrite. To turn them into dollars, apply your model's cache-read and cache-write rates to each strategy.
Recall gets worse as context grows
More context can mean worse answers. Anthropic's docs say "As token count grows, accuracy and recall degrade, a phenomenon known as context rot."
Research agrees. The 2023 paper Lost in the Middle found models used facts at the start and end of a long input far better than facts in the middle.
In an agent, context rot looks like this:
- It re-reads a file it read 80 steps ago.
- It follows an early instruction that you later replaced.
- It edits an old copy of a file instead of the current one.
Anthropic's guide to effective context engineering for AI agents calls context "a finite resource with diminishing marginal returns."
Every cold restart scales with size
A prompt cache expires after minutes of inactivity, depending on provider and settings. The next request then writes the whole context back, at 1.25 or 2 times the input price on Claude.
At 800K tokens, that single rewrite costs about 2.7 times what it does at 300K. A huge context turns every break into a bill. Cache TTL: when a coffee break costs money has the numbers.
More input also means a longer wait for the first output token. On a long session, the agent simply feels slower.
Big windows suit big one-off reads
A large window is the right tool when one step truly needs a lot in view:
- Reading a large codebase or long document to answer one question.
- Comparing several long files side by side.
- Scanning one big log you cannot shrink.
Use the room for the step that needs it. Then summarize and continue small.
Five habits keep context small
- Start a fresh session for each unrelated task, as the Claude Code cost guide recommends.
- Set an auto-compact window below the maximum, like
/autocompact 200k. - Prefer narrow tools. On our agent, a read returned about 982 tokens, a grep about 96.
- Delegate exploration to a subagent, so only its short report stays.
- Clear stale tool output, for example with Anthropic's context editing.
GrowApps keeps builds far below 1M
When you build an app with GrowApps, the agent manages this for you. It folds a long build at 110K tokens, keeps the newest 15K word for word, and can search the full history for older details. Between turns, it compacts while the cache is warm. See how GrowApps keeps your build's context small.
Check your context size now
Open your current agent session and look at its context size. In Claude Code, run /context. If it is far above 200K and you are on a new task, run /clear and start fresh. Then read why most of an AI build's cost is input.
Frequently asked questions
Do long requests cost more per token?
On most current Anthropic models, no: a 900K-token request bills at the same per-token rate as a 9K one. Haiku 5.5 is the exception, where prompts over 100,000 tokens cost more. Check your provider's pricing page first.
Is a model with a small window cheaper?
Not automatically. Price per token, cache discounts and the number of steps all matter. A cheap model that needs three times as many steps can cost more.