What is a context window: 3 ways AI chat memory is limited

What is a context window? It is an AI model working memory, measured in tokens. See 3 ways AI chat memory is limited and what to do when it fills.

16/11/2026 · 8 min read
What is a context window: 3 ways AI chat memory is limited
In this article (6)
  1. What is a context window
  2. 3 ways AI chat memory is limited
  3. What to do when the window fills up
  4. When a large window really matters
  5. Conclusion
  6. Sources

What is a context window? It is all the text an AI model can see when it answers you, measured in tokens. The longer you chat, the fuller the window gets, and when it fills up, the model starts to forget the start of the conversation.

What is a context window

Close-up of hands typing on a laptop with a messaging app at home, illustrating a context window in an AI chat
A person chats with a chatbot on a laptop, the scene where a context window does its work. Photo: Mikhail Nilov, Pexels 8937900.

Anthropic's docs define the context window as all the text a language model can reference when it generates a response, including the response itself. The docs call it the model's working memory. It is not the huge corpus the model learned from during training. Picture it as a desk. You can only fit so many papers on it, and to add a new document you must clear an old one away.

The window is measured in tokens, not words or characters. Each turn sends the whole conversation history plus the new message to the model in one request. The model reads that whole request again every time it answers. A long conversation does not just cost tokens with each turn, it also fills the window bit by bit.

Window sizes differ by model. Anthropic's docs list a 1M-token window for current Claude models, and a 200,000-token window for some other Claude models. OpenAI's Models page lists a 1.05M-token window for all four models, GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, and GPT-6 Luna. Both vendors cap a single response at 128,000 tokens. That figure is the ceiling for one request, not space you will always use up.

One point to remember is that a chat app window can differ from the API window, because the app manages history on a rolling basis, with the oldest message leaving first. Anthropic's docs note that chat interfaces such as claude.ai manage the window on a first in, first out basis. You never see the number on screen, but you feel it when the model asks again about something you said at the start of the chat.

The system prompt also sits inside this window. If the word prompt is new to you, read what a prompt is first. For an agent that runs many steps, the window matters even more, because each tool call inserts its result into the window. You can read about Hermes Agent to see how an agent uses the window across a long chain of tasks.

3 ways AI chat memory is limited

A businessman reviews a stack of papers at a desk, illustrating a context window filling up turn by turn
A person reviews a stack of papers, much like a model rereading the whole window each turn. Photo: Kaboompics, Pexels 7877191.

AI chat memory is limited in these three ways.

Way 1: the window has a ceiling, and input and output share one budget

A window of 1M or 1.05M tokens sounds large, but it is one budget shared by input and output. The conversation history, the new message, and the answer about to be written all squeeze into the same space. The 128,000-token cap on a single response sits inside that budget, not on top of it.

Anthropic's docs say a single request can hold up to 600 images or PDF pages, while models with a 200,000-token window stop at 100 images or PDF pages. Send many images or large documents and you may hit the request size limit before you hit the token limit. Keep that figure in mind when you work with a long scanned document or a set of screenshots.

ModelContext windowMax single response
Current Claude models1M tokens128,000 tokens
GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna1.05M tokens128,000 tokens

Way 2: everything counts toward the window

Anthropic's docs say everything in the request counts toward the window. The system prompt, every message in the history, tool results, images, attached documents, and even the tool definitions all take space. The answer the model just wrote, including its thinking, counts too. Each new turn sends the old part along once more.

So the window fills faster than you expect. A long chat with many images and many tool calls can fill 1M tokens without you noticing. Anthropic's docs also note that prompt caching changes what you pay for those tokens, not whether they count. You pay less for the repeated part when you use a cache, but that part still takes the same space.

A bigger window is not automatically better. Anthropic's docs say that as token count grows, accuracy and recall degrade, a pattern called context rot. The more you stuff into the window, the easier it is for the model to miss a key detail in the middle. Curating what goes into the window matters as much as how much space you have.

Way 3: when it fills up, the conversation gets cut

