Developer Foundations · 11% of the exam

prompt and context engineering

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.

Course example

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.

stock_lookup: ≤5 records + totalhistory never summarised or clearedstock-rules-v13, zero-shotanswer check · "checking"
150/150required on the eval set before any change merges (2.4). A trial returning all 38 fuzzy matches scored 146/150 at ≈19,000 tokens a request, and v12's feed-time line, read literally by the replacement model, scored 141/150. A count with no lookup behind it fails the answer check.

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_control marker 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_use block 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).
structured outputs
The API feature that holds Claude's reply to a JSON schema, a document listing the fields, their types and which are required (2.4, 2.5).

task statements

flashcards

0 / 9 known
Card 1 of 9