Skip to content
GlossaryContext window

What is a context window? Definition and examples

Also known asContext lengthContext size
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 generation 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 tokens.

Example

A single assistant request might be budgeted like this (illustrative numbers):

PartTokens
System instructions and rules1,500
Conversation so far (6 turns)1,200
Five retrieved passages from your site2,500
The visitor's new question40
Room reserved for the answer800
Total6,040

That is a small fraction of a modern context window, and it stays focused on the question.

Sources

  1. Context windows (Claude API documentation) — accessed October 20, 2026
  2. Lost in the Middle: How Language Models Use Long Contexts (Liu et al., 2023) — accessed October 20, 2026
  3. 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.