Learn AI  /  Concepts  /  Context windows

EXPLAINER

Why your AI forgets — and how each one fakes remembering.

Claude chat, Claude Code and ChatGPT all sit on a model that remembers nothing. Six short animations show how each one works around that — no maths required.

September 2026 · 7 minute read · Simplified from a longer technical reference

1The model has no memory. None.

Here is the single fact that everything else follows from. A language model is a pure function: you hand it text, it hands you back the next likely word. Nothing about you survives between two requests. There is no session, no notebook, no "as we discussed".

So when an assistant says "as you mentioned earlier", it isn't remembering. It is re-reading — because your whole conversation was just sent to it again, from the first message onwards.

The model reading… all of it You the whole case file one reply forgot Turn 1 · pages in file: 2
The file gets thicker every turn. The model reads it fresh every time.
In plain terms. Picture a brilliant consultant with zero memory. Every question, you slide the entire case file under the door. He reads it from page one, writes one paragraph back, and forgets everything the moment you take the file away. The "relationship" is an illusion produced by the file getting thicker. The context window is simply the thickest file he can read in one sitting.

2The window is a budget, not a container

Text is counted in tokens — roughly three-quarters of a word each. But your messages are only one line-item. Everything the product quietly packs into the request counts against the same total, and the reply being written comes out of it too.

One request, one budget window edge → System prompt memory, rules Tool definitions before you type a word Your messages and every earlier reply Files, search, tool output usually the biggest slice The reply reserved up front A 40-page PDF you dropped in at turn 2 is still in the file at turn 30.
Everything in the request, plus the answer, shares one number.

3Every turn re-sends everything — caching makes that affordable

Nothing stays open on the server between turns. The app rebuilds the whole conversation and sends it again. Turn 3 contains turns 1 and 2 verbatim. That sounds wasteful, and it would be, except for one trick.

Prompt caching. If the start of this request is byte-for-byte identical to the start of the last one, the model reuses its earlier work on that part. The catch: it is a prefix match. Change one character near the top and everything below it is recomputed.

Turn 1 Turn 2 Turn 3 system + tools you: msg 1 system + tools you: msg 1 AI: reply 1 you: msg 2 ↑ identical prefix: cached system + tools you: msg 1 AI: reply 1 you: msg 2 AI: reply 2 you: msg 3 ↑ cached prefix Builders: stable content first. A timestamp at the top breaks the cache every turn.
Only the new lines cost full price — until one edit near the top resets it all.
In plain terms. A courtroom where the stenographer must read the entire transcript aloud before each new question. Caching is the judge saying "we all remember pages 1 to 400 from this morning — start at 401." But only if pages 1 to 400 are word for word what they were. Fix a typo on page 3 and the reading starts from the top.

4What happens when the file gets too thick

Eventually the conversation outgrows the window. Every product has to do something. There are really only three moves, and the products differ mainly in which they pick and whether they tell you.

Evict drop the oldest, silently turn 1: your constraint new message Cheap. Lossy. Silent. Claude chat · ChatGPT Compact rewrite history as a summary summary of everything so far new message Extra model call. Announced. Claude Code · API Working set index on the desk, fetch the rest desk index: cabinet folder Survives closing the chat. memory files · past-chat search
Evict, compact, or keep an index and fetch. Every product is a mix of these.
The one pattern worth stealing. Your desk holds six open folders. Behind you is a cabinet with four hundred. You don't try to fit the cabinet on the desk — you tape a one-page index to it and pull a folder when a meeting needs it. The desk is the window and it is exactly as big today as yesterday, no matter how full the cabinet gets. When a client says "the assistant must remember our whole account history," they think they need a bigger desk. They need a cabinet and an index.

5Sub-agents: let someone else read the thick file

Research is expensive in tokens and cheap in conclusions. You might read 6,000 tokens of source to produce a 400-token finding. Keeping the 6,000 in your window afterwards is pure cost.

So Claude Code hands the reading to a sub-agent with its own fresh window. It reads whatever it needs, and only its final answer comes back to you. The general rule: isolate any step whose inputs are far bigger than its outputs.

Your window stays clear for the actual decision Sub-agent window reads 6 files, greps, runs the tests… one clear instruction 1-page note finding (400 tokens) You get the summary, not the raw understanding — scope the instruction well.
Big reading happens elsewhere. Only the conclusion comes home.

6Same physics, three different contracts

Strip away the branding and all three products face one constraint: a fixed window over a function with no memory. They differ on one axis that matters to you — whether they tell you when something was dropped.

Claude chatClaude CodeChatGPT
When the window fillsOldest turns quietly leaveHistory replaced by a summary; project files reloaded from diskOldest turns dropped or condensed
Are you told?NoYes — visible compaction, /context breakdownNo
Across sessionsMemory files, past-chat search, projectsCLAUDE.md, MEMORY.md, rules, skills — re-read from diskSaved memories, chat-history insights, project memory
Biggest token hogUploaded docs and long generated artifactsFile reads and tool outputPasted content and long threads
Effective windowThe model's full window200K by default, 1M on supported modelsTiered by plan and mode — well below the API window

ChatGPT's consumer design favours uninterrupted flow: the thread never refuses to continue, it quietly truncates and carries on. Claude Code favours legibility: you are interrupted, but you know exactly what happened. Neither is wrong. Which is right depends on whether the user wants a conversation or a controllable system.

One governance point for regulated teams: in ChatGPT, deleting a chat does not delete memories derived from it. A fact extracted from a conversation can outlive it and surface in an unrelated future chat. That is a data-flow decision to make before rollout, not after an incident.

Bigger is not better

A one-million-token window is not the end of the problem. As the window fills, recall degrades — Anthropic calls this context rot. Material at the very start and very end of a long prompt is remembered best; things buried in the middle are weakest. A big window full of noise underperforms a small one kept clean. That is why curating what goes in matters at least as much as how much room there is.

The playbook

Simplified from a longer technical reference verified against Anthropic's context-window, caching, compaction and sub-agent documentation in September 2026. ChatGPT's internal truncation behaviour is not published by OpenAI and is described here from observed behaviour; its window sizes change by plan and mode.

xploreai builds WhatsApp bots, booking automation and lead-gen AI for clinics, real-estate firms, schools and hotels in Mumbai — most of it on exactly the working-set pattern above.

Talk to us