Context windows: how much an AI can “remember”
A context window is all the text a model can read at once. What counts toward it, why long chats get worse and cost more, and what happens when it fills up.
2 min readPart 10 of 21
On this page
A language model keeps nothing between one answer and the next. When it seems to remember what you said ten messages ago, that's because the app sent those ten messages again. The context window is how much text can be sent and answered at once, counted in tokens.
Anthropic's documentation calls it the model's working memory, as distinct from the body of text it was trained on.
What's in the window
More than the conversation on your screen:
You see
Your messages
The answers
Also in the window
System instructions
Tool descriptions and their results
Files and images
Memories about you
Room for the next answer
Why long chats cost more
Each message makes the model read everything before it. If each turn adds 400 tokens, the tenth turn reads 4,000 and the hundredth reads 40,000. The total grows with the square of the length:
Ten turns come to 22,000 tokens in all and a hundred to about 2 million. It's why a usage limit that lasted all morning runs out quickly in one very long chat.
Why long chats get worse
Text being in the window doesn't mean it gets used well.
The 2023 paper Lost in the Middle gave models many documents, only one of which held the answer, and moved it around. Performance was often highest when it was at the beginning or the end, and fell significantly when it was in the middle, even in models designed for long text.
In July 2025 Chroma tested 18 models, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3, on tasks kept equally simple while the input grew. Their results grew increasingly unreliable with length. The report's name for it, context rot, has caught on. It also notes that the popular "needle in a haystack" test, finding one planted sentence in a long text, makes models look better than they are in real use, because the sentence often shares its wording with the question.
In a long chat there's also more to be misled by: abandoned ideas, corrected mistakes and earlier versions all stay in the text with the same standing as your latest decision.
When it's full
- 1RefuseReport that the limit has been reached
- 2DropRemove the oldest messages
- 3SummarizeReplace earlier messages with a summary
Anthropic's documentation notes that chat interfaces such as claude.ai can manage the window on a rolling "first in, first out" basis. Dropping and summarizing both explain a familiar moment: the assistant forgets a rule you set at the start.
Working with the limit
- Start a new chat for a new task. It's cheaper, faster and more accurate.
- Restart a chat that's going wrong. Ask for a summary of what's been decided, check it, and paste it into a new one.
- Put what matters at the beginning or end, not between two long documents.
- Send the relevant part of a document where you can, not all of it.
- Repeat rules that matter in a long chat.
Memory features that carry information between chats are something else. They store notes outside the model and add them to the window; see Does ChatGPT remember you?