01Chapter 1: What the context window is and why context engineering mattersThis chapter assumes you have called a large language model (LLM) through a chat or API interface. You should know what a prompt and a system prompt are, and have a rough idea of what a token is. You should also be able to read short Python snippets.2 min read
02Chapter 2: Tokens and budgeting the windowThis chapter assumes you have called a model through a chat or API interface and can read short Python. It covers how tokens measure the context window and how to split that window into a budget.3 min read
03Chapter 3: The parts of a contextThis chapter assumes you have called a model through a chat or API interface, know what a system prompt is, and can read short Python. The previous chapter covered tokens and budgets. Here you split a single call into its parts, so you can see what each part costs and which ones you can control.2 min read
04Chapter 4: Choosing what to include and what to leave outThis chapter assumes you know the parts of a context (system prompt, tools, history, retrieved data, user input) and the idea of a token budget. It covers how to decide which candidate items earn a place in the window on a given call.3 min read
05Chapter 5: How context goes wrongThis chapter assumes you have called a language model through a chat or API interface, know what a system prompt and a token are, and can read short Python. Earlier chapters covered the parts of a context and how to choose what to include. Here you will learn four ways a context can fail even when i3 min read
06Chapter 6: Where to put things in the contextThis chapter assumes you know what a context window is, how tokens are budgeted, and how a context divides into system prompt, tools, history, retrieved data, and user input. It also assumes you can read short Python code. Here you decide the order of that content, because order changes how well the2 min read
07Chapter 7: Retrieval and loading data just in timeThis chapter assumes you have read the earlier chapters on tokens, token budgets, and selecting relevant information. You should also be comfortable reading short Python functions.3 min read
08Chapter 8: Tool definitions and tool resultsThis chapter assumes you have called a model with tools (function calling) at least once. You should know what a system prompt is, what a token is, and how to read short Python code. It covers the two ways tools consume context: the definitions you send on every call, and the results that come back 3 min read
09Chapter 9: Trimming and managing conversation historyThis chapter assumes you know what tokens are, can call a chat model through an API, and can read short Python. It covers the history part of the context: what to keep, what to drop, and how to avoid common mistakes.2 min read
10Chapter 10: Compacting and summarizing long sessionsThis chapter assumes you know what a token budget is and how conversation history grows with each turn. You should also be able to read short Python functions.2 min read
11Chapter 11: Memory and notes outside the windowThis chapter assumes you know what a context window and a token budget are, and that you have seen the compaction pattern from the previous chapter. It covers how to keep information that does not fit in the window, or should not occupy it, and bring it back when needed.3 min read
12Chapter 12: Splitting work across subagents with separate contextsThis chapter assumes you have read the chapters on the parts of a context, tool results, and compaction. You should be comfortable with token budgets and with the idea that every call sees only what you put into it.3 min read
13Chapter 13: Structuring prompts for cachingThis chapter assumes you have read the earlier chapters on the parts of a context and on ordering content. You should be comfortable with tokens and with short Python code.3 min read
14Chapter 14: Measuring whether a context change helpedThis chapter assumes you can read short Python and have already built a context with selection, trimming, or compaction. Those techniques change what the model sees. This chapter covers how to check whether a change made the output better.2 min read