What is a context window? Definition and examples
On this page
A context window is the maximum amount of text, measured in tokens, that a language model can take into account at once, including its instructions and reply.
How it works
Anthropic's documentation describes the context window as "all the text a language model can reference when generating a response, including the response itself," and calls it the model's "working memory", as distinct from what it learned in training (Claude docs).
Everything in a request competes for that space: the system instructions, the conversation so far, any documents or retrieved passages, tool definitions, and the answer being generated. In a long chat, earlier turns pile up until the limit is reached; applications then trim, summarize or drop older messages.
Sizes have grown fast. As of October 2026, Anthropic lists a 1M-token context window for its current Claude models, and other providers offer windows of similar orders of magnitude. Check the current model documentation for exact figures, since they change with each release.
Bigger is not automatically better
Long inputs have known weaknesses:
- A 2023 study, "Lost in the Middle", found that models used information best when it appeared at the beginning or end of a long input and noticeably worse when it sat in the middle (Liu et al.).
- A July 2025 report by Chroma tested 18 models and found that "model performance consistently degrades with increasing input length," even on simple tasks (Chroma).
Anthropic's documentation names the effect context rot and concludes that curating what goes into the context is "just as important as how much space is available."
Why it matters for your website
A large context window tempts teams to paste an entire website into every request. For a website assistant that usually means higher cost per answer, slower replies and, per the research above, less reliable use of the details that matter. Retrieval-augmented generationRetrieval-augmented generation (RAG) is a technique where an AI system first looks up relevant documents, then writes its answer using what it found. exists partly for this reason: it sends the model only the handful of passages relevant to the question.
For you, context window size mostly shows up as limits: how long a conversation can run before the assistant forgets the start, how large a document it can read at once, and what each answer costs in tokensTokens are the small units of text, often a word or part of a word, that language models read and write, and the unit in which AI usage is usually priced..
Example
A single assistant request might be budgeted like this (illustrative numbers):
| Part | Tokens |
|---|---|
| System instructions and rules | 1,500 |
| Conversation so far (6 turns) | 1,200 |
| Five retrieved passages from your site | 2,500 |
| The visitor's new question | 40 |
| Room reserved for the answer | 800 |
| Total | 6,040 |
That is a small fraction of a modern context window, and it stays focused on the question.
Related terms
- Tokens: the unit context windows are measured in.
- Large language model (LLM): the model with the window.
- Retrieval-augmented generation (RAG): filling the window with only what's relevant.
- Chunking: sizing passages so several fit.
Sources
- Context windows (Claude API documentation) — accessed October 20, 2026
- Lost in the Middle: How Language Models Use Long Contexts (Liu et al., 2023) — accessed October 20, 2026
- Context Rot: How Increasing Input Tokens Impacts LLM Performance (Chroma, July 2025) — accessed October 20, 2026
Articles that use this term
Agent-ready web
How to write an llms.txt that AI assistants actually use
Most llms.txt files are sitemaps in disguise. How to write one an AI assistant can answer from: summary, facts, links, Markdown pages, testing and upkeep.
Agent-ready web
llms.txt explained: who reads it and how to write one
llms.txt is a Markdown map of your site for AI agents. What the v2 proposal says, who reads the file as of October 2026, and a template you can copy today.
Guides
Voice agents on websites: use cases, costs and pitfalls
When a talking website helps and when it gets in the way: realistic use cases, per-minute costs as of October 2026, and the pitfalls to plan for at launch.