If you use a chat assistant or a coding agent for hours, you have seen it get slower, more expensive and more forgetful. The reason is the context window: the text the model reads on every turn, with a fixed size. Treat it like a suitcase. Every drawing here uses the unit of the Claude Code anatomy page: 1 dot is 500 tokens, and a window of 200,000 tokens holds 400 dots. Numbers are illustrative.
01 · The rule
Everything in the conversation is read again on every turn.
A model has no memory between turns. To answer your eighth message, it reads the instructions, all seven earlier turns, every file and every tool result again, then your new line. That is why a log you pasted an hour ago still slows down a question about something else.
Follow one invented chat about a failing build. Each column is what the model reads to answer one message. What sits in the window at one single moment is drawn in fig. 2 of What happens when you press Enter; this drawing adds time.
The chat, one message per turn
- 1 The build fails. Can you look?
- 2 Here is the full build log. +35,000 tokens
- 3 Is it the date library?
- 4 Try the older version.
- 5 Same error. What now?
- 6 Rename the setting, then.
- 7 It builds. Do the tests pass?
- 8 Write the commit message.
What the model reads to answer each message, to scale
- Setup: instructions and tools, 20,000
- Each earlier turn: your message and the answer, 1,000
- The log, 35,000
- Your new line on top, about 100
1 dot = 500 tokens; a smaller dot is the part left over.
Over 8 turns the model reads 433,800 tokens. The log alone: 245,000, read 7 times.
Show as text
| Turn | Your message | The model reads, full log pasted | The model reads, last 50 lines pasted |
|---|---|---|---|
| 1 | The build fails. Can you look? | 20,100 | 20,100 |
| 2 | Here is the full build log. (or: Here are the last 50 lines of the log.) | 56,100 | 22,300 |
| 3 | Is it the date library? | 57,100 | 23,300 |
| 4 | Try the older version. | 58,100 | 24,300 |
| 5 | Same error. What now? | 59,100 | 25,300 |
| 6 | Rename the setting, then. | 60,100 | 26,300 |
| 7 | It builds. Do the tests pass? | 61,100 | 27,300 |
| 8 | Write the commit message. | 62,100 | 28,300 |
| All | Read in all over 8 turns | 433,800, of which the log 245,000 | 197,200, of which the log 8,400 |
A big paste does not cost you once. It costs you on every message after it.
02 · Over time
A long session fills from the bottom up.
Drag through an invented three-hour session with a coding agent. Every half hour adds what was said, the files it read and the output of the commands it ran. Nothing leaves on its own: new material lands on top of the old. How big your own documents are next to one window is drawn in fig. 1 of Do you need a vector database?
The session so far
3 hours in
- 57 messages from you
- 24 files read
- 26 commands run
One context window, from the bottom
192,000 of 200,000 tokens (96%)
Nearly full. The next big file or log will not fit: fig. 3 shows what happens then.
1 dot = 500 tokens; the window holds 400. The pale dots are room still free.
What is in it
- Files read70,000
- Tool and command output60,000
- The chat: your messages and the answers42,000
- Setup: instructions and built-in tools20,000
Show as text
| Time | Setup | Chat | Files read | Tool output | In the window | What had happened |
|---|---|---|---|---|---|---|
| First message | 20,000 | 500 | 0 | 0 | 20,500 (10%) | 1 messages, 0 files read, 0 commands run |
| Half an hour in | 20,000 | 8,500 | 26,000 | 12,000 | 66,500 (33%) | 13 messages, 9 files read, 5 commands run |
| 1 hour in | 20,000 | 18,000 | 52,000 | 30,000 | 120,000 (60%) | 25 messages, 18 files read, 11 commands run |
| 1.5 hours in | 20,000 | 24,000 | 58,000 | 40,000 | 142,000 (71%) | 33 messages, 20 files read, 16 commands run |
| 2 hours in | 20,000 | 30,000 | 62,000 | 48,000 | 160,000 (80%) | 41 messages, 22 files read, 20 commands run |
| 2.5 hours in | 20,000 | 36,000 | 66,000 | 54,000 | 176,000 (88%) | 49 messages, 23 files read, 23 commands run |
| 3 hours in | 20,000 | 42,000 | 70,000 | 60,000 | 192,000 (96%) | 57 messages, 24 files read, 26 commands run |
Files and tool output, not the chat itself, are what fill the window.
03 · Your turn
Pack the suitcase.
Each item comes in a heavy and a light version, and everything starts heavy. Swap items and watch the window. The limit is 200,000 tokens. Over it, nothing warns you: the tool squeezes the oldest part of the chat into a summary it writes itself, and the details are gone.
Your packing list
- Instructions and built-in tools20,000always packed
Drawn with every item heavy. With JavaScript on, you can pack it yourself.
The window, packed from the bottom
151,000 of 200,000 tokens
You packed 220,000: 20,000 over the limit. The tool squeezed the oldest part into a summary of its own.
1 dot = 500 tokens; a smaller dot is the part left over. The pale dots are room still free.
Lost without asking: 69,000 tokens of detail from the three earlier tasks. The tool kept a 1,000-token summary and chose what is in it.
Show as text
| Item | Heavy version | Light version |
|---|---|---|
| Setup | Instructions and built-in tools: 20,000 tokens, always packed | |
| Connected tools | All 60 connected tools described: 25,000 | Only the 8 tools this task needs: 3,500 |
| Earlier work | Three earlier tasks in the same chat: 70,000 | A short summary of earlier work, written by you: 800 |
| The code | The whole 3,000-line file: 40,000 | Only the function you are changing: 1,500 |
| The log | The full build log: 35,000 | The last 50 lines of the log: 1,200 |
| The error | Screenshots of every step: 30,000 | The error message, copied as text: 200 |
The window is packed in this order, oldest at the bottom. Everything heavy adds up to 220,000 tokens, 20,000 over the limit of 200,000. The tool then squeezes the oldest part of the chat, the three earlier tasks, into a 1,000-token summary it writes itself: 69,000 tokens of detail are lost and 151,000 stay. Swapping any one item for its light version keeps the total under the limit, so nothing is squeezed; with only the connected tools light it is 198,500, nearly full. Everything light is 27,200 tokens, leaving 172,800 to think and answer.
The light version of almost everything is good enough, and leaves room to think.
04 · Four moves
Select less, shrink it, hand it off, fetch on demand.
Each move sends a small part instead of a big pile, and the tokens it saves are saved again on every later turn (fig. 1). Handing work to a helper is drawn in full in fig. 5 of What happens when you press Enter.
-
1Select less
Point at the function you are changing, not the whole file.
The whole 3,000-line file, 40,000
Only the function you are changing, 1,500All of it, 40,000
-
2Shrink it
Copy the error message instead of a screenshot of every step.
Screenshots of every step, 30,000
The error message, copied as text, 200All of it, 30,000
-
3Hand it off
A helper searches 30 files in its own window and sends back a short note.
In the helper's own window: Read in your own chat: 30 files searched for date formats, 45,000
The helper's note, 400All of it, 45,000
-
4Fetch on demand
Leave the manual out until a question needs it, then look up those pages.
On the shelf, not in the window: Loaded just in case: The library manual, 120 pages, 60,000
A question comes in: "How do I set the time zone?"
The two pages the question needs, 1,000All of it, 60,000
What goes into the window
23,100 of 200,000 tokens
176,900 left to think and answer.
1 dot = 500 tokens, in the piles and in the window; a smaller dot is the part left over.
Show as text
| Move | Sent whole | With the move | Saved, on this turn and every turn after |
|---|---|---|---|
| Select less: Point at the function you are changing, not the whole file. | The whole 3,000-line file: 40,000 | Only the function you are changing: 1,500 | 38,500 |
| Shrink it: Copy the error message instead of a screenshot of every step. | Screenshots of every step: 30,000 | The error message, copied as text: 200 | 29,800 |
| Hand it off: A helper searches 30 files in its own window and sends back a short note. | 30 files searched for date formats: 45,000 | The helper's note: 400 | 44,600 |
| Fetch on demand: Leave the manual out until a question needs it, then look up those pages. | The library manual, 120 pages: 60,000 | The two pages the question needs: 1,000 | 59,000 |
| In the window, with the setup of 20,000 | 195,000 of 200,000 | 23,100 of 200,000 | 171,900 |
These four habits matter more than which model you pick.