Context windows and long chats

How much a model can keep in view at once, what really happens in a long chat, the signs that it is losing track, and practical ways to keep long work on course.

Beginner8 min readUpdated November 29, 2026

What a context window is

A model does not have a running memory of your conversation the way a person does. Each time you send a message, the app sends the model a bundle of text: its standing instructions, your earlier messages, its earlier replies, any files or pasted material, and your new message. The model reads that bundle and writes the next reply.

The context window is the maximum size of that bundle, counted in tokens, the small text pieces covered in the previous lesson. Everything the model can take into account for a reply has to fit inside it. Anything outside it, the model simply does not see.

Different models have very different window sizes, and model makers change them over time. OpenAI's help center, for example, tells developers to check each model's documentation for its context window and maximum output, because they differ between models. The useful takeaway is not a number. It is that there is always a limit, and long work eventually runs into it.

Why there is a limit at all

It is fair to ask why models cannot simply read everything. The short answer is cost and speed. The more text a model takes into account for each reply, the more computing work each reply needs, and the slower and more expensive it gets. Model makers have pushed windows much larger over the years, but every model still draws a line somewhere.

There is also a quality reason. A huge window full of loosely related material gives the model more chances to latch onto the wrong detail. A short, focused context with exactly the right material often beats a giant one. That is why the habits below help even when you are nowhere near the limit.

What counts toward it

  • Your messages, including everything you pasted.
  • The model's replies. Long replies fill the window as fast as long prompts.
  • Uploaded files, or the parts of them the app passes to the model.
  • Standing instructions, such as custom instructions in ChatGPT or a CLAUDE.md file in Claude Code.
  • Tool results, such as web pages fetched by a search tool.
  • Hidden working, for models that reason before answering.

So a chat that feels short to you, a few questions about a long PDF, can be very large from the model's point of view.

What happens in long chats

When a conversation grows past what fits, the app has to do something. Different apps handle this differently, and they do not always tell you which method they use. Common approaches:

  • Dropping the oldest messages. The start of the conversation quietly falls out of view.
  • Summarizing earlier parts. The app compresses old messages into a shorter summary, which keeps the gist and loses detail. Anthropic's Claude Code docs, for example, describe a compaction step and say instructions given only in conversation may not survive it, which is why they recommend putting lasting instructions in a CLAUDE.md file.
  • Refusing or warning. Some tools tell you the conversation or file is too long.

Even before the limit, very long contexts can be harder for a model to use well. Details in the middle of a long document or a long chat are more likely to be missed than details at the start or the end. Models have improved a lot here, but it is still sensible to put the most important instructions where they are easy to find.

Signs you are running into it

  • It forgets an early instruction. You said "always use metric units" at the start, and now it is using inches.
  • It loses track of decisions. It suggests an option you already rejected, or reintroduces a paragraph you deleted.
  • It mixes up versions. Details from an old draft appear in the new one.
  • It contradicts itself about things settled earlier in the chat.
  • Answers about a long document get vaguer, or ignore sections you know are there.

None of these prove the window is full. They can also happen when a chat simply has too many conflicting instructions. Either way, the fixes are similar.

What to do about it

  • Start a new chat for a new task. One topic per chat keeps the context focused and short.
  • Restate key rules. In a long session, repeat the instructions that matter most, briefly, every so often.
  • Ask for a handover summary. Before starting fresh, ask the model to summarize the decisions so far, then paste that summary into a new chat.
  • Use standing instructions for things that never change. Your role, your style preferences and project rules belong in the tool's custom instructions or project file, not repeated in every message.
  • Feed long documents in pieces, or ask questions about one section at a time.
  • Put important instructions at the start and repeat them at the end of long prompts.

Worked example: a clean handover

You have spent an hour planning a trip with an assistant. The chat is long, and it has started suggesting a hotel you ruled out. Ask for a handover:

Handover prompt
Summarize everything we've decided so far for this trip as a short brief I can paste into a new chat: dates, budget, places we chose, places we ruled out and why, and open questions. Use bullet points. Don't add anything we haven't agreed.

Read the summary and correct anything wrong. Then open a new chat:

New chat prompt
Here is the brief for a trip I'm planning. Use it as the starting point and don't suggest anything listed under "ruled out". Next, help me choose between the two remaining hotels. [paste brief]

The new chat starts small and clear, with only what matters. This is usually faster than trying to steer a long, tangled one back on course.

Long documents

Working with a long document is where windows matter most. A few patterns help.

  • Ask about sections. "Using only section 3, what are the payment terms?" is more reliable than a broad question about the whole document.
  • Ask for quotes. "Quote the sentence you are relying on." If it cannot quote one, that is a warning sign.
  • Summarize in stages, section by section, then combine the summaries, as shown in the tokens lesson.
  • Check coverage. "List the headings of every section you can see" is a quick way to find out whether the whole document actually made it in.

Context in coding tools and agents

Context windows matter even more for tools that work on their own for a while, like coding assistants and agents. Every file they open, every command output they read and every step they take adds to the context. On a large project, they can fill a window quickly.

Anthropic's Claude Code docs say each session starts with a fresh context window and that CLAUDE.md files and an auto memory feature carry knowledge between sessions. They also recommend keeping CLAUDE.md files concise, targeting under 200 lines, because longer files take up more context and are followed less consistently. The general lesson applies to any tool: standing instructions should be short and specific, and big jobs go better split into smaller tasks, each with a focused context.

Common mistakes

  • Using one chat for everything. A single chat used for weeks of unrelated questions is a recipe for confused answers. One task, one chat.
  • Pasting the whole thing "just in case". More material is not always better. Paste what the question needs.
  • Assuming the start of the chat still counts. In a long session, the instructions you gave at the beginning may be summarized or dropped. Repeat what matters.
  • Blaming the model for forgetting what it never saw. If a file was too long to be passed in full, the model may honestly not have seen the part you are asking about. Check coverage first.

Memory features are different

Some assistants have memory features that carry information between chats. ChatGPT's help center, for example, describes saved memories and the option to reference chat history. These are not the same as a bigger context window. They work by storing selected notes and feeding relevant ones back in as text, which means they also take up space in the window when used, and they do not keep every detail. The ChatGPT track on this site has a lesson on how those features work and how to manage them.

Try it

  1. In a new chat, give an assistant one clear rule, such as "always answer in exactly three bullet points".
  2. Have a long conversation on a single topic, including a couple of long pasted texts.
  3. Notice whether and when it stops following the rule.
  4. Then ask for a handover summary, start a new chat with it and the rule, and compare how well it follows the rule now.

Questions people ask

Does a bigger context window mean a better model?

Not by itself. A big window lets a model take in more text at once, which helps with long documents. How well it uses that text, and how good its answers are, are separate questions.

Why does it remember things from another chat?

If your assistant has a memory feature switched on, it may bring in saved notes or relevant past chats. That is a product feature layered on top of the model, and you can usually review or turn it off in the settings.

Can I see how full the window is?

Some tools show this, especially developer tools. Most chat apps do not. When in doubt, start a new chat for each new task.

Sources: OpenAI Help Center: Understanding and counting tokens · OpenAI Help Center: Memory in ChatGPT · Claude Code docs: How Claude remembers your project