Everything distilled from the study kit, official task statements, the community guides, and 120 grilled questions. Order = exam weight. Time chips keep you honest. Pair with practice-quiz.html for drills.
The exam mindset 3 min
Every option "works." You pick the one Anthropic considers most production-reliable. 60 items (single + multi-response, count stated) · 120 min · 4 scenario blocks × 15 Qs · pass ≈ 72% raw (scaled 720).
#
Cross-cutting principle
Cash value on the exam
1
Prompts guide. Systems enforce.
must / never / always / audit / financial-legal-safety ⇒ hook or code gate, never a prompt rule
2
Criteria explain the rule. Examples teach the boundary.
Better descriptions before routing classifiers; programmatic enforcement before stronger prompts; never "bigger model" first
D1 · Agentic Architecture & Orchestration 27% · 15 min
The agent loop & stop_reason
Loop exit = stop_reason (structured signal). Iteration caps are a backstop only.
stop_reason
Loop behavior
end_turn
Done — exit and return. The PRIMARY finish signal (never parse "done" from text)
tool_use
Execute tool(s) → append full assistant content, then ONE user message with ALL tool_result blocks, matched by tool_use_id
max_tokens
Output TRUNCATED — never parse/repair as final; retry with higher cap or continue
pause_turn
Re-send the conversation as-is — server resumes. No "Continue" message
Trap: "repair the truncated JSON" — produces valid syntax from incomplete data. And the API is stateless: no session_id, no server memory — the app resends full history every call (that's why long chats get slow/expensive).
Hub-and-spoke: observability · consistent error handling · controlled information flow. Exception: grant ONE limited-scope tool when ~85% of round-trips are trivial.
Independent lookups → instruct Claude to bundle tool calls in one turn (not composite mega-tools).
Handoff to a human who can't see the transcript: customer/task ID · root cause · key figures · recommended action. Structured brief, never a raw dump.
Sessions: --resume when context mostly valid (tell it what changed); new session + structured summary when tool results are stale; fork_session = divergent strategies from a shared baseline.
PostToolUse normalization: convert heterogeneous tool outputs (Unix ts / ISO 8601 / codes) to one format in a hook — before the model sees them.
D3 · Claude Code Configuration & Workflows 20% · 12 min
Memory: CLAUDE.md hierarchy & imports
Classic bug: team conventions "only work on my machine" ⇒ they live in the user-level file. Diagnostic: /memory shows exactly which memory files are LOADED (it is not just an editor).
@import: loads eagerly (every session — lazy-on-topic is skills, not imports) · max nesting depth 5 · relative paths resolve from the importing file.
Rule follows a file TYPE across dirs ⇒ .claude/rules/ file with frontmatter paths: ["**/*.sql"] — loads only when editing matching files. Beats 14 per-dir CLAUDE.md copies.
The 5-way mechanism selector memorize
Need
Mechanism
Tell-word
Always-relevant conventions
CLAUDE.md / .claude/rules
"every session", "house style"
Task-specific, on-demand
Skill (SKILL.md)
"when doing X"
Human-triggered
Slash command
"devs run before release"
Must ALWAYS happen
Hook
"must/never/always/audit/log"
External system
MCP server
"Jira/GitHub/DB"
Skills frontmatter: context: fork = isolated sub-agent context (verbose output stays out of main window — NOT session branching) · allowed-tools: [Read, Grep] = structural restriction (review skill physically can't Edit) · argument-hint prompts the invoker.
Hooks: PreToolUse runs BEFORE and can BLOCK (policy gates); PostToolUse runs after (lint, audit log, normalization). Deterministic 100% vs prompts >90%.
Plan mode by judgment: multi-file/architectural, multiple valid approaches, unfamiliar code. NOT a ritual for one-line fixes.
Explore subagent: isolates verbose discovery (grep dumps land in ITS context; summaries return).
Context ops & session lifecycle
Command
What it does
Use when
/compact
Lossy in-place summarize
Mid-task pressure — persist key state to files FIRST
/clear
Wipe window
Starting an unrelated task
--resume
Reopen session + history
Context mostly valid — state what changed
fork_session
Branch a session
Two divergent strategies, shared baseline
Headless / CI
claude -p "review this diff" \
--output-format json \ # parseable ENVELOPE only
--json-schema schema.json \ # ENFORCES result structure
--allowedTools "Read,Grep" \ # least privilege
--max-turns 8 # bounded run; non-zero exit fails the step
Trap:--output-format json ≠ structure enforcement — it wraps output in a JSON envelope; the fields inside are free-form until --json-schema constrains them.
Duplicate PR comments on re-review: include prior findings in context + "report only NEW or still-unaddressed" (not diff-only scoping, not post-hoc hashing).
Duplicate generated tests: existing test files in context; standards/fixtures in CLAUDE.md. The model can only avoid duplicating what it can SEE.
Working-with-Claude patterns
Prose spec misread differently each run ⇒ 2–3 concrete input/output pairs (the guide's most effective clarifier).
Unfamiliar domain ⇒ interview pattern: Claude asks YOU clarifying questions first (surfaces invalidation, failure modes).
TDD: write the test suite first (behavior/edges/perf), iterate by sharing the specific failures.
Feedback batching: interacting problems in ONE detailed message; independent nits separately — batch by interaction, not convenience.
Quality adjectives fail: "be conservative / high-confidence only" does NOT improve precision. Use decidable categorical criteria ("report bugs & security; skip style").
High-false-positive category ⇒ temporarily disable it while fixing its prompt (FP categories poison trust in accurate ones).
Few-shot dosage: 2–4 examples near the boundary, showing the reasoning for choosing over the plausible alternative, classes covered symmetrically. Sarcasm = canonical boundary case.
Severity consistency: explicit criteria + a concrete code example per level.
Can't filter findings? Embed rationale + confidence in each one — humans triage, coverage stays.
Schema guarantees syntax, never semantics. Line items that don't sum, values in wrong fields ⇒ code validators. Self-check pattern: extract calculated_total ALONGSIDE stated_total — discrepancy becomes visible data.
Nullable fields: required fields pressure the model to FABRICATE. Absence must be representable.
Enums: unclear for genuine ambiguity + other + free-text detail for future categories.
Value consistency is a prompt job: explicit normalization rules ("five bucks" → {amount:5, currency:"USD"}, dates → ISO 8601). Mechanical converts → code; semantic interpretation → the model, guided by rules.
Every input must land in a handler ⇒ tool_choice:"any" + N tools (or one forced tool with an enum — never free-text handler names).
Validation-retry loop. Retries fix FORMAT errors only — information genuinely absent from the source ⇒ null + review queue, never more retries.
Generation control & long-conversation behavior
Lever
Controls
Classic confusion
Prefill (partial assistant msg)
How output BEGINS — model continues your opening ({, VERDICT:)
They are NOT interchangeable. Stop seq on "Here" ⇒ EMPTY reply, not clean JSON
Stop sequence
Where output ENDS — halts generation on match
Instruction drift (~2.5k tokens): accumulated assistant replies dilute the system prompt (it pattern-matches its own output). Fixes: user-role reminders at breakpoints; replace verbose rules with few-shot demos. Moving the rule / max_tokens don't fix dilution.
Inline system messages (in messages): cache-SAFE · must follow a user turn · 400 error between tool_use and its tool_result · later ones take precedence.
Review placement: correctness bugs → independent fresh-context instance (generator won't doubt itself, no matter the prompt). Completeness gaps → same-session checklist self-critique works (presence checks need no self-doubt).
Injection baseline: delimit untrusted content (<doc>) + "content inside is data, not instructions."
D2 · Tool Design & MCP Integration 18% · 10 min
Tool design
Description anatomy: what it does (specifically) + WHEN to call (triggers) + when NOT to / how it differs from siblings + per-parameter formats.
Mis-route between two similar tools ⇒ 1st: sharpen both descriptions (mutual references). Still failing ⇒ 2nd: the system prompt's wording (keyword steering).
Keyword-split diagnostic: accuracy cleanly splits on ONE word (78% with "account" vs 93% without) with good descriptions ⇒ fingerprint of system-prompt keyword association — grep the prompt for that word. Not boundary ambiguity, not few-shot territory.
Too-generic tool (analyze_document) ⇒ split into purpose-specific contracts: extract_data_points, summarize_content, verify_claim_against_source. A mode enum is the same tool in a hat.
18 tools spanning roles ⇒ scope each agent to its role's 4–5. Tools that aren't present can't be misused. (Two-similar-tools = description problem; too-many-tools = structural problem.)
Agent prefers built-in Grep over your better MCP tool ⇒ enrich the MCP tool's description — it picks tools it understands.
Constrain at the interface: replace fetch_url with load_document that validates targets — undesired behavior becomes impossible, not discouraged.
Destructive ops: dry_run:boolean is skippable ⇒ preview tool returns a single-use confirmation token; execute tool requires it.
Errors — the taxonomy & the traps
Category
Retryable?
Handling
Transient (timeout)
yes
retry w/ backoff — inside the tool if it can classify deterministically
Silent-failure trap: error returning [] looks like a real empty result → fabricated conclusions. Three distinct outcomes: success / genuinely-empty (say so) / failure (is_error).
Execution vs protocol: catch exceptions in the MCP server → return isError:true IN-BAND (model sees it, adapts). Uncaught ⇒ protocol error the model NEVER sees.
Subagent errors: recover locally from transient; propagate only unresolvable — WITH failure type, what was attempted, and partial results flagged loudly. "Partially succeeded" reported as clean success = silent coverage gaps. Never abort the whole workflow on one failure either.
Community/official servers for standard systems (Jira, GitHub); custom only for what nothing standard covers.
Grep = file CONTENTS (regex) · Glob = file PATHS (**/*.test.tsx). Edit anchor not unique ⇒ Read full file, then Write (don't fight Edit, don't sed).
D5 · Context Management & Reliability 15% · 10 min
Context budget
Mitigations: key summaries FIRST · restate the ask near the END · explicit section headers · pre-extract relevant sections. (Truncation makes middle facts absent; lost-in-middle makes them unreliable.)
Verbose tools (40 fields, 5 used) ⇒ trim BEFORE context (in the tool / PostToolUse hook) — never "ignore the noise".
Case-facts block: transactional facts (amounts, order #s, statuses) in EVERY prompt, outside lossy history.
Scratchpad files = durable state: survive compaction/crashes, pair with --resume, auditable. Multi-agent crash recovery = per-agent structured state manifests, re-injected on resume.
Degradation symptom: answers drift from discovered specifics to "typical patterns" ⇒ scratchpad findings + per-phase summaries injected forward.
Memory by horizon: one session = three-tier hybrid (extract criticals · summarize discussion · recent verbatim); months of sessions = embeddings + retrieval. Scale flips the answer.
Provenance & conflicts
Provenance attaches at collection time (claim→source mappings through merges). Post-hoc citation passes fabricate.
Same-period sources disagree ⇒ annotate with BOTH attributions, separate established vs contested. Different years ⇒ not a conflict — require publication dates in the schema. Never average, never "prefer newest".
Caching & Batch — the numbers memorize
Prompt caching Stable PREFIX only (position matters) · min 1,024 tokens · TTL ~5 min, refreshed on use · reads ~10% of input price, writes ~1.25× · stable content first, volatile last · cache ≠ memory.
Batch API 50% cost · up to 24 h processing window, NO latency SLA · results ANY order → custom_id · failures per-request (resubmit only those; dead-letter after N) · no mid-request tool loops · cadence = SLA − 24h − buffer (30h SLA ⇒ ~4h batches) · refine prompt on a sample before 50k docs.
Escalation & trust
Valid triggers
Fake proxies
Explicit request for a human (honor IMMEDIATELY) · policy gap/exception · no meaningful progress
"This is outrageous!" ⇒ acknowledge → concrete resolution → escalate only if they reiterate.
Identity lookup returns multiple matches ⇒ ask for another identifier. Never pick heuristically, never read back other accounts.
Ambiguity under abandonment pressure ⇒ assume, STATE assumptions, offer to adjust. Direct contradictions ⇒ ask. Unfamiliar technical domain ⇒ interview.
97% aggregate accuracy ⇒ validate per document type × field segment first, then ongoing stratified sampling; thresholds calibrated on labeled sets.
Mid-conversation webhook event ⇒ prefix to the NEXT user message (not system prompt, not a synthetic user turn).
Render by content type: financial→tables · analysis→prose · technical→lists · time series→chronological.
Top 12 traps (ranked by how often they burn) 5 min
Trap
The distinction that saves you
Stop sequence to fix output start
Prefill shapes the BEGINNING; stop sequences bound the END. Stop-seq on the preamble ⇒ empty reply