What Is a Context Window? Why Your AI Chat Forgets the Start

An open book held up beside an aeroplane window, sunlight falling across its pages

Photo: Hippopx (public domain). Illustrative image.

What is a context window?

A context window is all the text a language model can reference when generating a response, including the response itself. That is Anthropic’s own definition, and it adds the comparison that makes the idea stick: the context window is the model’s “working memory”, separate from the large body of data it was trained on. Training is the model’s education; the context window is the desk it works at right now. Your messages, the AI’s replies, any document you pasted, any hidden instructions the app adds — all of it has to fit on the desk for the model to use it in this answer.

The desk is measured in tokens, the small chunks of text a model reads — often a word or part of a word. As a working rule, a token is roughly 3 to 4 characters of English. And the desk has a fixed size: every model has a limit, and when the conversation passes it, something has to go.

How big are context windows today?

Today’s flagship models offer around 1 million tokens: Claude Opus 5.5 and Claude Sonnet 5.5 list a 1M-token window, Gemini 4 Neon has a 1 million-token window, and GPT-6.2 Astra and Sol carry 1.05 million tokens. Older or smaller models may offer 200,000. A million tokens sounds enormous — roughly 750,000 English words — but long agentic sessions, with tool results and file reads piling up, can fill it faster than you expect. On Claude’s 1M-token models, a single request can generate up to 128,000 output tokens, and a single request can include up to 600 images or PDF pages.

What counts toward the window?

Everything in the request counts: the system prompt, every message in the conversation (including tool results, images and documents), and the tool definitions. The output Claude generates for the turn, including its extended thinking, counts too. Each turn’s input contains all previous conversation history plus the current user message — the model does not remember your last request on its own; every call rebuilds the window from what the app sends. That is why a long chat is expensive as well as forgetful: the whole history is re-sent every time. For the maths, see How Does AI API Pricing Work?.

Why does my AI chat forget the start?

When the window fills, something has to leave. Chat interfaces such as claude.ai manage the window on a rolling “first in, first out” basis, so the oldest material is the first to go — which is why a chatbot forgets the start of a long conversation. Coding tools such as Claude Code compact the session instead, replacing the conversation with a structured summary. If the input alone already exceeds the window, Anthropic’s API returns a 400 error: “prompt is too long”.

What is context rot?

There is a quieter failure that never throws an error. Anthropic’s documentation says it plainly: more context is not automatically better. As token count grows, accuracy and recall degrade, a phenomenon it calls context rot. Anthropic’s engineering team put it this way in September 2025: “as the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases”, and context “must be treated as a finite resource with diminishing marginal returns”. Part of the reason is structural: in the transformer design behind these models, every token can attend to every other token, creating n² pairwise relationships for n tokens, so focus spreads thinner as context grows.

The effect has been measured independently. A study first posted in 2023, “Lost in the Middle”, found that models did best when the relevant information sat at the beginning or end of the input, and performance “significantly degrades when models must access relevant information in the middle of long contexts, even for explicitly long-context models”. A 2025 technical report from the database company Chroma, testing 18 models, gave the effect its memorable name and found that models “do not use their context uniformly” and grow “increasingly unreliable as input length grows”. A prompt can fit comfortably inside the window and still produce worse answers, because it is stuffed with text the model does not need.

How to keep a chatbot on track

Three habits help. First, start a fresh chat for a new topic instead of carrying a long thread — the window resets and the model stops dragging irrelevant history along. Second, keep what you paste lean: paste the section that matters, not the whole document, and summarise long material yourself before pasting it. Third, use the tools built for this: retrieval systems such as RAG pull only the relevant passages into the window, and agentic memory — Anthropic calls it “structured note-taking” — has the agent regularly write notes persisted outside the window and pull them back when needed. What you put in the window matters as much as its size.

Frequently asked questions

Is a context window the same as memory? No. The context window is working memory for a single request. The model does not remember anything between requests unless the app sends it again. Long-term memory in AI tools is a separate system that stores notes or retrieved facts outside the window.

Is a bigger context window always better? Not automatically. A bigger window lets you fit more in, but accuracy and recall degrade as the window fills — context rot. A 1M-token window full of irrelevant text can give worse answers than a 200K-token window holding only what matters.

What happens when the window fills up? The oldest material drops out first in most chat apps, or the session is compacted into a summary. In the API, an input that already exceeds the window is rejected with an error; if generation reaches the limit mid-reply, it stops.

How many words is 1 million tokens? Roughly 750,000 English words — about ten novels. But tool results, images, code and thinking all consume tokens too, so a working session fills a window much faster than plain text would.

Does the model’s own reply use up the window? Yes. The output the model generates, including its extended thinking, counts toward the same window — which is why very long replies in very long conversations hit the limit first.

Sources

  • context window
  • explainer
  • LLM
  • tokens
  • context rot

Related articles

Guides

AI Hallucinations: Why Chatbots Make Things Up — and How to Catch Them

Chatbots invent books, misquote laws and state wrong dates in a perfect, confident tone. That behaviour is called hallucination, and it follows directly from how language models work. Why it happens, the forms it takes, and a working routine for catching it.

· hallucinations, chatbots, explainer, fact-checking, AI basics

Guides

How to Evaluate a New AI Tool Before You Trust It

New AI tools launch every week, and every launch claims to change everything. A practical checklist for testing a tool on your own real tasks before you pay, switch, or rely on it.

· AI tools, buying guide, productivity, how-to

Guides

How Does AI API Pricing Work? Token Pricing Explained in Plain English

AI models charge by the token, not by the question — and output tokens cost far more than input tokens. Here's how per-million-token pricing works, what caching and batch discounts do, and how to estimate a bill.

· AI API pricing, token pricing, AI costs, explainer, per million tokens