Skip to content
CCAR-F Prep

Domain 4 · 20% of exam

Prompt Engineering & Structured Output glossary

50 terms drawn from this domain’s 6 lessons and the sources they cite. A term that matters in more than one domain appears on each of their pages.

The full glossary is searchable across all five domains, and the domain curriculum explains where each term is used.

Attention dilution
The failure mode where an agent processing too many items in one pass analyses some items thoroughly and skims others, flagging a pattern in one file while approving identical code in another. The fix is a multi-pass architecture — a dedicated local analysis pass per item so each gets the full attention budget, then a separate cross-item integration pass — not a bigger context window, because the problem is attention quality rather than context capacity.
Batch lifecycle
A batch begins processing immediately and its `processing_status` moves through `in_progress`, `canceling`, and `ended`; poll until it ends. Every request then resolves to one of four result types — `succeeded`, `errored`, `canceled`, or `expired` — and only `succeeded` is billed, so a stalled or cancelled batch costs nothing for work that never ran. platform.claude.com › creating-message-batches
Batch request constraints
A batch is capped at 100,000 requests or 256 MB, whichever comes first, with an oversized batch returning 413 `request_too_large`. Almost any Messages API request can be batched, but `stream: true`, `speed`, `fallbacks` and `max_tokens: 0` are rejected. Parameter validation is asynchronous, surfacing only after the batch ends — so dry-run one request against the synchronous API first. platform.claude.com › batch-processing
Batch results retrieval
Results appear as a `.jsonl` file at `results_url`, populated only once the batch has ended, in no guaranteed order. Stream them rather than bulk-downloading, and note the 29-day availability window runs from `created_at`, not from `ended_at`. platform.claude.com › batch-processing
Batch SLA calculation
Worst case = gap between submissions + 24h processing + downstream time, which must fit the SLA. A 30-hour SLA allows a gap of at most 6 hours with nothing downstream; the guide's example submits every 4 hours. A single fixed deadline needs submission at least 24 hours (plus downstream time) before it, and an SLA of 24 hours or less cannot be guaranteed on batch.
Batch tool-calling limitation
A batch request cannot execute a client tool and continue the same logical turn, because continuing after your tool returns needs a new request. Server tools do run their full agentic loop inside the batch worker, but a result returning `pause_turn` needs a new follow-up request to continue. Anything needing mid-turn client tool execution belongs on the synchronous API. platform.claude.com › batch-processing
Batch vs synchronous
Blocking workflows — pre-merge CI checks, real-time review feedback, anything a developer waits on — stay on the synchronous API. Latency-tolerant workflows — overnight technical debt reports, weekly audits, nightly test generation — move to the Batch API for the 50% saving. Moving everything to batch for the savings is the exam's classic wrong answer.
Calibration
Mapping reported confidence to actual accuracy by running labelled validation sets — data where the answer is already known — through the system, then setting routing thresholds from the result (for example, by the share confirmed correct in each confidence band). The labels must come from outside the model, as human verdicts or recorded outcomes; a second model's verdicts are not ground truth. Judge whether the correct final state was reached rather than whether a specific process was followed, and keep manual testing, which catches edge cases evals miss.
Confidence-based routing
Reporting high-confidence findings directly and routing low-confidence ones to human review; in review pipelines, route on severity and confidence together, so a low-confidence high-severity finding goes to a person and a low-confidence low-severity one is only logged. Raw self-reported confidence is uncalibrated — a form of the model judging itself — so it is unfit for automated decisions until thresholds are calibrated, and it is never a substitute for explicit criteria defining what counts as a valid finding.
Context rot
The documented phenomenon that accuracy and recall degrade as token count grows, which makes curating what is in context as important as how much space there is. Context is a finite resource with diminishing marginal returns — the model draws on a limited attention budget that every added token depletes. platform.claude.com › context-windows
Contrast pair (few-shot)
Two few-shot examples shown side by side — an acceptable pattern not to report and a similar-looking genuine issue to report — each with its reasoning, so the model learns where the boundary falls and can judge patterns the examples never covered.
custom_id
The per-request identifier in a batch, matching `^[a-zA-Z0-9_-]{1,64}$`. It must be unique within the batch, and results can come back in any order, so always match results to requests by `custom_id` and never by position. Build it from your own record key (a storage path's slashes and dots are not allowed), and give a retried or chunked request a derived id such as `doc-0042-retry-1` or `doc-0042-chunk-0`. platform.claude.com › batch-processing
detected_pattern
A field on a structured finding that tags which specific construct triggered it, so dismissal rates can be analysed by pattern. When one pattern is dismissed consistently the documented fix is a formal rule or prompt refinement for that pattern — not another retry. claude.com › building-agents-with-the-claude-agent-sdk
Duplicated-work failure
The delegation failure where vague per-subagent task descriptions cause two agents to research the same topic while another goes uncovered. The fix is to give each subagent an objective, an output format, guidance on tools and sources, and clear task boundaries. anthropic.com › multi-agent-research-system
enum
The JSON Schema field restricting a value to a fixed set of labels. For classification tasks the documented advice is to use a tool with an `enum` field of valid labels, or structured outputs, rather than asking for a category in prose — few-shot examples teach which label is right, the enum guarantees only defined labels can be emitted. platform.claude.com › claude-prompting-best-practices
Evaluation rubric
The criteria an LLM judge scores against, in Anthropic's documented case factual accuracy, citation accuracy, completeness, source quality, and tool efficiency. The shape that proved most consistent was a single call with a single prompt outputting a 0.0-1.0 score plus a pass/fail grade, run against roughly 20 representative queries — enough to see the impact of a change. anthropic.com › multi-agent-research-system
Examples with reasoning
Each few-shot example must show the input, the output, and why that decision was chosen over plausible alternatives. Examples without reasoning teach literal pattern-matching; examples with reasoning teach the generalisable decision principle.
Explicit categorical criteria
Prompt criteria that state precisely what to flag and what to skip — bugs and security vulnerabilities in, minor style preferences out — instead of vague instructions such as "be conservative" or "only report high-confidence findings". Severity levels must be defined with concrete code examples per level, never prose descriptions, or the model has to interpret what the level means.
False-positive trust problem
A high false-positive rate in one finding category destroys developer trust in every category, even ones running at high accuracy. The counter-intuitive fix is to temporarily disable the noisy category, refine it against concrete examples, and re-enable it once precision reaches a bar set in advance (running it in shadow mode meanwhile) — putting system-wide trust ahead of category completeness.
Few-shot examples
The most effective technique for consistent output, and the right answer when detailed instructions still produce inconsistent formatting, inconsistent judgement on ambiguous cases, or empty fields for data that is present in an unusual format. Use 2-4 targeted, diverse examples on the exam (current Anthropic docs say 3–5): fewer than two establishes no pattern, and an 8-10 example set built "for coverage" wastes tokens and risks context rot. anthropic.com › effective-context-engineering-for-ai-agents
Forced selection suppresses commentary
With `tool_choice` set to `any` or `tool`, the API makes Claude's response start with a tool call, so it emits no natural-language response or explanation before the `tool_use` blocks even if asked. Any field logging Claude's pre-call commentary will be empty; when commentary matters, use `auto` with an instruction to use the tool. platform.claude.com › define-tools
Independent review instance
A separate Claude invocation with no access to the generating session's reasoning, so it judges the output on what it sees alone. A reviewer in a fresh context sees only the diff and the criteria, never the justification that produced the change — the strongest form goes further and tries to refute the result rather than re-confirm it. code.claude.com › best-practices
Informal measurement (extraction)
A quantity stated imprecisely, such as "a couple of tablespoons" or "roughly two weeks". The extraction keeps the original text, leaves the numeric field null and flags it informal, rather than converting it to a number the model has made up; this needs the quantity field to be nullable.
Invalid tool call
A tool call Claude makes that is invalid, such as one missing a required parameter. Report it like any failure, with a `tool_result` carrying `is_error: true` and a clear message; Claude can then call the tool again with the information filled in. The docs promise no fixed number of attempts, so cap retries in your loop. `strict: true` prevents missing parameters and type mismatches, but not a well-typed wrong value, which only your tool's validation error can catch. platform.claude.com › handle-tool-calls
is_error
The optional boolean on a `tool_result` block, "Set to `true` if the tool failed or the call was invalid"; return the error text as `content`. Claude may then call the tool again, so cap retries in your loop. Write instructive messages (what went wrong, what to try next) rather than a bare "failed". For server tools such as web search you send no `is_error` result: the API returns any error inside the tool's own result block. platform.claude.com › handle-tool-calls
JSON outputs (`output_config.format`)
The structured-outputs control that constrains Claude's direct response to a JSON schema, with no tool call; the result is read from the response's text content block. It replaces the deprecated `output_format` parameter, returns a 400 if citations are enabled, and is incompatible with prefill. The exam's answer for guaranteed structure remains tool use with a JSON schema. platform.claude.com › structured-outputs
max_tokens
An absolute ceiling on generated output, not a target — the model may stop earlier, so a short result is not evidence that your criteria suppressed output. Exceeding it produces `stop_reason: "max_tokens"`, handled by raising the limit or continuing the response. platform.claude.com › messages
Message Batches API
The asynchronous API charging 50% of standard prices unconditionally. Most batches finish in under an hour but the maximum processing window is a hard 24 hours with no latency guarantee — processing slows under demand — so design for the worst case, not the common one. platform.claude.com › batch-processing
Mid-conversation system message
A `role: "system"` entry in `messages`: a system instruction added partway through a conversation without changing the top-level system prompt or the cached prefix before it. Standing criteria that apply from the first turn belong in the top-level `system` parameter instead. platform.claude.com › overview
Optional/nullable fields
The primary schema-level defence against fabrication: if a field is required, the model is pressured to invent a value when the source has none; if it is nullable, it can honestly return `null`. Related patterns are an explicit `"unclear"` enum value for genuinely ambiguous sources, and an `"other"` value paired with a freeform detail string.
pause_turn
The `stop_reason` returned when a long-running server-tool turn is paused, because the server-side sampling loop reached its iteration limit (10 iterations per request by default) while running server tools such as web search. Handle it by appending the response's `content` unchanged as an assistant message and sending the request again with the same `tools` and no new user message — never by treating the turn as done. A client tool call is always `tool_use`, never `pause_turn`. platform.claude.com › handling-stop-reasons
Precision (review findings)
The share of reported findings that were real: true positives ÷ (true positives + false positives), in practice the share of posted findings developers acted on. Measure it per category (and per `detected_pattern`), because one noisy category drags the overall figure down and developers judge the reviewer by that figure. A drop in the number of findings is not a precision gain.
Prefill
The retired workaround of pre-writing part of the assistant turn to force JSON or YAML output. Its documented successor is the Structured Outputs feature, and from Claude 4.6 and Mythos Preview a prefilled last assistant turn returns a 400 error. Forced tool choice (`any`/`tool`) is a separate setting and is not affected by that change; on models that accept it, the response simply starts with a tool call. platform.claude.com › claude-prompting-best-practices
Retry effectiveness boundary
Retries fix format mismatches, structural errors, misplaced values, and missed line items — anything the model can correct by re-examining information it already has. They cannot produce information genuinely absent from the source document; that extraction is flagged for human review or returned as null, not retried again.
Retry-with-error-feedback
The correct retry shape: send back the original document, the failed extraction, and the specific validation error — for example "line items sum to £450 but stated_total is £500". A naive retry without the specific error usually reproduces the same mistake. When the extraction came back as a `tool_use` and the conversation continues, the errors go back in a `tool_result` with `is_error: true` (tool_result first, any text after), not as plain text in a new user turn. Cap attempts at two or three and stop when the same error repeats.
retryable flag (validation errors)
A typed field on each validation error, set by the check that raised it, saying whether a retry can help. An error naming information absent from the source is non-retryable and sends the record straight to human review or null without spending an attempt; deciding by matching words in the error text is brittle.
Right altitude
The Goldilocks zone criteria should sit in, between two named failure modes: hardcoded brittle if/else logic, which creates fragility and maintenance cost, and vague high-level guidance, which gives the model no concrete signal. The goal is the minimal set of information that fully outlines expected behaviour — good heuristics plus explicit guardrails, not a laundry list of edge cases. anthropic.com › effective-context-engineering-for-ai-agents
Rules-based feedback
The documented best form of feedback: clearly defined rules for an output, plus which rule failed and why — code linting is the canonical example. The documented weakest is LLM-as-judge, described as "generally not a very robust method" with heavy latency tradeoffs. claude.com › building-agents-with-the-claude-agent-sdk
Self-correction schema fields
Schema fields that make discrepancies visible without external logic: `calculated_total` (computed from the line items, never copied) alongside `stated_total` (as printed, nullable) with a `total_discrepancy` flag when they differ, and a `conflict_detected` boolean with a `conflict_note` marking a source that contradicts itself rather than silently picking one value. `conflict_detected` is the retry stop condition: a self-contradictory document is accepted as extracted and routed to review, not retried.
Semantic errors vs syntax errors
`tool_use` with JSON schemas eliminates syntax errors — malformed JSON, missing fields, wrong types — but not semantic ones: line items that do not sum to the stated total, values placed in the wrong fields, or fabricated values. Semantic errors need validation logic and retry loops outside the schema.
Shadow mode
Running a disabled review category without exposing its output: its findings are generated and logged but not posted, so its precision can be measured while its criteria are reworked. Before switching the category off, write down what re-enabling requires — the misfiring cases rewritten as concrete examples and the precision it must reach.
strict: true
The tool-definition flag enabling schema validation of tool inputs, which eliminates invalid tool calls (missing parameters, type mismatches) entirely. `tool_choice: "any"` alone guarantees only that a tool is called; on models that support forced tool use, combining it with `strict: true` guarantees both that a tool is called and that its input strictly follows your schema. On models that reject forcing, `auto` plus `strict: true` keeps inputs schema-valid but no longer compels a call. platform.claude.com › define-tools
Structured output reliability hierarchy
`tool_use` with JSON schemas above prompt-based JSON. The tool's schema constrains the shape of what Claude returns, eliminating syntax errors such as missing brackets, trailing commas, and unquoted keys; asking for JSON in a text response gives no structural guarantee and will periodically produce unparseable output.
Structured Outputs feature
The constrained-decoding feature that keeps output schema-valid, covering two controls that share one grammar pipeline: JSON outputs (`output_config.format`), which shape Claude's direct response with no tool call, and strict tool use (`strict: true`), which validates tool inputs. Current docs say it is available on every model and name it as the replacement on models that reject forced tool use. The first use of a schema costs extra latency while the grammar compiles; compiled grammars are cached for 24 hours from last use. Output can still miss the schema when `stop_reason` is `refusal` or `max_tokens`. platform.claude.com › structured-outputs
Structured-output schema constraints
The constrained-decoding grammar supports the basic types plus `enum` (strings, numbers, booleans, nulls only), `required`, and `additionalProperties`, which must be set to `false` for objects — any other value is rejected. Not supported: recursive schemas, `oneOf` (use `anyOf`), `not`, external `$ref`, numerical constraints (`minimum`, `maximum`, `multipleOf`), and string constraints (`minLength`, `maxLength`); an unsupported feature returns a 400. Per request, across all strict schemas: at most 20 strict tools, 24 optional parameters and 16 union-type parameters (each `["string", "null"]` field counts), with a 180-second compile timeout. platform.claude.com › structured-outputs
Subagent context isolation
A subagent's context window starts fresh with no parent conversation; the only content crossing the boundary is the Agent tool's prompt string. Intermediate tool calls and results stay inside the subagent, so heavy exploration never accumulates in the coordinator's context. code.claude.com › subagents
system (parameter)
The top-level request parameter where a system prompt lives, alongside `model`, `messages`, and `max_tokens`. Standing criteria that apply from the first turn go here; a `role: "system"` entry in `messages` is a mid-conversation system message, not the standing system prompt. Appending criteria as an extra user message does not create the separation you might expect — consecutive same-role messages are combined into a single turn rather than rejected. platform.claude.com › messages
temperature
A sampling setting that changes how much output varies between runs. It is not a precision control: lowering it cannot invent a decision boundary the prompt never defined, and a finding that is consistently wrong is still a false positive. Explicit report and skip criteria are the fix.
tool_choice
The parameter controlling how the model interacts with tools, with four documented types: `auto` (model decides; default when `tools` are provided), `any` (must call some tool, chooses which), `tool` (must call the named tool), and `none` (may not call any tool; default when no `tools` are provided). platform.claude.com › messages
Writer/Reviewer pattern
Session A implements, a second independent session reviews, and Session A then addresses the feedback. The same split works for tests, with one Claude writing tests and another writing code to pass them. Its documented basis: a fresh context improves code review since Claude will not be biased toward code it just wrote. code.claude.com › best-practices