8 of 81
ContentsPart I · Chapter 2

Chapter 2How it writes

The desk

That desk is the second thing your guesses depended on at the start of the chapter: the words in front of you. Everything the model can take into account for one reply has to be in its context, the text it is given for that reply. Anthropic’s engineers define context as “the set of tokens included when sampling from” the model.1 The most the model can take in at once is its context window, which this book calls its desk. The model can only see what fits on the desk right now.1

Figure 2.3 imagines a desk with room for 100 tokens’ worth of material; the sizes are made up. Your question takes 2. Yesterday’s chat (18), the company travel policy (25), your notes (10) and some search results (20) bring the total to 75, which fits. A 300-page PDF on its own would take 70. To add it, most of the rest has to come off.

Without the PDF: 75 of 100 tokens, and it all fitsYour question, 2Yesterday'schat, 18Travel policy25Notes10Searchresults, 20Room left25With the PDF: 72 of 100, so most of the rest must come offYour question, 2A 300-page PDF70Room left28
Figure 2.3. What fits on a desk of 100 tokens. The sizes are made up to make the idea visible. Read the two rows as two choices: without the PDF, everything fits with room to spare; with it, only the question and 28 more tokens’ worth of material can stay.

Try it: put things on the desk until it overflows, then try the ways to make room.

The desk (context window)

Illustration

Interactive Put cards on the desk and watch it fill; then try the ways to make room.Try it on the web: aifromthepartsup.com/how-does-it-work/5/

Put things on the desk:

    Where on the desk? Put the one key fact at the

    Research found models use information in the middle of a long input less reliably than at the start or end.2

    Illustrative sizes: the token weights on these cards are made up to make the idea visible.

    Real desks are far bigger. As of 2026, Anthropic listed a context window of a million tokens for its current Claude models.3 (Spot it today: look for “context window” in a model’s documentation.) But a bigger desk is not a perfect one. Researchers found that models often use information at the start and end of a long input more reliably than information buried in the middle.2 Anthropic’s engineers describe the same pressure: as the number of tokens grows, a model’s ability to recall what is on the desk declines, so the desk has to be treated as “a finite resource.”1

    So something has to decide what goes on the desk and what comes off, and it isn’t the model. The software around the model, which this book calls the harness, does that job; Chapter 7 is about it. Anthropic’s engineers describe several ways. The software can summarize a long conversation as it nears the limit and start fresh with the summary. It can clear out material that is no longer needed, such as the raw results of an earlier search. It can keep a document out of the way, holding only its name or address, and fetch the part it needs when it needs it. And it can write notes that are kept off the desk and put back on it later.1

    That last move is what lies behind it remembers me. Anything from an earlier conversation has to be put back on the desk by software, for example as saved notes.14 As of October 2026, Anthropic said its Claude apps “can also remember context from your chats and carry it into new conversations,” and that users can view and edit what has been saved.4 (Spot it today: look in your tool’s settings for “memory” or “personalization,” and for a page that shows what it has kept.) When a tool seems to remember you, it is reading notes that its software put on the desk.

    An illustration, not a real case. A payroll accountant spends a long afternoon in one chat. She pastes in the company’s overtime rules, three spreadsheets of hours and a list of exceptions. Late in the day, the tool’s answers start to ignore an exception she gave it early on. The next morning she opens a new chat, asks it to pick up where they left off, and it has no idea what she means.

    Nothing was broken. The first problem was a crowded desk. By late afternoon, her early message was one item among many, deep in the middle, where models use information less reliably. The second problem was an empty desk. The new chat started with nothing from yesterday on it, because nothing in her app was set to save it. Pasting the key rules into the new chat, near the start, puts them back where the model can see them.

    Notes (4)
    1. 1Anthropic, “Effective context engineering for AI agents,” Anthropic Engineering, September 29, 2025, https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents (accessed October 27, 2026).
    2. 2Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang, “Lost in the Middle: How Language Models Use Long Contexts,” Transactions of the Association for Computational Linguistics 12 (February 23, 2024): 157–173, https://doi.org/10.1162/tacl_a_00638.
    3. 3Anthropic, “Models overview,” Claude Platform Docs, https://platform.claude.com/docs/en/models/overview (accessed October 26, 2026).
    4. 4Anthropic, “Use Claude's chat search and memory to build on previous context,” Claude Help Center, https://support.claude.com/en/articles/11817273-use-claude-s-chat-search-and-memory-to-build-on-previous-context (accessed October 26, 2026).

    Chapter 2 · page 5 of 6

    Turn pages with the ← and → keys.

    Cite this page

    Using this book

    © 2026 Steve Sparks. All rights reserved. Teachers and students may assign, read, quote and excerpt chapters of this book for classes and study, with credit to Steve Sparks and a link to aifromthepartsup.com. Anyone may quote short passages and cite any page, with a link back. To repost, reproduce or sell the book or larger parts of it, ask through GitHub.

    Quoted material and figures from other sources remain their owners'.