Last updated: July 2026
A context window is the maximum number of tokens a language model can consider at once. Everything in a single request shares it: the system prompt, your instructions, supplied context, the conversation so far, and the model's own output as it generates. When the window fills, the oldest content must be dropped or compacted.
Every large language model has a hard ceiling on how much text it can hold in mind at any moment. That ceiling — the context window — shapes what your prompts cost, how coherent long conversations stay, and why a coding agent can "forget" what it read ten steps ago. Here is what it is, how big it gets in 2026, and why filling it to the brim is usually the wrong move.
A context window is the maximum number of tokens a model can process in a single pass. A token is a chunk of text — roughly three-quarters of a word in English — and the model reads and writes in tokens, not characters. The window is the fixed-size workspace those tokens have to fit into.
Crucially, the window is shared by everything in the request. It is not just your prompt. It holds the instructions the application sends on your behalf, whatever context has been attached, the entire back-and-forth of the conversation up to this point, and the response the model is in the middle of producing. Input and output draw from the same budget. Once the total crosses the model's limit, something has to give — older turns get truncated, summarized, or dropped so the newest content still fits.
It helps to picture the window as a single buffer that gets assembled fresh for every request. In a simple chatbot the pieces are:
All of it is counted together. A long conversation eventually spends so much of the window on history that there is little room left for a substantive answer — which is exactly when quality starts to slip.
Windows have grown enormously. As of 2026, the headline numbers look like this:
| Model family | Context window |
|---|---|
| Claude models | 200K tokens (up to 1M in some configurations) |
| Gemini 2.5 | Up to 1M tokens |
| GPT-class models | Large windows (hundreds of thousands of tokens) |
To put a million tokens in perspective: that is roughly the length of several full-length novels, or a mid-sized codebase read in one gulp. It sounds like the ceiling has effectively disappeared. In practice, the ceiling is only half the story — how full you keep it matters far more than how high it goes, for reasons we get to below.
Nowhere does the context window matter more than in AI coding agents, because they fill it aggressively and refill it every single turn. A typical agent request packs in:
Here is the part that surprises people: all of this is re-sent on every turn. A 4,000-token file the agent read on step three rides along in steps four, five, six, and onward. The window does not remember — it is rebuilt from scratch each request, so early context is re-transmitted again and again. That is why a session that "felt short" can consume a startling number of tokens. Our breakdown of AI coding agent costs walks through how these per-turn re-sends dominate a real session, and this guide to reducing your Claude Code context window shows the same dynamic from inside one agent.
The instinct is to reach for the biggest window available and stuff it. Two problems undercut that.
The first is context rot. As the window fills, a model's ability to attend to any single piece of information tends to degrade. Details buried in the middle of a huge context get less attention than the same detail in a short one; the model can overlook instructions, mix up facts, or lose the thread. A precise answer sitting inside 900K tokens of noise is harder for the model to surface than the same answer in a tightly scoped 5K-token prompt. More context is not automatically more signal — often it is more distraction.
The second is cost. You pay per token, on input and output alike, and in an agent loop you pay for the same context repeatedly as it re-sends each turn. A bloated window on a frontier model multiplies the two most expensive variables at once. You can see the raw token math with our token calculator, which shows how quickly a padded prompt inflates before you ever hit send.
Put together: a smaller, cleaner context frequently beats a huge, messy one on both quality and price. The maximum window size is a ceiling, not a target.
Treating the context window as a resource to spend deliberately — rather than a bucket to fill — improves cost and answer quality at the same time. A few reliable habits:
That last point is where a light-touch tool helps. Terse flags redundant file reads and duplicate tool calls that waste your context window, and it tracks per-request token cost so the math stays visible — a small on-device nudge, not a heavy rewrite of how you work. The goal is not to fear the window but to keep it clean, so the model spends its attention on the tokens that matter.
Terse flags redundant file reads and duplicate tool calls that waste the window, compresses the prompts you send, and tracks per-request token cost — on-device, zero latency, no API calls.
Try TerseA context window is the maximum number of tokens a language model can consider at once. It holds everything in a single request: the system prompt, your instructions, any supplied context, the conversation so far, and the model's own output as it generates. Once the window is full, the oldest content has to be dropped or compacted.
In 2026, Claude models ship with a 200K-token window (up to 1M in some configurations), Gemini 2.5 offers up to 1M tokens, and GPT-class models provide large windows as well. Sizes keep growing, but a bigger maximum does not automatically mean better answers.
No. As a window fills, quality and attention can degrade — often called context rot — and every extra token raises cost and latency. A tightly scoped context on a smaller window frequently outperforms a bloated one on a huge window.
Compact or clear the conversation when it grows stale, scope each task to the few files that matter, avoid re-reading files the agent already has, and feed only the context a task needs. These habits improve both cost and answer quality at once.