course contents
Architect Foundations · 15% of the exam
context management and reliability
share
Domain 4 was about getting a single response right. Domain 5 is about keeping the system right across a long conversation, many agents and many cases: a conversation runs for thirty turns, a coordinator waits on several subagents, and human reviewers have room for only a fraction of the cases. Each section asks where a piece of information must be stored so that it is still exact when a later step needs it, and when the system should hand a decision to a person.
You are building a customer support resolution agent with the Claude Agent SDK. It handles high-ambiguity requests: returns, billing disputes and account issues. It reaches your backend through four custom MCP tools. Your target is 80%+ first-contact resolution, while still knowing when to escalate.
The pieces you are responsible for:
process_refund is called with 200.00. Every tool call succeeds. The customer comes back, and the case no longer counts as resolved on first contact.Each of the six sections below is a different way a system loses something it needed. In 5.1 a summary drops an exact amount. In 5.2 an escalation rule reads the customer's mood instead of the case. In 5.3 a subagent's failure reaches the coordinator as silence. In 5.4 a long exploration forgets what it found an hour ago. In 5.5 an accuracy figure hides the one document type that fails. In 5.6 a source disappears between the finding and the report.
Start hereThe words this domain is built on
- context window
- Everything the model can see in one request: system prompt, tool definitions, and the conversation so far. The Messages API keeps no state, so your code sends all of it every time.
- progressive summarisation
- Replacing older turns with a shorter summary so a long conversation keeps fitting. Each pass compresses the previous summary again, and exact values are the first thing lost.
- case facts block
- A block your code rebuilds and sends with every request, holding the exact amounts, dates, IDs and statuses of the case. It sits outside the history, so it is never summarised.
- escalation
- Handing the case to a human, here by calling
escalate_to_human. It is the right outcome for some cases, and a failure of first-contact resolution for others. - claim-source mapping
- A record linking each claim to where it came from: source URL or document name, the excerpt, and the date. Provenance is preserved only while that link travels with the claim.
- subagent
- A separate Claude session with its own context window. Its tool calls and results stay there, and the parent receives only what it returns.
- coordinator
- The agent that splits a task into parts, delegates each part to a subagent and combines what they return. Domain 1 covers the pattern.
- MCP tool
- A tool served to the agent over the Model Context Protocol, such as
lookup_order. The agent calls it like any other tool. Domain 2 covers the protocol. - few-shot examples
- Worked input/output pairs placed in the prompt. They show the model how to handle a case instead of describing it.
- Claude Code
- Anthropic's command-line coding agent, used in 5.4.
/compactand/clearare two of its commands. Domain 3 covers it.
| Amounts, dates and IDs the next action depends on (5.1) | A case facts block, rebuilt every turn and never summarised. |
| Why a subagent could not finish (5.3) | Structured error context returned to the coordinator. |
| What a long exploration has found so far (5.4) | A scratchpad, a file on disk that is read back when a later question needs it. |
| Which source said what, and when (5.6) | Claim-source mappings with dates, carried through synthesis. |