What is a context window?
A context window is how much text a model can look at while producing its next output. Everything the model uses has to fit inside it: the system prompt, any files or search results supplied, the entire conversation so far, and the answer being generated. Once it is full, something has to go.
Tokens, not words
Context is measured in tokens, and a token is not a word. It is a fragment of text produced by the tokenizer, averaging about four characters in English, so 1,000 tokens is roughly 750 words.
The distribution is uneven in ways that matter for cost. Common English words are usually a single token. Rare words, proper nouns and technical terms split into several. Code tokenizes less efficiently than prose because of punctuation and indentation. Languages that do not use the Latin alphabet often need two to three times as many tokens for the same content, which means the same question costs more to ask in Russian or Japanese than in English.
The window covers everything, and it is not memory
Two misconceptions cause most of the confusion.
The first is thinking the window applies only to what you type. It applies to the whole working set. In a coding session the files supplied, the tool results returned, the model’s own previous answers and the system prompt all consume the same budget. A 200,000-token window with 150,000 tokens of codebase in it has 50,000 tokens left for everything else.
The second is thinking of context as memory. It is not. When a conversation ends the window is discarded and nothing carries over. Products that appear to remember you across sessions are storing notes separately and re-inserting them into the window at the start of the next conversation. The model is not recalling; it is being re-told.
What running out actually looks like
When the conversation exceeds the window, the software in front of the model has to make room, usually by summarizing or dropping the oldest turns.
The failure is quiet. The model does not announce that it has lost the first half of the discussion. It keeps answering in the same confident register while no longer holding the constraint you set forty messages ago. In long sessions the characteristic symptom is a model contradicting an instruction it followed earlier, or re-suggesting an approach that was already rejected.
Accuracy also degrades before the hard limit. Retrieval from a long context is not uniform: material near the beginning and the end is used more reliably than material in the middle. A window advertised at a million tokens does not deliver a million tokens of equally usable attention, which is why filling it is rarely the right move.
Why this is the main cost driver for agents
Here is the part that shows up on invoices.
A conversational exchange sends the history once per turn. An agent run is different: at every step, the harness resends the whole accumulated conversation, including all previous tool calls and their results, so that the model can decide what to do next. One benchmark analysis in 2026 found this meant a single task was effectively billed about fifteen times, because the history was retransmitted at each step.
That is why agent costs scale with the square of a task’s length rather than with its length. It is also why prompt-shortening tricks give smaller savings than people expect. A test of one such technique against 86 real agentic coding tasks measured only 8.5 percent savings, because agent runs are dominated by tool calls and resent history rather than by the wording of the original instruction.
Output length feeds the same loop, since every verbose answer becomes input on the next step. When r/ClaudeAI turned on Opus 5 over how much it wrote, the complaint was about readability, but the billing consequence was real: a technique for forcing terser output cut chat output by about 65 percent.
The practical rules that follow are unglamorous. Start a new conversation when the topic changes rather than continuing a long one. Supply the three files that matter instead of the whole repository. Ask for short answers in agent loops. None of that is about the model’s capability, and all of it is about what the window is holding.
Related coverage
- An unnamed model on OpenRouter outscored Claude and GPT on code, the top of the range in August 2026.
- Caveman prompting cuts Claude chat output by 65 percent, output length as a cost lever.
- r/ClaudeAI turned on Opus 5 over how much it writes, when verbosity becomes the product problem.
- Researchers decrypted 315,320 hidden reasoning blocks, what else is consuming the window.
- AI model names in 2026, explained, which models offer which windows.
- What is RAG?, the standard way to avoid filling the window in the first place.
Quick answers
What is a token?
A token is the unit a model reads and writes, roughly a word fragment. In English one token averages about four characters, so 1,000 tokens is around 750 words. Common words are usually one token, rare words and names split into several, and code and non-Latin scripts tokenize less efficiently, which is why the same page of text costs more in some languages than others.
How big are context windows in 2026?
They range from tens of thousands of tokens to over a million. A model listed as Ox Alpha appeared on OpenRouter in August 2026 with a 1,048,576-token window, which is 2 to the power of 20, and million-token windows are now offered by several frontier providers. The practical limit is usually cost and accuracy rather than the advertised ceiling.
What happens when you run out of context?
The system has to drop something. Assistants typically summarize or truncate the earliest parts of the conversation, which is why a long chat starts forgetting what you agreed at the beginning while still sounding confident. Nothing warns you at the moment it happens, so the usual symptom is the model quietly contradicting an earlier instruction.
Does a bigger context window mean better answers?
No. Accuracy degrades well before the advertised limit, and models retrieve information from the beginning and end of a long context more reliably than from the middle. Filling a window with everything you have usually produces worse answers than supplying the few thousand tokens that actually bear on the question.