Lab / Explainer / 4 moves

No. 08Explainer6 min

What fills the window

The context window as a suitcase: what takes space in a long session, what happens when it is full, and four ways to pack lighter.

Short version

Everything in a conversation is read again on every turn. Long sessions fill up with files, logs and tool results until old parts get summarised. Select less, shrink it, hand work off, and fetch on demand.

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. 1 The build fails. Can you look?
  2. 2 Here is the full build log. +35,000 tokens
  3. 3 Is it the date library?
  4. 4 Try the older version.
  5. 5 Same error. What now?
  6. 6 Rename the setting, then.
  7. 7 It builds. Do the tests pass?
  8. 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
TurnYour messageThe model reads, full log pastedThe model reads, last 50 lines pasted
1The build fails. Can you look?20,10020,100
2Here is the full build log. (or: Here are the last 50 lines of the log.)56,10022,300
3Is it the date library?57,10023,300
4Try the older version.58,10024,300
5Same error. What now?59,10025,300
6Rename the setting, then.60,10026,300
7It builds. Do the tests pass?61,10027,300
8Write the commit message.62,10028,300
AllRead in all over 8 turns433,800, of which the log 245,000197,200, of which the log 8,400
fig. 1 Each column is what the model reads to answer one message. What you paste once is read again on every turn after it: the full log is read 7 times in all, 245,000 tokens, more than a whole window.

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
TimeSetupChatFiles readTool outputIn the windowWhat had happened
First message20,0005000020,500 (10%)1 messages, 0 files read, 0 commands run
Half an hour in20,0008,50026,00012,00066,500 (33%)13 messages, 9 files read, 5 commands run
1 hour in20,00018,00052,00030,000120,000 (60%)25 messages, 18 files read, 11 commands run
1.5 hours in20,00024,00058,00040,000142,000 (71%)33 messages, 20 files read, 16 commands run
2 hours in20,00030,00062,00048,000160,000 (80%)41 messages, 22 files read, 20 commands run
2.5 hours in20,00036,00066,00054,000176,000 (88%)49 messages, 23 files read, 23 commands run
3 hours in20,00042,00070,00060,000192,000 (96%)57 messages, 24 files read, 26 commands run
fig. 2 The window fills from the bottom up and nothing leaves on its own. Files read and tool output (in pen) take far more room than the chat: after three hours, 130,000 of the 192,000 tokens.

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

  1. Instructions and built-in tools20,000always packed
  2. Connected tools
  3. Earlier work
  4. The code
  5. The log
  6. The error

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
ItemHeavy versionLight version
SetupInstructions and built-in tools: 20,000 tokens, always packed
Connected toolsAll 60 connected tools described: 25,000Only the 8 tools this task needs: 3,500
Earlier workThree earlier tasks in the same chat: 70,000A short summary of earlier work, written by you: 800
The codeThe whole 3,000-line file: 40,000Only the function you are changing: 1,500
The logThe full build log: 35,000The last 50 lines of the log: 1,200
The errorScreenshots of every step: 30,000The 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.

fig. 3 Packed from the bottom, oldest first. Everything heavy is 220,000 tokens, 20,000 over the limit, so the tool squeezes the three earlier tasks into a summary it writes: 69,000 tokens of detail are lost (in pen). A summary you write yourself keeps what you choose.

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.

  1. 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

  2. 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

  3. 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

  4. 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
MoveSent wholeWith the moveSaved, 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,000Only the function you are changing: 1,50038,500
Shrink it: Copy the error message instead of a screenshot of every step.Screenshots of every step: 30,000The error message, copied as text: 20029,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,000The helper's note: 40044,600
Fetch on demand: Leave the manual out until a question needs it, then look up those pages.The library manual, 120 pages: 60,000The two pages the question needs: 1,00059,000
In the window, with the setup of 20,000195,000 of 200,00023,100 of 200,000171,900
fig. 4 The same four jobs, to scale, sent whole or with a move. With the moves, 23,100 tokens go into the window instead of 195,000; the grey piles stay out.

These four habits matter more than which model you pick.