SnapshotJuly 2026a point-in-time write-up, left as written

The context budget

Every session starts blank. There’s no memory from last time.

On every turn, the entire context window is rebuilt and sent to the model. What’s in it determines the quality of the response. What’s not in it is invisible.

Context is a finite resource. The rest of this chapter is about how much of it you have, what fills it, and what happens when you run out.

What fills the context window

In a typical Claude Code session, the window is filled by:

All of it goes over the wire, every turn. The model reads it fresh each time.

The 1M token window

A token is the unit the model reads and writes: roughly 3–4 characters, or about ¾ of an English word. Current Claude models (Fable 5, Opus 4.8, Sonnet 5) accept up to one million tokens per request as standard; Haiku 4.5 is capped at 200K. A million tokens sounds enormous. In practice it’s generous, but not infinite.

A few reference points:

1M is enormous for a focused task. It is not enough to hold an entire real-world codebase the way you might want to. This is one of the reasons agentic retrieval matters: the model reaches into a repository on demand rather than swallowing it whole.

The hard limit: compaction

When a session approaches the context limit, Claude Code triggers compaction. The harness sends the conversation back to the model and asks it to summarize what’s happened, preserving architectural decisions, unresolved issues, and the most recently accessed files while discarding redundant tool output and exchange detail.

After compaction, the context restarts with that summary plus recent activity. The rest is gone. Not archived, not retrievable. Claude no longer has access to the exact phrasing of what you said three hours ago, the precise output of a test run, or the full content of a file it read earlier. What survives is what the summary captured.

This is the real hard limit. You never hit 1M tokens and get an error; the system protects you from that. The limit is that you lose detail, silently, and the session becomes less precise as a result.

The slope toward the limit

Compaction is the floor. Perfect, uncontested context is the ceiling. Between them is a slope.

As context fills with partially-relevant material, the model’s attention spreads thin. Add a 50K-token log dump from a debugging session three hours ago and your current question competes with that log for the model’s focus. Leave a scrapped plan in the conversation and the model may keep referring to the abandoned approach.

This is why conflicting context is worse than missing context. The model integrates what’s there. If what’s there includes two contradictory plans, two versions of a file, or instructions that applied to a different task, the output reflects that.

Once you see context as a finite resource with a shape, managing it becomes a normal part of using the tool, both inside a session and across all of them.

Resources