When the input alone already exceeds the window, Anthropic's API returns a 400 error that says the prompt is too long. You get no answer, only the error. On Claude 4.5 models and newer, if the input plus the max tokens allowed exceeds the window, the request is still accepted, but generation stops midway with the reason model_context_window_exceeded. You see the answer stop suddenly, with no closing line.

In a chat app, you usually see no error code. The app rolls the window on a first in, first out basis, so the oldest messages leave first. The model still answers smoothly, but it no longer remembers what you said at the start. The clearest sign is the model asking again for facts you already gave, or repeating a request you set earlier.

Anthropic offers two ways to keep a long conversation going past the limit. The first is server-side compaction, which sums up the earlier part of the conversation on the server so the chat can continue past the window limit. The second is context editing, which clears old tool results and thinking blocks from earlier turns. Both trade a slice of memory for fresh space, so you should still check the summary before you trust it.

What to do when the window fills up

A young man reads documents on a couch in an office, illustrating the moment a context window is full
Reading a long document on a sofa, the moment you decide what stays in the window. Photo: cottonbro studio, Pexels 8453934.

The simplest fix is to start a fresh chat with a short summary. Ask the model to sum up the key decisions and facts from the old chat in a few lines, then paste that summary into a new chat. You keep the conclusions and drop the back-and-forth in the middle. The shorter the summary, the more free space the new chat has to work with.

You should also keep the system prompt short. It rides along with every request, so each extra word in it takes space in every turn. Write the model's role and rules in a few lines, and do not paste a whole document into the system prompt. A long document belongs in a message when you need it, not in the fixed opening part.

Before you send a long document, estimate the tokens first. Anthropic's docs suggest the token counting API to estimate usage before you send a message. Check before you paste a long document into the chat box, instead of finding out after the window is full. This habit helps you avoid the prompt is too long error from the start.

Do not paste a whole document when you need only one part. Quote the passage that matters, or sum up the document first and then bring it into the chat. For audio, you can turn speech into text on your own machine with Faster Whisper, then bring only the text you need into the chat. The less spare material you put in the window, the more the model can focus on the job you need.

When a large window really matters

A senior man reads documents in a cozy library, illustrating work that needs a large context window
Reading long documents in a library, the job a large window is built for. Photo: Tima Miroshnichenko, Pexels 9572666.

A large window earns its keep when you work with long documents, a large codebase, or a multi-step agent workflow. The model needs to see the whole contract, the whole source tree, or the whole work history to answer well. You cannot chop these jobs into pieces at will, because chopping breaks the links between the parts. When you read a long contract, the model must see the clause at the start and the clause at the end at the same time.

For short questions, a 1M-token window adds nothing. You ask one question, get one answer, and the window uses only a small slice. Paying for a large window there means paying for empty space you never use. Pick the plan and the model by the length of the work you usually do, not by the biggest number on the spec sheet.

Pick the model by the job, not by the biggest number. Read the vendor docs to learn each model's window, then match it against the length of the documents you usually handle. If you often work with Gemini models, read what Gemini 3 is to see which jobs that model fits and how its window serves them.

In the end, a large window is only a starting point. Anthropic's docs note that curating what sits in context matters as much as how much space you have. Put in exactly what the model needs and drop what is out of date, and a 200,000-token window covers plenty of jobs. Stuff everything into a 1M-token window and the model can still miss the main point in the middle.

Conclusion

What is a context window? It is an AI model's working memory, measured in tokens and capped at a clear ceiling. Everything in the conversation draws on the same budget, and when the budget runs out the model forgets the start of the chat or stops midway. You do not need the biggest window for every job, you need a window that stays tidy and holds what the model must remember. Once you know these three ways, you will know when to sum up, when to start a fresh chat, and when to pick a model with a larger window.

Sources (7)

Linh SEO Agent

Related guide: What is an AI API key: 4 ways to protect your billing

Related guide: Prompt Caching Claude OpenAI: 4 steps to cut 80% API cost

The complete guide for this topic: Free Google AI Tools Worth Knowing in 2026

Found it useful? Share it:
Facebook

More reading

Latest news

The ten most recent, scrolling sideways. Hover or tap to pause.