01Chapter 1: The context window and its token budgetThis chapter assumes you have used a coding agent in a terminal or editor, can run basic command-line tools, and know that a token is a small chunk of text (a word, part of a word, or a symbol) that a language model reads and writes. You do not need to know how models work internally.3 min read
02Chapter 2: What actually fills the context in an agent sessionThis chapter assumes you have used a coding agent in a terminal or editor, can run basic shell commands and git, and know that a model reads a limited number of tokens at once. The previous chapter covered the window and its token budget. Here you will see what consumes that budget.3 min read
03Chapter 3: How long sessions go wrong: symptoms of a crowded contextThis chapter assumes you have used a coding agent for real tasks, know the command line and git, and understand that a model reads a limited number of tokens at once. It covers how a crowded context shows up in the agent's behavior, so you can spot it early and act before the window is full.2 min read
04Chapter 4: Checking how much context you have usedThis chapter assumes you have used a coding agent in a terminal, know basic shell and git, and know that a model has a limited input size measured in tokens. Here you will learn how to see how full the context window is and when to act on that number.3 min read
05Chapter 5: Scoping work so a task fits one sessionThis chapter assumes you have used a coding agent in a terminal or editor, know basic git, and understand that a model has a limited input size. It covers how to cut a large goal into tasks that finish inside one context window.3 min read
06Chapter 6: Persistent instructions: keep them short and stableThis chapter assumes you have used a coding agent in a terminal, know that the context window is limited, and understand that every file read and tool result takes space in it. Here you will learn how to write the project instructions that load at the start of every session.3 min read
07Chapter 7: Reading only what you need from the codebaseThis chapter assumes you have used a coding agent in a terminal, know basic shell commands such as grep and sed, and understand that the agent has a limited context window. Every file the agent reads stays in the context for the rest of the session. Reading with a plan keeps that cost low.3 min read
08Chapter 8: Keeping command and test output smallThis chapter assumes you have used a coding agent in a terminal and know basic shell commands, pipes, and git. Tool output is one of the fastest ways to fill a context window. Every line a command prints is added to the conversation, whether or not it is useful.3 min read
09Chapter 9: Compacting a session without losing decisionsThis chapter assumes you have used a coding agent in a terminal, know basic git, and understand that a model has a limited input size measured in tokens. It covers what compaction does, how to guide it, and how to check the result.3 min read
10Chapter 10: Keeping plans and progress in files outside the chatThis chapter assumes you have used a coding agent in a terminal, know basic git, and understand that a model can only read a limited number of tokens at once. It covers external notes: plan and progress files that live in your repository instead of in the conversation.3 min read
11Chapter 11: Starting fresh: handing work to a new sessionThis chapter assumes you have used a coding agent in a terminal, know basic git, and have seen how compaction and a progress file work. Here you will learn when a fresh session beats another compaction, and how to hand work over without losing the decisions that matter.2 min read
12Chapter 12: Using subagents to isolate noisy workThis chapter assumes you have used a coding agent in a terminal, know that the context window is limited, and have read the earlier chapters on what fills the context and on keeping tool output small.3 min read
13Chapter 13: Stable prefixes and prompt cachingThis chapter assumes you have used a coding agent for a while and know what a token is. You should also know that every request to the model carries the whole context: instructions, tool definitions, file contents, and conversation history.3 min read
14Chapter 14: Putting it together: a routine for long sessionsThis chapter combines the earlier techniques into one routine. It assumes you have used a coding agent in a terminal, know basic git, and know that a model reads a limited number of tokens at a time. You have already seen each technique on its own. Here you decide which one to use at each point in a3 min read