Chapter 7: Context

Chapter 5 said a window has a limit. On a 1M-token window you will rarely reach it. What you reach first is the price of everything you put in.

Context budget

Also called Attention budget

Treating the window as money you spend. Each token that goes in stays in, gets sent again on every later turn, and leaves less room for what comes next. Test logs and whole files are the big purchases.

An agent spends this without asking. A test log nobody needed is read again on each turn after it, and billed each time. Larger windows moved the limit but not the logic. Claude Code's docs say you will "rarely run out", and still advise clearing between tasks, because "a focused context gets you better answers and costs less."

Say it to your agent

“Here is my /context output. Name the five biggest items and say whether this task needs each one. Take any MCP server we haven't used this week out of .mcp.json. From now on, search with rg -n and read line ranges, not whole files.”

The workshop

Name a word, or describe what you mean in everyday language.