What is a context window?
Everything a model can see at once while it writes an answer, counted in tokens. When the window is full, something has to be left out.
beginner · Also called Context Length
A model has no memory of you between messages. Each time it answers, it reads one long piece of text from the top: the instructions from whoever built the app, the conversation so far, any files you attached, and the results of any tools it used. That piece of text is the context, and the most it can hold is the context window.
The window is measured in tokensTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens., the pieces of words a model reads. For Claude a token is about 3.5 characters of English, so 1,000 tokens is about 3,500 characters, a page or two of a paperback. The largest Claude models hold 1 million tokens. Other makers publish their own limits on their model pages.
What happens when it fills up
Something has to go. A chat app may quietly drop or summarise the oldest messages, which is why a long conversation can "forget" a detail you gave it at the start. An agent that works for a long time does this on purpose. Compaction replaces older turns with a summary. Context editing clears out old tool results that are no longer needed. What must last goes outside the window, into files or a memory tool the model can read back later.
- App instructions
- Turn 1, with the flight date
- Later turns
Out of view
- Turn 1: “My flight is on 12 March”
Input tokens sent so far
27,200
over 5 turns
1 turn has left the window. 5 turns have sent 27,200 input tokens in all, because every turn sends the whole context again.
The chat and its sizes are made up, and the windows are shrunk so they fill in a few clicks: the largest Claude models hold 1 million tokens. Summarising old turns is what agents call compaction.
Bigger is not automatically better
A model does not read a full window as well as a short one. As the token count grows, accuracy and recall get worse. Anthropic calls this context rot. A long document can hold the answer and the model can still miss it, so a short, relevant context usually beats a long, complete one.
Why it shows up on your bill
Every turn sends the whole context again. Anthropic's example is a task that grows from 20,000 to 120,000 tokens over 40 turns: the conversation never passes 120,000, but the bill counts about 2.8 million input tokens. Caching makes the repeated part cheaper to read. It does not make the window any less full.
What to do with this
Start a new chat when you change subject. Paste the part of a document that matters, not the whole folder. And when an answer ignores something you said long ago, assume it fell out of view before you assume the model is careless.
Sources