Context Window
A context window is the maximum text, in tokens, a language model can consider at once, including the prompt, retrieved sources and the response it generates.
What is a Context Window?
A context window is the maximum amount of text, measured in tokens, that a large language model can take into account when generating a response. It includes the system instructions, the conversation so far, any documents or web passages retrieved for the task, and the model’s own output. Anything outside the window is invisible to the model for that response.
Anthropic’s documentation describes the context window as the model’s “working memory”, distinct from the much larger body of data it was trained on. A token is a piece of a word; as a rough rule, a token is a few characters of English text, though the exact ratio varies by tokenizer and language.
How it works
- Everything counts. Instructions, prior turns, tool definitions, retrieved documents and the generated answer all consume tokens.
- Limits vary by model. Anthropic’s docs, for example, list 1M-token windows for many current Claude models and 200k tokens for some others. Limits change with each release.
- Bigger is not always better. Anthropic notes that “as token count grows, accuracy and recall degrade,” a phenomenon it calls context rot. Research such as “Lost in the Middle” (Liu et al., 2023) found models are most accurate when relevant information sits near the start or end of a long input.
- Retrieval fills the window selectively. AI search and RAG systems retrieve the most relevant passages and place them in context rather than loading everything.
From SEO to AEO and GEO
Classic SEO had a loose equivalent in snippet length: Google showed a short excerpt, so you wrote a meta description and an opening that worked in that space. The search engine indexed the whole page, though, and the user clicked through to read it.
In AI answers, the model may only see selected passages from your page, alongside passages from competitors, inside a shared context window. The answer is composed from what fits and what the model attends to. That changes how content should be shaped.
| Classic SEO | AEO/GEO |
|---|---|
| Whole page indexed and ranked | Selected passages enter context |
| Snippet is a preview | Passage is the source material |
| User reads the page | Model reads for the user |
What carries over: answer-first writing, clear headings and concise summaries. What changed: buried facts are effectively absent, and a passage that depends on earlier paragraphs may lose its meaning once extracted.
What to do about it
- Front-load answers. Put the definition, verdict or key number in the first sentences under each heading.
- Write self-contained passages. Restate the subject instead of “it” or “as noted above.”
- Use compact formats such as short lists and small tables for comparisons and specs.
- Trim boilerplate. Navigation text, long intros and repeated CTAs in the main content waste space if a crawler extracts them.
- Keep facts consistent across pages, so whichever passage is retrieved says the same thing.
- For docs, consider llms.txt and llms-full.txt, sized with real context limits in mind.
Common mistakes
- Assuming large windows mean engines read everything. Selection still happens.
- Long preambles before the answer.
- Key facts only in images or PDFs that may not be extracted as text.
Related terms
- Large Language Model
- Chunking
- Retrieval-Augmented Generation
- Knowledge Cutoff
- llms-full.txt
- How AI engines cite sources
Sources
- Context windows, Anthropic documentation
- Lost in the Middle: How Language Models Use Long Contexts, Liu et al., 2023
- Effective context engineering for AI agents, Anthropic
Frequently asked questions
How big are context windows today?
It depends on the model and changes often. As of late 2026, Anthropic's documentation lists 1M-token context windows for many current Claude models and 200k tokens for some others. Other vendors publish their own limits. Check the provider's model documentation rather than relying on a fixed number.
If context windows are huge, why does chunking still matter?
Because more context is not automatically better. Anthropic's docs note that accuracy and recall degrade as token count grows, which it calls context rot, and the 2023 'Lost in the Middle' study found models used information in the middle of long inputs less reliably. Cost and latency also push engines to send only the most relevant passages.
Does my whole web page go into ChatGPT's context window?
Not necessarily. AI search engines do not publish exactly how much of each page they pass to the model. Many retrieval systems select passages or snippets rather than entire pages, and they combine several sources in one answer, so each source gets limited space.