For the complete documentation index, see llms.txt. Every page on this site is also served as Markdown: append `.md` to any URL, or send `Accept: text/markdown`.
Attensira Logo
Attensira
AI Glossary

Context window

The token budget a model can reference in one request, what counts against it, and why a bigger window does not remove the need to retrieve selectively.

Karl-Gustav KallasmaaKarl-Gustav Kallasmaa, Founder & CEOLast updated

A context window is the amount of text a model can reference when generating a response, including the response itself. Anthropic's documentation describes it as working memory, explicitly distinct from the large corpus of data the model was trained on. It is measured in tokens, not words or characters, and it is the budget every other limit is expressed against.

Sizes are a property of a specific model, not of AI in general. Anthropic documents several current Claude models with a 1M-token context window, while others including Claude Sonnet 4.5 carry a 200k-token window, and notes a related cap: a single request can include up to 600 images or PDF pages, or 100 on the 200k-token models.

What actually counts against it

More than people expect, which is why requests fail at sizes that seem safe. Anthropic states that everything in the request counts toward the context window: the system prompt, every message in the conversation including tool results, images and documents, and the tool definitions themselves. The output generated for the turn counts too, including any thinking the model does.

That last point is the one that surprises application builders. Tool definitions are input tokens on every single request, so an agent with a large tool catalogue pays that cost continuously whether or not it uses any of them.

Bigger is not simply better

The intuitive model — fill the window, get better answers — is contradicted by the vendor's own documentation. Anthropic writes that more context is not automatically better, and that as token count grows, accuracy and recall degrade, a phenomenon it names context rot. Its conclusion is that curating what is in context is just as important as how much space is available.

This is the crucial point for anyone reasoning about AI search, because it disposes of the argument that growing windows will make retrieval obsolete. Two things stop that happening. The window is finite and the web is not, so something still has to choose. And even well inside the limit, indiscriminate filling degrades the answer, so choosing well is not merely an efficiency concern. Retrieval-augmented generation is the name for doing that choosing deliberately.

How it differs from memory, and from training

Three storage-shaped ideas are routinely conflated:

  • Training fixed the model's weights before you arrived. It is not queryable, not editable and not attributable. See AI training data.
  • The context window is per request. It holds only what was sent this time, and it is discarded afterwards. Nothing carries over unless the application sends it again.
  • Application-level memory is a product feature built on top: the application stores something and re-sends it later. From the model's side it is still just tokens in the window.

The practical consequence is that "the assistant remembers our conversation" describes an application resending history, not a model retaining it.

How to act on it

For anyone whose interest is being read and cited rather than building on the API, the useful implications are about page structure:

  1. Write self-contained passages. A retriever selects spans, not documents. A paragraph whose subject and qualifier are both present survives extraction; one that depends on three paragraphs above it does not.
  2. Put the claim under the heading that promises it, so the span selected on a heading match contains the substance.
  3. Front-load the specifics. Numbers, definitions and comparisons early in a section make the first selected span the informative one.
  4. Keep pages focused. A page covering one question well is easier to select from than a page covering six, which is a real argument against merging thin pages into one long one just to clear a word count.
  5. Do not pad. Padding costs budget on the retrieval side and adds nothing that could be quoted.

Frequently asked questions

How large is a context window?

Model-specific: Anthropic documents 1M tokens on several current Claude models and 200k on others.

Is it the same as memory?

No. It is per-request working memory, distinct from training and from application-level memory.

What counts against it?

System prompt, all messages, tool results, documents, tool definitions and the generated output.

Do larger windows remove the need for retrieval?

No. The window is finite, and accuracy and recall degrade as it fills.

Frequently Asked Questions about Context window

It depends on the model. Anthropic's documentation states that several current Claude models have a 1M-token context window while other models, including Claude Sonnet 4.5, have a 200k-token window. Sizes are a per-model property and change with each release, so check the vendor's table rather than carrying a number in your head.

No. Anthropic describes it as working memory, distinct from the large corpus the model was trained on. It holds only what is in the current request; nothing persists between requests unless the application sends it again.

Everything in the request and the response. Anthropic's documentation states that the system prompt, every message including tool results, images and documents, and the tool definitions all count, and the generated output for the turn counts too.

Yes, on two grounds. A window is still finite against a corpus that is not, and Anthropic notes that as token count grows, accuracy and recall degrade, a phenomenon it calls context rot, which makes curating what is in context as important as how much space is available.

That a retrieval step is choosing passages against a budget. A section that states its claim compactly, under a heading that names it, is cheaper to select and survives being lifted out of the article around it.
Share this term

Track how your brand shows up in ChatGPT, Claude, and Google AI

Attensira monitors your visibility across AI search platforms so you know exactly when and how you're being recommended.