A context window is the maximum text a model can hold and reference in one turn — the system prompt, files, tool output, and its own reply. This piece uses the common 200,000-token window as its baseline, though some current Claude models support up to a million. Filling it isn't just a room problem: recall and precision measurably decline before the window is full, a pattern Anthropic calls context rot.

Updated August 2026. That matters because visual review is one of the fastest ways to fill a context window without noticing. A single 30-second screen recording, frame-dumped into an agent at one frame per second, costs roughly 80,730 tokens — close to 40% of a 200,000-token window gone before the agent has even started fixing what you showed it, calculated from Anthropic's published image-token formula.

What is a context window?

A context window is the total amount of text a language model can hold and reference during one turn — the system prompt, the conversation so far, any images or files, and the reply it's about to generate. It's not the model's training data; it's closer to working memory, and it has a fixed size measured in tokens.

It's easy to conflate a context window with a model's training data — the enormous corpus it learned from before you ever opened a chat. They're unrelated. Training data shapes what the model knows in general; the context window is what it can see right now, in this conversation, and it resets to empty the moment a new one starts. This is part of the wider picture of Claude Code token costs: every dollar spent in a session traces back to what's sitting in that window at the time.

What goes into it?

Everything in a request counts: the system prompt, every message in the conversation history, tool definitions, tool results, images, documents, and the model's own output including any thinking. Nothing is free once it's in context — a pasted screenshot and a paragraph of instructions both draw from the same fixed token budget (Source: Anthropic, 2026).

Some of what fills the window is invisible to you — an agent's tool definitions and system instructions load before you type a word. The rest is whatever you add, and it varies enormously in cost for the same information:

What's in the window Example Cost
System prompt + tool definitions Instructions and available tools, loaded before you type Loaded automatically, not user-controlled per turn
One 1080p screenshot A single full-screen image pasted into chat 2,691 tokens on Claude 4.7+ (calculated)
A 30-second screen recording, frame-dumped at 1 fps Raw frames, no narration 80,730 tokens (calculated)
A narrated review of the same 30 seconds Transcript plus selected frames ~3,500 tokens (measured, typical)
Four screenshots to cover one page Static images, zero narration 10,764 tokens (calculated)

Every row draws from the same fixed budget as your actual instructions. See how many tokens does a screenshot cost an AI agent for the full formula worked out on five real screen sizes.

What happens when it fills?

Two different things happen depending on when you hit the ceiling. If your input alone already exceeds the window, the API rejects the request outright with a 400 error before generating anything. If generation reaches the limit mid-response, newer Claude models stop and report why, rather than failing silently or truncating without explanation.

In practice, that plays out in two ways depending on your workflow:

  1. You paste too much at once. If the input alone already exceeds the model's context window, the request fails immediately — no partial response, no wasted generation, just an error before anything runs.
  2. The conversation grows past the limit over many turns. On newer Claude models, generation stops mid-response and reports stop_reason: model_context_window_exceeded instead of silently continuing past the ceiling.

Chat interfaces such as claude.ai handle this differently again, managing the window on a rolling first-in-first-out basis rather than erroring out. Claude Code sessions that regularly approach the limit can lean on server-side compaction, which summarizes earlier turns automatically so the conversation keeps going (Source: Anthropic, 2026).

  • 200,000 tokens — in a typical context window
  • 80,730 tokens — burned by one 30-second frame-dumped review
  • 40% — of that window gone before the fix even starts

Is a bigger window the answer?

Not by itself. Several current Claude models now support context windows up to 1 million tokens, far larger than the 200,000-token standard. But Anthropic's own documentation states plainly that more context isn't automatically better: accuracy and recall degrade as token count grows, a pattern the company calls context rot — regardless of how large the ceiling is.

It's tempting to treat a bigger number as a strictly better one. Several current Claude models support windows up to 1 million tokens on the API — five times the 200,000-token baseline (Source: Anthropic, 2026). That headroom genuinely helps with large codebases and long documents. It doesn't repeal the underlying problem.

A 2025 report from Chroma, a vector-database company, tested 18 models — including Claude, GPT, Gemini, and Qwen variants — and found accuracy dropped as input length grew, even on simple tasks, well short of any model's stated maximum. It's an industry research report, not a peer-reviewed study, so treat the exact numbers as directional rather than settled — but the direction matches what Anthropic's own documentation already states.

A wider window changes when you hit the wall. It doesn't change whether stuffing it with irrelevant tokens hurts you before then.

How does context relate to quality?

Two separate effects are documented. Position matters: a widely cited 2023 study found models recall information at the start or end of a long context more reliably than information buried in the middle. Volume also matters: a 2025 industry study testing 18 models found accuracy declines as input length grows, even on simple tasks.

Two things are worth separating here, because they get conflated a lot.

The first is well established: a 2023 paper, Lost in the Middle: How Language Models Use Long Contexts, found that model performance is highest when relevant information sits at the start or end of a long input, and drops when it's buried in the middle — a pattern that held even on models built specifically for long contexts (Source: Liu et al., 2023). Follow-up work since has generally confirmed the shape of this effect, even as individual models have gotten better at handling it.

The second is newer and less settled: the Chroma study above also found that distractors — irrelevant but related text — hurt more as the input got longer, and that Claude models tended to abstain when uncertain rather than guess, while some other model families answered confidently and wrong. That's one study from one organization, not a research consensus, and it's worth reading it that way rather than as a settled fact.

What both point at, cautiously: a short context containing only what's relevant tends to outperform a long one padded with things the model has to sort through — not as a hard law, but as the direction every piece of current evidence leans.

How do you keep it clean?

Treat the window as a budget, not a dumping ground. Trim conversation history you don't need, avoid pasting raw video or frame-dumped screenshots when a short description or a single image will do, and use Anthropic's own compaction and context-editing tools to summarize or clear old tool results before they accumulate.

  • Trim what you don't need. Old tool results and resolved side-conversations don't have to stay in context forever.
  • Prefer a short description or a single well-chosen screenshot over a raw video or a frame-dump.
  • Use compaction and context-editing where your tooling supports it, instead of letting history grow unbounded.
  • Check the token counting API before you send a large request, rather than finding out after it fails.

For the compounding version of this problem, why a Claude Max plan runs out faster than expected walks through the daily arithmetic, and 11 ways to cut Claude Code token costs ranks the highest-return habits by effort.

Narrated review bundles are one honest way to keep a window clean for visual feedback specifically — a transcript plus a handful of selected frames instead of a raw recording, which is the approach Walkie packages for Claude Code. It isn't the only way to do this, and it isn't relevant if your context problem isn't visual. It's one habit worth having if it is.

What to do next. You don't need to memorize a token formula to act on any of this. Two habits cover most of it: stop pasting things the agent has to re-read to reach the same conclusion, and check what a long session is actually holding before assuming a bigger window would fix it. Anthropic's token counting endpoint reports exactly what a request costs before you send it — a better first step than guessing, whether or not you ever change anything else about how you work.