GlossaryAI search
What is a context window?
Also called: context length, context size, token limit
Definition
A context window is the amount of text, measured in tokens, that a language model can take into account at once. It covers the prompt, any documents or history, and the answer the model writes.
Context window, explained
Anthropic's documentation describes the context window as all the text a language model can reference when generating a response, including the response itself. It calls it the model's working memory, distinct from the much larger body of data the model was trained on. Anything outside the window simply isn't seen for that request.
Sizes have grown fast. As of September 2026, Anthropic's docs list a 1M-token context window for its current Claude models and 200k tokens for some others, such as Claude Sonnet 4.5. Other providers publish their own limits per model, and they change with each release, so check the model page rather than trusting a number you read months ago.
Bigger windows don't mean a model uses everything equally well. Long prompts cost more, respond slower and can bury the important part. Good systems still select what goes in: the relevant passages, a summary of older conversation, the few documents that matter. Retrieval exists partly for this reason; it keeps the window full of signal instead of noise.
For AI search, the window explains why assistants quote passages rather than whole sites. An answer grounded in ten pages has to fit the useful parts of those pages alongside instructions and the question. Pages that put the answer early, in plain text, are easier to fit and use.
For builders, treat the window like memory in any other system. Budget it. Log how full it gets. Summarize or drop stale content before you hit the limit, rather than letting requests fail or silently truncate.
Why it matters for founders
If you build AI features, the context window caps what your product can consider per request and drives cost. If you publish for AI search, it's a reason to state answers early and cleanly.
Example
A coding assistant with a large window can read an entire mid-sized codebase at once, but it still answers better when given the three relevant files and a short summary of the rest.
Common mistakes
- Stuffing the whole knowledge base into every prompt because the window allows it.
- Quoting a model's context size from memory. Limits change with each release.
- Forgetting that the model's own answer also counts toward the window.
Sources
Checked
Related terms
- Tokens (AI)Tokens are the small chunks of text a language model reads and writes, often parts of words. Models count input, output, limits and API pricing in tokens, not words or characters.
- Large language model (LLM)A large language model (LLM) is an AI model trained on very large amounts of text to predict the next piece of text. That one skill lets it answer questions, summarize, write and reason in plain language.
- Retrieval-augmented generation (RAG)Retrieval-augmented generation (RAG) is a technique where a system first retrieves relevant documents, then passes them to a language model so it can answer from that material instead of memory alone.
- Content chunkingContent chunking is structuring a page as self-contained sections, each answering one question, so search engines and AI retrieval systems can find, understand and quote a single passage without the rest of the page.