The largest domain and your weakest. Everything here is Agent SDK mechanics: how the loop terminates, who runs tools, how subagents get context, and where enforcement lives.
Four steps, forever: Claude reasons → requests a tool → your code executes it and appends the result → loop. Claude never executes anything itself; that gap is where approvals and hooks live.
// the entire loop, and the only correct termination test
messages = [{ role: "user", content: goal }];
while (true) {
res = await claude.messages.create({ model, tools, messages });
messages.push({ role: "assistant", content: res.content });
if (res.stop_reason !== "tool_use") break; // "end_turn" -> done
results = await runTools(res.content); // YOUR code runs them
messages.push({ role: "user", content: results }); // MUST append, or Claude goes blind
}
stop_reason | Meaning | Your loop does |
|---|---|---|
"tool_use" | Claude is requesting one or more tools | Execute, append results, iterate |
"end_turn" | Claude has finished | Break; present the final response |
tool_use response can contain text too.Hub-and-spoke. Every message routes through the coordinator. Subagents never talk to each other — that's what gives you observability, consistent error handling, and controlled information flow.
Two more coordinator responsibilities the exam tests: partition scope across subagents to minimise duplication (distinct subtopics or distinct source types), and run an iterative refinement loop — evaluate the synthesis for gaps, re-delegate targeted queries, re-synthesise until coverage is sufficient.
| Mechanism | Rule |
|---|---|
Task tool | The mechanism for spawning subagents. The coordinator's allowedTools must include "Task" or it cannot delegate at all. |
| Context | No inheritance. Subagents don't get the coordinator's conversation history and don't share memory between invocations. Findings must be placed in the subagent's prompt. |
| Parallelism | Emit multiple Task calls in a single response. Spreading them across separate turns is sequential. |
AgentDefinition | Per-subagent description, system prompt, and tool restrictions. |
| Attribution | Pass structured data that separates content from metadata (source URL, document name, page number) so provenance survives the handoff. |
| Prompt style | Coordinator prompts state goals and quality criteria, not step-by-step procedure — procedural scripts kill subagent adaptability. |
fork_session | Independent branches from a shared analysis baseline, for exploring divergent approaches. |
agents: {
synthesis: {
description: "Combines findings into a cited report.",
prompt: systemPrompt,
tools: ["verify_fact"] // scoped, not all 18
}
},
allowedTools: ["Task", "Read"] // without "Task": no subagents
The central distinction: programmatic enforcement (hooks, prerequisite gates) gives deterministic compliance; prompt-based guidance has a non-zero failure rate. When identity verification must precede a financial operation, non-zero is not acceptable.
get_customer in 12% of cases and refunds wrong accounts. Keyed answer: a programmatic prerequisite that blocks lookup_order and process_refund until get_customer has returned a verified customer ID. System-prompt emphasis and few-shot examples are Probabilistic. A routing classifier that enables tool subsets is Wrong problem — it changes tool availability, and the fault is tool ordering.
The human agent has no access to the transcript. The handoff summary carries: customer ID, root cause analysis, refund amount, recommended action.
Decompose into distinct items → investigate each in parallel over shared context → synthesise one unified resolution. Not: handle the first and ask them to write back.
| Hook use | Pattern | Example |
|---|---|---|
| Normalise incoming data | PostToolUse — intercept the tool result and transform it before the model processes it | Unix timestamps, ISO 8601 strings and numeric status codes from different MCP tools → one format |
| Enforce a business rule | Intercept the outgoing tool call, block it, redirect | Refund above $500 → blocked → routed to human escalation |
Choose hooks over prompt instructions whenever the rule is a guarantee. Reciprocally: don't propose a hook for stylistic or judgment-based behaviour — that's over-engineering, and the exam penalises it.
Use when the aspects to review are known in advance. Canonical shape: analyse each file individually, then a cross-file integration pass. Predictable multi-aspect reviews.
Use for open-ended investigation, where subtasks depend on what you discover. "Add comprehensive tests to a legacy codebase": map structure → identify high-impact areas → build a prioritised plan that adapts as dependencies surface.
Splitting per-file avoids attention dilution — the same principle that keys item 12 in the guide, and the reason a larger context window is Wrong problem.
| Situation | Do this |
|---|---|
| Continue a specific named investigation tomorrow | --resume <session-name> |
| Files changed since the analysis | Resume and tell it which files changed, so it re-analyses those specifically instead of re-exploring everything |
| Compare two testing or refactoring strategies from one shared analysis | fork_session — independent branches, shared baseline |
| Prior tool results are now stale | Start a new session and inject a structured summary. More reliable than resuming onto stale results. |
| Prior context is mostly still valid | Resume |
Detail that appears in the Domain 1 lecture deck but not in the guide's own summary. All of it is fair game.
The exam guide calls it the Task tool. The current SDK also exposes it as the Agent tool. Same mechanism — recognise both in an option list, and don't reject a correct answer because it says "Agent".
If you define a subagent and leave the tools field out, it inherits everything the parent has — including Bash, Write and Edit. The deck's worked case: a read-only review agent inherited write access and modified source files. Scoping is not an optimisation; it is the safety boundary.
// risky — inherits Bash, Write, Edit...
{ description: "Reviews code", prompt: p }
// safe — can't misuse what it doesn't hold
{ description: "Reviews code", prompt: p, tools: ["Read", "Grep"] }
Three parts to an AgentDefinition, with three distinct jobs: the description is how the coordinator decides which specialist to pick; the system prompt is how that specialist behaves; the tools list is exactly what it may touch. A weak description causes mis-selection between subagents in the same way a weak tool description causes mis-selection between tools.
When an option asks whether a prompt is sufficient, check whether the stem falls into one of these. If it does, the answer is programmatic.
| Category | Examples in the scenarios |
|---|---|
| Money | Moving funds, refunds, payments |
| Identity | Verifying which customer you are acting for |
| Safety | Actions that could cause harm |
| Compliance | Anything with legal weight |
Security screening happens before you board — that is PreToolUse, inspecting the call and allowing, blocking or redirecting it. Baggage gets re-tagged into a standard form on the belt after the flight — that is PostToolUse, transforming the result before Claude sees it. Both run in your code, outside Claude's conversation, which is exactly why they are deterministic.
A single agent doing search, reading and writing at once fills its context with clutter and quality drops. The planner-plus-specialists split exists to keep each context clean, not merely to parallelise.
| Resume | Fresh session + summary | |
|---|---|---|
| Use when | Prior context mostly valid | Old tool results are stale |
| Cost | Cheaper, keeps continuity | New session, small setup cost |
| Reliability | High if little changed | High when a lot changed |
The stale-results trap is named as the number-one resume pitfall: the saved context includes the file contents it read earlier, so the agent may confidently discuss a function that no longer exists.
| Guide says | Current primary | Also valid |
|---|---|---|
| The Task tool spawns subagents | Renamed Agent in Claude Code v2.1.63 | Task(...) still works as an alias; some SDK surfaces still report "Task" in the initial tools list. Accept either in an option. |
| Subagents inherit nothing | Still true for named and general-purpose subagents | A fork subagent type deliberately inherits the parent's full conversation, system prompt, tools and model. Its own tool calls stay out of your conversation. The exception, not the rule. |
Subagent tools are scoped by an allowedTools-style list | Unchanged, and still the safety boundary | The tools field can also allowlist which subagents this agent may spawn: Agent(worker, researcher). |
| Explore isolates verbose discovery | Unchanged | Three built-ins now: Explore (read-only, runs on Haiku, search-optimised), Plan (research during plan mode), general-purpose. Explore and Plan deliberately skip CLAUDE.md and git status, so a rule that must reach them has to be restated in the delegation prompt. |
fork_session branches from a baseline | Unchanged in the Agent SDK | In Claude Code the same idea is the fork subagent type, and context: fork on a skill. Inspect live work with /agents and /tasks. |
Hooks are PreToolUse and PostToolUse | Both current, and the pre/post distinction is exactly as taught | The full event list is much longer now — including InstructionsLoaded, SessionStart and prompt hooks. Hooks can also be scoped to a single skill's lifecycle via a hooks frontmatter field. |
Loop control uses stop_reason | Unchanged, and still the only exact test | Interleaved thinking now lets Claude reason between tool calls inside one assistant turn. It does not change the termination rule, and it is not in the blueprint. |
Your strong domain — but note where the exam's canonical answer is smaller than what you'd build. Descriptions before architecture; scoped tools before consolidation.
Descriptions are the primary mechanism the model uses to select tools. Minimal descriptions ("Retrieves customer information" / "Retrieves order details") are the root cause of misrouting, not a symptom of it.
analyze_content → extract_web_results with a web-specific description.analyze_document → extract_data_points + summarize_content + verify_claim_against_source.Also audit the system prompt for keyword-sensitive instructions that create unintended tool associations and override otherwise good descriptions.
lookup_entity is a legitimate architecture but is Premature scope when the stem asks for the "most effective first step" and tells you descriptions are minimal. A keyword routing layer in front of the model is Over-engineered and discards the model's language understanding.
MCP signals failure with the isError flag. Uniform "Operation failed" responses prevent recovery decisions — return metadata the agent can act on.
{
isError: true,
content: [{ type: "text", text: "Refunds over $500 require manager approval." }],
errorCategory: "business", // transient | validation | business | permission
isRetryable: false // stops the agent wasting retries
}
| Category | Examples | Retryable | Agent should |
|---|---|---|---|
| transient | Timeout, service unavailable | Yes | Retry, possibly with backoff |
| validation | Malformed or invalid input | No, until input changes | Correct the arguments and re-call |
| business | Policy violation, threshold exceeded | No | Explain to the customer in friendly terms; escalate if needed |
| permission | Not authorised for this operation | No | Escalate or take a different route |
Two more distinctions the exam keys on: subagents perform local recovery for transient failures and propagate upward only what they can't resolve (with partial results and what was attempted); and an access failure (needs a retry decision) is not the same as a valid empty result (a successful query with no matches).
tool_choiceToo many tools degrades selection reliability — the guide's example is 18 tools where 4–5 suffice. Agents holding tools outside their specialisation misuse them (a synthesis agent starting to run web searches).
tool_choice | Behaviour | Use it when |
|---|---|---|
"auto" | Model may call a tool or return text | Normal conversational agents |
"any" | Must call some tool; model picks which | You need structured output and the document type — hence the schema — is unknown |
{"type":"tool","name":"x"} | Must call that tool | A specific extraction must run first, e.g. extract_metadata before enrichment; handle later steps in follow-up turns |
"none" | No tools this turn — text only | You want Claude to ask or explain without acting Deck |
Scoping sets the menu; tool_choice sets the order. Note that any and forced tool cannot be combined with extended thinking.
Scoped cross-role tools are the keyed pattern for high-frequency needs: give synthesis a narrow verify_fact for the 85% simple case, keep complex verification flowing through the coordinator. Also prefer constrained tools over generic ones — replace fetch_url with load_document that validates document URLs.
| Scope | File | For |
|---|---|---|
| Project | .mcp.json | Shared team tooling, version-controlled |
| User | ~/.claude.json | Personal and experimental servers |
// .mcp.json — committed; the secret is not
{ "mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
} } }
Grep over a better MCP tool, the fix is a richer MCP tool description explaining capabilities and outputs.| Tool | Job | Selection cue in a stem |
|---|---|---|
Grep | Search file contents | "find all callers of", "locate this error message", "which files import X" |
Glob | Match file paths | "all files named …", "**/*.test.tsx" |
Read | Load a full file | Following imports, tracing a flow |
Write | Write a full file | Fallback when Edit can't anchor |
Edit | Targeted change via unique text match | Small precise modification |
Bash | Commands | Tests, builds, git |
Edit fails on non-unique text → Read then Write. That's the keyed fallback.Grep for entry points, then Read to follow imports and trace flows. Reading every file upfront is the anti-pattern.Write it for Claude, not for yourself — Claude cannot see inside your function.
Right-sizing: size tools around the choices Claude has to make. Split distinct actions; consolidate steps that always go together; avoid both extremes. The deck's worked case is travel booking — handle_travel(action, ...) forces Claude to guess an action string, whereas search_flights, book_flight and cancel_booking are picked unambiguously.
The cost of a vague interface is silence. Bad tool design does not crash. Claude picks the wrong tool, fills the wrong parameters, or gives up and answers in text. You see subtly wrong production behaviour and no error at all.
A thrown exception becomes a low-level protocol error that Claude handles poorly. Return a successful response carrying isError: true plus details, so Claude sees the failure and can react to it.
Sanitise before returning. Say enough to recover and nothing that leaks internals. Never return a raw stack trace; wrap no such table: users_v2 as "the requested resource could not be accessed". A good message reads: "Couldn't fetch order #4471: database timed out after 5s. Transient — safe to retry."
Wider category vocabulary. The guide names transient, validation, business and permission. The deck also uses not_found and rate_limit as finer labels for the same distinctions. If an option offers those names, they are not wrong — judge on whether the retry decision they imply is right.
MCP is the USB-C of AI tooling: build the server once and any MCP client plugs in, instead of a bespoke connector per system. Tools are verbs Claude calls; resources are nouns it reads — a file, a schema, an issue summary. In Claude Code you pull a resource in by typing @.
| Scope | File | Who gets it |
|---|---|---|
| local default | ~/.claude.json | Only you, only this project |
| project | .mcp.json | Committed — the whole team |
| user | ~/.claude.json | You, across all your projects |
Precedence: local > project > user. When the same server name exists at two scopes, the higher one wins, so your local override beats the team's shared entry. Running in a sub-folder also merges in parent .mcp.json files. Picking the wrong scope is named as the number-one MCP mistake — a personal token in project scope leaks to the whole team.
Transport is separate from scope. stdio means a local program Claude launches, configured with command and args. http means a remote server, configured with a url. Secret expansion — ${VAR}, with ${VAR:-default} for a fallback — works in command, args, env, url and headers.
/mcp reports connection status. Several servers run at once; name them meaningfully (github, stripe-prod) rather than server1.
Edit requires a prior Read, and the target text must match exactly and uniquely. If it is not unique, widen the surrounding text or use replace_all; only if you still cannot pin one spot does Read plus Write become the fallback. It is a last resort, not a default — a precise Edit produces a clean diff, whereas Write rewrites the file.
Use Read not cat, Grep not grep. Built-ins give better permission handling, a clearer audit trail, and are cacheable; Bash one-liners trigger extra permission prompts that cannot be cached. Save Bash for what it is uniquely good at — actually running things, like your tests or a build.
| Guide says | Current primary | Also valid |
|---|---|---|
tool_choice is auto, any, or a named tool | Four modes. none is the fourth — no tools this turn, text only, and the default when no tools are provided. | With extended thinking enabled, only auto and none are valid; forcing any or a named tool returns an API error. disable_parallel_tool_use: true with any or tool forces exactly one call. |
| Error categories: transient, validation, business, permission | Unchanged as a reasoning framework | Live code also uses finer labels — not_found, rate_limit, auth. Judge an option on the retry decision it implies, not on the label. |
MCP servers live in .mcp.json or ~/.claude.json | Three scopes: local (this project, just you, default), project (.mcp.json, committed), user (all your projects). Precedence local > project > user. | Parent .mcp.json files merge in from sub-folders. ${VAR:-default} supplies a fallback. /mcp reports status. |
| Six built-in tools | Still the six that matter for the exam: Read, Write, Edit, Bash, Grep, Glob | The real roster is larger — WebFetch, WebSearch, AskUserQuestion, ExitPlanMode, PowerShell on Windows, plus every MCP tool. If an option names one of those, it is not automatically wrong; judge it on fit. |
Read plus Write is the Edit fallback | Unchanged, but it is the last resort | First widen the anchor text, or use replace_all. Edit requires a prior Read and an exact, unique match. |
Your second priority. This domain is almost entirely which file, which scope, which flag — memorisable, and therefore the cheapest points on the paper. Learn the file map until it's reflex.
CLAUDE.local.md below project; the merge rule is unchanged, so a hierarchy question still answers the same way.| Level | Path | Shared via version control? | Use for |
|---|---|---|---|
| User | ~/.claude/CLAUDE.md | No — applies only to that user | Personal preferences |
| Project | .claude/CLAUDE.md or root CLAUDE.md | Yes | Team-wide standards everyone must get |
| Directory | CLAUDE.md in a subdirectory | Yes | Conventions for one area, bound to that directory |
@import references external files so CLAUDE.md stays small — each package imports the standards files its maintainers judge relevant..claude/rules/ holds topic-specific rule files (testing.md, api-conventions.md, deployment.md) as the alternative to a monolithic CLAUDE.md./memory is the keyed answer for inspecting memory files. Currency Today /memory lists locations, opens files for editing and toggles auto memory, while /context is what reports which files actually loaded this session. Answer /memory on the exam; reach for /context in practice. | Artefact | Project scope (shared) | User scope (personal) |
|---|---|---|
| Slash commands | .claude/commands/ | ~/.claude/commands/ |
| Skills | .claude/skills/<name>/SKILL.md | ~/.claude/skills/ |
| MCP servers | .mcp.json | ~/.claude.json |
| Instructions | .claude/CLAUDE.md / root CLAUDE.md | ~/.claude/CLAUDE.md |
"Available to every developer when they clone or pull" is always the project-scoped .claude/ directory. And .claude/config.json with a commands array does not exist — it's a recurring Doesn't exist distractor.
---
name: analyze-codebase
description: Maps module structure and dependencies.
context: fork # run in an isolated sub-agent context
allowed-tools: Read, Write, Grep # restrict tools during the skill
argument-hint: <module-path> # prompt for a missing parameter
disable-model-invocation: true # only you can trigger it (e.g. /deploy)
---
| Field | Solves |
|---|---|
context: fork | Verbose or exploratory output polluting the main conversation — codebase analysis, brainstorming alternatives |
allowed-tools | Preventing destructive actions during skill execution — e.g. limit to file writes. Keyed as a restriction. Real behaviour, confirmed in current docs: it pre-approves the listed tools for the invoking turn and does not block the others. disallowed-tools is the field that actually removes tools. Answer as the guide keys it. |
argument-hint | Developers invoking the skill with no arguments |
Skills vs CLAUDE.md: skills are on-demand, for task-specific workflows. CLAUDE.md is always loaded, for universal standards. If the stem needs something applied automatically, skills are the wrong instrument — they need invocation.
Personal customisation of a team skill: create a variant in ~/.claude/skills/ under a different name, so teammates are unaffected.
# .claude/rules/testing.md
---
paths: ["**/*.test.tsx", "**/*.test.ts"]
---
Use React Testing Library. One assertion per test. Mock at the network boundary.
Button.test.tsx beside Button.tsx) are the canonical case: a directory-bound CLAUDE.md can't cover files scattered across the tree.paths: ["terraform/**/*"], paths: ["src/api/**/*"].Monolith → microservices. A library migration touching 45+ files. Choosing between integration approaches with different infrastructure needs.
A single-file bug fix with a clear stack trace. Adding one date-validation conditional.
Combine them: plan mode for investigation, then direct execution to implement the planned approach.
Explore subagent: isolates verbose discovery output and returns a summary — the answer when a multi-phase task risks exhausting the context window during discovery.
| Situation | Technique |
|---|---|
| Prose description of a transformation keeps being interpreted differently | 2–3 concrete input/output examples — the most effective communication device here |
| You want progressive convergence on behaviour | Test-driven iteration: write the suite first (expected behaviour, edge cases, performance), then iterate by sharing failures |
| Unfamiliar domain; you don't know what you don't know | Interview pattern — have Claude ask questions to surface considerations (cache invalidation, failure modes) before implementing |
| Edge case handled wrongly, e.g. nulls in a migration script | Specific test case with example input and expected output |
| Several issues, and the fixes interact | One detailed message containing all of them |
| Several independent issues | Fix sequentially |
claude -p "Review the diff for security issues" \
--output-format json \
--json-schema ./review-schema.json
| Flag | Does |
|---|---|
-p / --print | Non-interactive: process the prompt, print to stdout, exit. The fix for a hanging CI job. |
--output-format json | Machine-parseable output |
--json-schema | Enforces the shape of that output, so findings can post as inline PR comments |
Doesn't exist --batch, CLAUDE_HEADLESS=true. And < /dev/null is a Unix workaround, not the documented mechanism.
They merge into one working context rather than one replacing another, with enterprise policy sitting above all three. On a conflict the more specific or later level wins: your personal file says two-space indents, the project says four, the project wins. Path-specific rules are appended last, so they win over both.
Keep it lean. Roughly 200 lines is the guidance — a bloated CLAUDE.md measurably reduces adherence. Keep the pitfalls and conventions that differ from defaults, and the why behind a rule. Cut anything Claude can work out for itself: folder layout, dependency lists.
Typing # at the start of a message quick-adds a rule; Claude asks which memory file to save it to. And note @import keeps the file organised but everything still loads at launch, so it does not shrink your context.
The filename becomes the command and the body is the prompt. $ARGUMENTS drops whatever you typed after the command name into the prompt, so fix-issue.md invoked as /fix-issue 123 receives 123.
| Command frontmatter | Does |
|---|---|
description | Shows in /help, and lets Claude auto-suggest the command when your request matches it |
argument-hint | Autocomplete hint for the input |
allowed-tools | Pre-approves the tools it needs |
model | Pin a cheaper or faster model for this command |
Commands have been merged into skills. A .claude/skills/<name>/SKILL.md also creates /name, adds a folder for supporting files, and can be auto-discovered so Claude invokes it when relevant rather than only when you type it. On a name clash between a command and a skill, the skill wins. Use disable-model-invocation: true for side-effect commands such as /commit or /deploy so Claude never fires them on its own.
.claude/rules/*.md and .claude/CLAUDE.md load at the same priority — rules are simply a tidier way to split the same content. With a paths: glob a rule is conditional and loads only for matching files; without one it loads every session. Mix both: unconditional files for project-wide conventions, path-scoped files for area-specific ones.
It is not a polite request. Plan mode blocks file-modifying tools at the tool level — Claude reads, searches and drafts a numbered plan, and Write and Edit cannot fire until you approve.
| Trigger | Notes |
|---|---|
| Shift+Tab twice | Cycles Default → Auto-Accept → Plan; the status line shows the mode |
/plan | Type it in the prompt |
--permission-mode plan | Start the session in plan mode — also works with headless -p runs |
The plan loop: Explore → Plan → Approve → Execute → Verify. You can edit the plan before approving, and fixing a plan is cheap because nothing has been built yet.
Why planning pays: small decisions compound. Twenty unguided choices at 80% accuracy each leaves you around 1% likely to be right throughout. A plan catches the wrong turns before they cost anything.
The Explore subagent is a read-only scout limited to Read, Grep and Glob, working in a separate context window; only the findings return to your main session.
claude -p runs to completion, prints the result, and exits with a status code your pipeline can branch on. Output formats are text (default), json and stream-json for real-time consumption. The json form returns the result plus metadata such as cost and session id, which you parse with jq; --json-schema forces an exact shape into structured_output.
| Guard | Why it matters unattended |
|---|---|
--max-turns | Caps how much work a stuck run can do |
--allowedTools | Narrows permissions for the automated context |
--max-budget-usd | Caps cost — nobody is watching at 3am |
And check the output content, not just the exit code. A run can exit zero having produced nothing useful.
Domain 3 has drifted the most of any domain, because Claude Code ships weekly. Every row below has an exam answer that is still keyed and a current answer that is different. has the full detail; ranks the alternatives.
| Guide says | Current primary | Also valid / deprecated but working |
|---|---|---|
Shared commands go in .claude/commands/<name>.md | .claude/skills/<name>/SKILL.md — commands were merged into skills in v2.1.3. A skill also creates /name. | .claude/commands/*.md keeps working with the same frontmatter and is not removed. On a name clash the skill wins. A plugin is the packaged form when you want to ship skills, agents, hooks and MCP servers together. |
allowed-tools restricts a skill's tools | disallowed-tools removes tools while the skill is active. allowed-tools pre-approves for the invoking turn only. | For a hard block use deny rules in permission settings; for autonomous firing use disable-model-invocation: true or a Skill(name) deny rule. |
| Three SKILL.md frontmatter fields | Twenty. Beyond context, allowed-tools and argument-hint: when_to_use, arguments, disallowed-tools, user-invocable, disable-model-invocation, model, effort, agent, background, hooks, paths, shell, metadata. | Only name, description, license, compatibility, metadata and allowed-tools are portable outside Claude Code, per the Agent Skills standard. |
| Three memory levels | Four, plus a second system. Managed policy sits above user; CLAUDE.local.md sits below project; and auto memory is a parallel store Claude writes itself. | The merge-then-most-specific-wins rule is unchanged, so a hierarchy question still answers the same way. ~/.claude/rules/ gives user-level rules, loaded before project rules. |
/memory shows what loaded | /context shows what loaded, under Memory files. | /memory lists locations, opens files and toggles auto memory. /doctor audits the setup and proposes CLAUDE.md trims. The InstructionsLoaded hook traces loading precisely. |
.claude/rules/ with paths: for cross-cutting conventions | Unchanged and still the primary answer | Skills now accept paths too, with the same glob format, but they gate auto-loading of a procedure rather than always-on conventions. Rules also gained recursive discovery, symlinks and brace expansion. |
Plan mode via Shift+Tab, /plan, --permission-mode plan | Unchanged, and it genuinely blocks file-modifying tools | Plan is one of six permission modes: default, acceptEdits, plan, auto, dontAsk, bypassPermissions. |
CI: -p, --output-format json, --json-schema | All current and all correct | Add --max-turns, --max-budget-usd, --allowedTools, --bare (skip discovery of hooks, skills, plugins, MCP and CLAUDE.md for reproducible scripts), --append-system-prompt, --effort. Session flags: -c, -r, --session-id. |
| AGENTS.md is not mentioned | Claude Code reads CLAUDE.md, not AGENTS.md | If your repo has one, import it (@AGENTS.md) or symlink it. /init also reads Cursor and Copilot rule files; /import brings another agent's configuration across. |
.claude/commands/ and does not offer skills, choose it. If it offers both, choose the one the stem's language points at — a stem written from the guide will say "custom slash command", and the commands directory is the intended answer. Nothing here changes the underlying judgment being tested: project scope for shared, user scope for personal, glob rules for cross-cutting, hooks for guarantees.
Specific categorical criteria beat vague instruction, every time.
| Works | Doesn't |
|---|---|
| "Flag comments only when the claimed behaviour contradicts the actual code behaviour" | "Check that comments are accurate" |
| "Report bugs and security issues; skip minor style and locally-consistent patterns" | "Be conservative" / "only report high-confidence findings" |
| Severity definitions with a concrete code example per level | Severity adjectives with no anchor |
Trust dynamics: one high-false-positive category poisons confidence in the accurate ones. The keyed tactic is to temporarily disable the noisy category to restore trust while you improve its prompt — not to bury it behind a confidence filter.
Few-shot is the answer when detailed instructions alone produce inconsistent results. Use 2–4 targeted examples, aimed at the ambiguous cases, and show the reasoning for choosing one action over a plausible alternative.
tool_use and JSON schemastool_use with a JSON schema is the most reliable route to schema-compliant output: it eliminates JSON syntax errors. It does not eliminate semantic errors — line items that don't sum, values in the wrong field.
{ name: "extract_invoice",
input_schema: {
type: "object",
properties: {
invoice_number: { type: "string" },
po_number: { type: ["string", "null"] }, // nullable: may be absent
category: { type: "string", enum: ["goods","services","other","unclear"] },
category_detail:{ type: ["string", "null"] }, // pairs with "other"
stated_total: { type: "number" },
calculated_total:{ type: "number" } // semantic cross-check
},
required: ["invoice_number", "stated_total"]
} }
"other" + detail string for extensible categories; "unclear" for genuine ambiguity.Retry with error feedback: the follow-up request includes the original document, the failed extraction, and the specific validation error.
| Error type | Retry helps? |
|---|---|
| Format mismatch, structural output error | Yes |
| Semantic error (values don't sum, wrong field) | Yes, with the specific error stated |
| Required information is absent from the source (it lives in another document you didn't provide) | No. Retrying cannot invent it. This is a schema/nullable or sourcing problem. |
Self-correcting validation design: extract calculated_total alongside stated_total to flag discrepancies; add a conflict_detected boolean for inconsistent source data.
Feedback-loop instrumentation: add a detected_pattern field to every finding so that when developers dismiss findings you can analyse which code constructs trigger false positives.
| Message Batches API | Fact |
|---|---|
| Cost | 50% savings |
| Latency | Up to a 24-hour window, no guaranteed SLA |
| Correlation | custom_id pairs request to response — so "result ordering" is a non-issue |
| Tool calling | No multi-turn tool calling within a request — it can't execute tools mid-request and feed results back |
Fit: non-blocking, latency-tolerant — overnight reports, weekly audits, nightly test generation. Misfit: anything a human is waiting on, especially a blocking pre-merge check. "Batches are often faster than 24h" is not an acceptable basis for a blocking workflow.
custom_ids, with modifications — chunk documents that exceeded context.| Level | Meaning | Anchor example |
|---|---|---|
| Critical | Blocks the release | A hard-coded password |
| Major | Fix soon | Missing error handling |
| Minor | Nice to fix | An inconsistent name |
Without severity a typo and a security hole look equally urgent, and the important issue gets buried. The mirror term for a false positive is a false negative — missing a real issue. Both hurt; false positives are the trust-killer. The deck's worked contrast: "review this code" yields 15 flags, mostly style noise, and the team ignores all of them; criteria plus severity plus a tuned category yields 3 flags — one critical, two major — and the team acts. The good reviewer finds fewer things.
Shot just means example. Zero-shot is instructions only, one-shot is one example, few-shot is several. Practical parameters from the deck: typically 2–5 examples, stopping when accuracy plateaus; keep every example's format identical, since inconsistent formatting confuses the pattern; and place the examples before the real input. Always include one case where the correct answer is "not specified" or null, or Claude infers it must always produce a value and fabricates.
The keyed pattern is a tool whose input_schema describes your fields; Claude "calls" the tool and its answer is the tool input, so you read a clean tool_use block instead of prose. Two operational details: a malformed schema is rejected up front with a 400 before Claude even runs, so validate the schema first; and left on auto, Claude may skip the tool and hand you prose — use any or a forced named tool when you need the guarantee.
— native structured outputs now exist on the platform. The guide keys forced tool use; answer that way.
Extract → validate → feedback → re-validate → escalate at the cap. Common semantic checks: do the line items sum to the total, is the date real and in range, and does every extracted value actually appear in the source document (the fabrication check).
Cap the retries at roughly 2–3, then flag for a human or mark the record low-confidence. No cap is an infinite loop spending money on an input Claude may be unable to fix. The deck's worked case: line items of 2,000 and 2,800 with a stated total of 5,000 — the JSON was valid both times, and only the validation step caught it. One retry carrying "the sum is 4,800" fixed it.
| Property | Value |
|---|---|
| Discount | 50% off input and output tokens, with a separate rate-limit pool |
| Latency | Results within 24 hours, often minutes to hours. No SLA, no streaming. |
| Size | Up to roughly 100,000 requests or 256 MB per submission — split huge jobs into sequential batches |
| Workflow | Submit → poll (or webhook) → retrieve as JSONL matched by custom_id → save |
| Retention | Results kept only about 29 days — persist them immediately |
| Limit | No multi-turn tool calling within a request |
The decision rule in one line: is it acceptable for the consumer to get this within 24 hours? Yes means batch; no means the synchronous API.
Merge, don't concatenate. De-duplicate overlapping findings, keep the highest severity where two passes disagree, and group by confidence for routing. Two passes reporting the same issue must appear once, at its true severity, or you have recreated the trust problem from 4.1. Confidence itself is reported as high, medium or low on each finding.
| Guide says | Current primary | Also valid |
|---|---|---|
There is no dedicated JSON mode; forced tool_use plus a schema is the most reliable route | Structured outputs, now GA: output_config: {format: {type: "json_schema", schema: {…}}}. The schema compiles to a grammar and constrains generation token by token. | Strict tool use — strict: true on a tool definition — when the model must act rather than just return data. Forced tool_use with input_schema remains correct, and remains the exam answer. |
Nullable fields prevent fabrication; enums need "other" and "unclear" | Entirely unchanged, and now more important | Grammar-constrained generation makes the schema binding, so a badly designed required field forces the model into fabrication with no escape at all. Schema design is the fix either way. |
| Schemas guarantee shape, not meaning | Still exactly true | Structured outputs guarantee the response matches your schema. They do not guarantee the values are correct. The 4.4 validation loop is unaffected by anything in this row. |
| Batch: 50% cheaper, up to 24 hours, no SLA | All correct. Add the precise ceilings: 100,000 requests or 256 MB per batch, 413 above that. | Most batches complete within an hour; 24 hours is the expiry, not the expectation. Results are downloadable for 29 days from creation. Batches are workspace-scoped. One request failing does not affect the others. |
| Few-shot: 2–4 targeted examples | 2–5 is the current guidance; stop when accuracy plateaus | Identical formatting across examples, placed before the real input, with one missing-data case included. Unchanged in substance. |
| Extended thinking is out of scope | Mostly still true for the exam | Two things now intersect Domain 4: extended thinking cannot be combined with forced tool_choice, and adaptive thinking plus effort levels (low to max) have replaced manual thinking budgets on newer models. |
| Escalate | Do not escalate |
|---|---|
| Customer explicitly asks for a human — immediately, without investigating first | Merely complex cases you can actually handle |
| Policy is ambiguous or silent on the request (competitor price matching when policy only covers own-site adjustments) | Standard damage replacement with photo evidence |
| Cannot make meaningful progress | Frustrated customer with a resolvable issue — acknowledge the frustration, offer resolution, escalate only if they reiterate |
{ status: "error",
failure_type: "timeout",
attempted: "web_search: 'AI adoption in film post-production 2024'",
partial_results: [ /* 3 of 12 sources retrieved */ ],
alternatives: ["narrower query", "try industry-report source"] }
That structure is what lets the coordinator choose: retry modified, try an alternative, or proceed with partial results and annotate the gap.
/compact reduces context usage mid-session when the window has filled with discovery output.There is no consolidated Domain 5 slide deck in this project — the other four domains each have one, Domain 5 does not. Everything above is drawn from the exam guide plus the six individual Domain 5 lecture decks (5.1 conversation context, 5.2 escalation, 5.3 error propagation, 5.4 codebase context, 5.5 human review, 5.6 provenance), all of which are captured rule by rule in the .
Practical consequence: Domain 5 is the one domain where you have slightly less material than the others, and it is also the smallest at 15%. Do not over-invest here. The six task statements are highly formulaic — each has one canonical fix, listed above — so the recall drills are a more efficient use of your time than re-reading.
Domain 5 is the most durable of the five, because it teaches judgment rather than configuration. Almost nothing here has drifted — which is a reason to trust the time you spend on it.
| Guide says | Status |
|---|---|
| Claude is stateless; pass the full history every call | Unchanged. |
| Case-facts block outside the summarised history | Unchanged, and now complemented by auto memory, which persists learnings across sessions in MEMORY.md — a store Claude writes, not you. |
| Lost-in-the-middle; lead with key findings | Unchanged. |
| Three escalation triggers; never sentiment or self-confidence | Unchanged. |
| Structured error context for coordinator recovery | Unchanged. |
Scratchpad files, subagent delegation, /compact | All current. /compact now also has documented survival rules: the project-root CLAUDE.md is re-read from disk and re-injected after compaction, whereas nested CLAUDE.md files and path-scoped rules are not re-injected until Claude next touches a matching file. |
| Crash recovery via exported state and a manifest | Unchanged as a pattern. Sessions also have /rewind checkpoints now, though a backgrounded fork's edits sit outside them. |
| Segment accuracy before automating; calibrate confidence; stratified sampling | Unchanged. This is measurement discipline, not product surface. |
| Claim-to-source mapping, dates, settled vs contested | Unchanged. |