course contents
Developer Foundations · 11% of the exam
prompt and context engineering
share
This domain is about a ninth of the scored questions. It covers what fills each request and how to keep it lean, how to write and place a prompt's instructions and test each change, and how your code checks Claude's output before anyone uses it.
This domain keeps following Shelfwise, the internal stock-question tool: a long-lived Python Agent SDK service whose agent answers shop staff from one stock feed through one small MCP server, with its stock rules and tools sent as a cached ≈6,000-token prefix on every request.
In Domain 6 Shelfwise gains three choices, on context, prompts and output. In 6.1, stock_lookup returns at most five records, and the history is never summarised or cleared, because a chat of about three requests never reaches a trigger. In 6.2, one line changes from stock-rules-v12 to v13, both zero-shot and older than 5.1's three examples. In 6.3, an answer check shows each line greyed as "checking" while it streams, then marks it checked or replaces it.
Start hereThe words used throughout this domain
- context window
- The most text, counted in tokens, that one request can hold, input and output together (5.1).
- compaction
- Replacing a conversation's older turns with a summary, so a long task still fits its context window (1.3). 6.1 covers what the summary loses.
- context editing
- The API's beta option that clears old tool results from each request and leaves placeholders in their place (1.3).
- cache breakpoint
- A
cache_controlmarker on a content block. The prompt from its start up to that block is what caching can reuse (2.3). - tool_result
- The content block that carries a tool's output back to Claude, matched to the
tool_useblock that asked for it (1.2). - few-shot
- Prompting with several worked examples of the reply you want, which the docs also call multishot (5.1).