What a context window is
A context window is the complete text a model can reference when generating a response, including the response itself, and it is measured in tokens [1]. Anthropic describes the context window as the model's working memory, and distinguishes it from the corpus the model was trained on [1]. The distinction matters: the training corpus is what the model absorbed beforehand, while the window is what sits in front of it at the moment of answering. The window is not a store of knowledge but the space in which a single piece of work happens.
What occupies the window
Everything placed in the window counts toward it: the system prompt, every message including tool results, images and documents, and any tool definitions. The whole output of that turn counts as well, including extended thinking [1]. A concrete case makes the arithmetic plain. Suppose an assistant is asked to review a long report. The instructions alone consume tokens, the report itself consumes many more, the definitions of any tools the assistant may call take up room, and the reply it finally writes is charged to the same budget. What looks like one question is really a stack of inputs competing for one allowance.
How large it is, and where it stops
Anthropic's documentation lists a 1M-token context window for its current flagship models and 200k tokens for older ones, with up to 128k output tokens per request on the 1M models [1]. Attachments have their own ceilings: a single request is limited to 600 images or PDF pages on the 1M-token models and 100 pages on the 200k-token models, and image tokens count against the budget like any other input [1]. The limit is enforced rather than negotiated. If the input alone already exceeds the model's context window, Anthropic's API returns a 400 invalid_request_error reading "prompt is too long" on every model [1]. One point is easy to misread: cached prompt prefixes still occupy the context window, so caching changes billing rather than how much room a prompt takes [1]. A discount on the bill is not extra space in the window.
More context is not automatically better
Anthropic states that more context is not automatically better, and that accuracy and recall decline as the number of tokens grows, a phenomenon it calls context rot [1]. The degradation is not only a matter of volume; position inside the window matters too. Liu et al. found that language model performance is often highest when the relevant information sits at the beginning or end of the input context, and degrades significantly when the model must retrieve it from the middle [2]. That study tested multi-document question answering and key-value retrieval, and observed the effect even in models explicitly built for long context [2]. A large window therefore describes capacity, not uniform attention across everything inside it. Information placed in the middle of a long prompt is, in practice, the easiest to lose.
Why it matters
For anyone building with a model, the context window is a budget that has to be planned. Instructions, retrieved documents, tool definitions, images and the answer all draw on the same allowance, and a request that overruns it fails outright rather than degrading gracefully [1]. Because accuracy falls as the window fills and because material in the middle is the least reliably used [1][2], deciding what to include, what to leave out, and where to put what remains is part of the design work rather than an afterthought. The size printed in a specification tells you the ceiling; how the model behaves as it approaches that ceiling is a separate question, and one that the two lines of evidence above answer in the same direction.
CapabilitiesLarge language models
TechniquesFoundation modelsTransformers & attention
Ecosystem & regionDeveloper tools
Notes and sources
- Context windowshttps://platform.claude.com/docs/en/build-with-claude/context-windows
- Lost in the Middle: How Language Models Use Long Contextshttps://arxiv.org/abs/2307.03172
Cite this page: Context window. TellWorld, https://www.tellworld.net/learn/context-window. Updated 2026-11-07