1 of 1 Pages
C
Complete Self-Study Guide

Claude Certified Architect
Foundations

A standalone course, coursework, worked examples, and practice exams covering the Claude Agent SDK, the Claude API, Model Context Protocol, and Claude Code: everything on the official exam blueprint.
Exam CCAR-F  ·  5 Domains  ·  60 Questions  ·  120 Minutes
60 exam items across 5 domains  ·  4 of 6 official scenarios drawn per sitting
Pass: 720 / 1000 scaled  ·  Edition July 2026
Built from the official Claude Certified Architect – Foundations Exam Guide (v1.0, July 2026). Unofficial study aid.
Contents

Table of Contents

Click any entry to jump straight to it. You can also use the sidebar on the left at any time, filter chapters with the search box, and move with the / arrow keys.

Chapter 1

How to Use This Guide

This is a self-contained study package. You do not need any other document to prepare for the exam: everything you need to learn the material is written out in full below: concepts, working examples, common failure modes, and practice questions with explanations. The only things this guide can't replace are hands-on repetitions with the actual Claude Agent SDK, Claude Code, and Claude API: the exam is written to test judgment that comes from having actually built with these tools, so treat the "Hands-On Exercises" in each domain as mandatory, not optional.

The guide is organized as:

  1. Exam overview: format, scoring, logistics (this section)
  2. A structured learning plan: a suggested schedule
  3. Five domain chapters: one per exam domain, each covering every task statement in depth, with worked examples and domain-specific practice questions
  4. Deep walkthroughs of all 6 official exam scenarios
  5. The 12 official sample questions (reproduced from the exam guide with explanations) plus a 50-question original practice exam with a full answer key
  6. Quick-reference cheat sheets: one page per domain for final review
  7. A footnote of external resources for further study
  8. Five appendices: a technical-foundations reference (the concrete API/SDK/MCP/Claude Code artifacts you must recognize on screen), consolidated tradeoff decision tables, a guide to reading exam questions and eliminating distractors, a full glossary, and an exam-readiness self-assessment checklist
Chapter 2

1. Exam Overview

1.1 What This Certification Validates

The Claude Certified Architect - Foundations certification validates that you can make informed decisions about tradeoffs when implementing real-world solutions with Claude. It is scenario-based and judgment-heavy. It is not a trivia test about API syntax. It tests foundational knowledge across four technology areas:

  • Claude Code: the CLI-based coding agent and its configuration system
  • The Claude Agent SDK: the framework for building autonomous and multi-agent systems
  • The Claude API: the underlying Messages API, tool use, and structured output mechanisms
  • Model Context Protocol (MCP): the standard for exposing tools and resources to Claude

Questions are grounded in realistic production scenarios: a customer support resolution agent, a multi-agent research pipeline, Claude Code integrated into CI/CD, developer productivity tooling, and structured data extraction. You're expected to reason about architecture, configuration, and tradeoffs the way an experienced solution architect would, not just recall facts.

1.2 Intended Candidate

The ideal candidate has 6+ months of hands-on experience:

  • Building agentic applications with the Claude Agent SDK (multi-agent orchestration, subagent delegation, tool integration, lifecycle hooks)
  • Configuring Claude Code for teams (CLAUDE.md, Agent Skills, MCP integrations, plan mode)
  • Designing MCP tool/resource interfaces for backend integration
  • Engineering prompts for reliable structured output (JSON schemas, few-shot examples, extraction patterns)
  • Managing context windows across long documents, multi-turn conversations, and multi-agent handoffs
  • Integrating Claude into CI/CD for code review, test generation, PR feedback
  • Making escalation and reliability decisions (error handling, human-in-the-loop, self-evaluation)

1.3 Exam Details at a Glance

ItemDetail
CredentialClaude Certified Architect - Foundations
Exam codeCCAR-F
Number of items60
Item formatMultiple-choice and multiple-response (each item states how many responses to select)
Exam structure4 scenarios drawn at random from a bank of 6
Time limit120 minutes
DeliveryProctored: online proctored or test center
Passing scoreScaled score of 720 on a 100-1,000 scale
Exam fee$125 USD
Validity period12 months from award date
Result reportingPass/fail with scaled score, plus percent-correct by domain

1.4 Exam Blueprint (Content Domains and Weights)

#DomainWeight
1Agentic Architecture & Orchestration27%
2Tool Design & MCP Integration18%
3Claude Code Configuration & Workflows20%
4Prompt Engineering & Structured Output20%
5Context Management & Reliability15%
Total100%

Domain 1 (Agentic Architecture) carries the most weight. Spend proportionally more study time there. Domains 3 and 4 are tied for second. Domain 2 and Domain 5 are lighter but still each represent roughly 1 in 6 (Domain 2) or 1 in 7 (Domain 5) questions. Don't skip them.

1.5 How Scoring Works

◆ Key idea · how scoring works

This is a criterion-referenced exam: you're measured against a fixed performance standard (what a "minimally qualified candidate" should know), not ranked against other test-takers. The cut score (720/1000) was set by a formal standard-setting study. Your score report shows pass/fail plus percent-correct by domain. The domain breakdown is diagnostic only and does not itself determine pass/fail (that's based on total scaled score).

1.6 Exam Logistics

  • Registration: via the Anthropic Partner Academy, delivered through Pearson VUE. Review the Exam Guide, Certification Terms and Conditions, and Certification Exam Policy before registering.
  • Scheduling: create a Pearson VUE account after checkout; choose online proctoring or a test center. You can reschedule/cancel up to 24 hours before your appointment without penalty; changes inside 24 hours forfeit the fee.
  • ID requirement: valid, unexpired, government-issued photo ID matching your registration name exactly.
  • Retake policy: waiting periods of 14 days (after 1st fail), 30 days (after 2nd), 90 days (after 3rd). Maximum 4 attempts per 12-month rolling period. Fee applies each attempt.
  • No-show/late arrival: forfeits the fee; you must re-register.
  • Conduct: proctor/webcam visibility required (online), clear workspace, no communication with others, no capturing/reproducing exam content. Violations can void your result and revoke your credential.
  • NDA: you must accept a confidentiality/non-disclosure agreement before the exam starts; declining ends the session with no refund.
  • Recertification: credential is valid 12 months. On-time renewal = a free, non-proctored assessment reviewing what changed. Lapsed credentials require a full retake at full fee. If exam content changes significantly, Anthropic may require a full retake instead of the lighter renewal path.

1.7 In-Scope vs. Out-of-Scope (per the official guide)

Explicitly tested: agentic loop implementation (stop_reason-driven control flow), multi-agent orchestration (coordinator-subagent, decomposition, parallelism, iterative refinement), subagent context management, tool interface design, MCP tool/resource design and server configuration, error handling/propagation, escalation decision-making, CLAUDE.md configuration hierarchy, custom commands/skills, plan mode vs. direct execution, iterative refinement techniques, structured output via tool_use, few-shot prompting, batch processing, context window optimization, human review workflows, information provenance.

Explicitly out of scope: fine-tuning/training custom models, API authentication/billing/account management, language/framework-specific implementation details, deploying/hosting MCP servers (infra/networking/containers), Claude's internal architecture/training/model weights, Constitutional AI/RLHF, embeddings/vector databases, computer use (browser/desktop automation), vision/image analysis, streaming API implementation, rate limiting/quotas/pricing, OAuth/API key rotation, cloud-provider-specific configuration, benchmarking, prompt caching internals (just knowing it exists is enough), tokenization details.

◆ Tip · stay in scope

If you find yourself deep-diving into any "out of scope" topic while studying, redirect that time to the domains above. It won't pay off on this exam.

Chapter 3

2. Learning Plan

This plan assumes ~6 weeks at 4-6 hours/week (24-36 hours total), which is a reasonable pace for someone who already has some hands-on exposure to Claude but wants to fill gaps and drill scenario-style judgment questions. Compress it into 2-3 weeks if you're already deep in daily use of the Agent SDK and Claude Code; stretch it to 8-10 weeks if you're starting closer to zero hands-on experience.

Week 1 - Domain 1: Agentic Architecture & Orchestration (highest weight, 27%) Read Domain 1 in full below. Build a minimal agentic loop by hand (even a toy one) so the stop_reason lifecycle is intuitive, not memorized. Do Preparation Exercise 1 (multi-tool agent with escalation logic, described in Domain 1 and Domain 5 sections). Answer the Domain 1 practice questions.

Week 2 - Domain 2: Tool Design & MCP Integration (18%) Read Domain 2 in full. Write tool descriptions for 3-4 tools, deliberately including two with overlapping purposes, then rewrite them to disambiguate. Configure a .mcp.json with an environment-variable-expanded token. Do Preparation Exercise 2's MCP portions. Answer the Domain 2 practice questions.

Week 3 - Domain 3: Claude Code Configuration & Workflows (20%) Read Domain 3 in full. Set up a CLAUDE.md hierarchy (user, project, directory) on a real or sample repo. Create at least one path-scoped rule in .claude/rules/ and one skill in .claude/skills/ using context: fork. Practice distinguishing plan-mode-appropriate tasks from direct-execution tasks using the criteria in this guide. Answer the Domain 3 practice questions.

Week 4 - Domain 4: Prompt Engineering & Structured Output (20%) Read Domain 4 in full. Build a small extraction pipeline using tool_use with a JSON schema containing at least one nullable field and one enum-with-"other" field. Implement one validation-retry loop. Answer the Domain 4 practice questions.

Week 5 - Domain 5: Context Management & Reliability (15%) + Scenario Deep Dives Read Domain 5 in full. Read all 6 official scenario walkthroughs below and, for each, try to predict what kinds of questions would be asked before reading the analysis. Answer the Domain 5 practice questions.

Week 6: Integration and Practice Exams Take the 50-question practice exam under timed conditions (aim for ~2 minutes/question to simulate the real 120-minute/60-item pace). Review every missed question against the relevant domain chapter. Re-read the cheat sheets the day before your exam. Do a final pass over the official sample questions and their explanations: these are the closest thing to "released" exam items you have.

◆ Tip · the night before

The night before your exam: review the cheat sheets only. Don't cram new material. This exam rewards pattern recognition built over weeks, not last-minute memorization.

Domain 1 · Chapter 4

Agentic Loops & Multi-Agent Coordination

This is the largest domain and the conceptual core of the exam. It covers how an agent decides what to do next (the agentic loop), how multiple agents coordinate, how context flows between them, how workflows enforce ordering, how hooks intercept the loop deterministically, how work gets decomposed, and how sessions persist and fork. Almost every scenario on the exam touches this domain.

3.1 Task Statement: Design and implement agentic loops for autonomous task execution

◆ Key idea · the agentic loop

The core mental model. An "agent" built on the Claude API is fundamentally a loop:

  1. You send a request to Claude (the conversation so far, plus available tools).
  2. Claude responds. You inspect stop_reason.
  3. If stop_reason == "tool_use": Claude wants to call one or more tools. You execute the requested tool(s) in your own code (or via an MCP server), and you append the tool results back into the conversation as a new message.
  4. You send the updated conversation back to Claude. Repeat from step 2.
  5. If stop_reason == "end_turn" (or another terminal reason such as "max_tokens" or "stop_sequence"): Claude is done producing output for this turn. The loop ends and you return the final response.

This is the entire lifecycle. The critical exam-relevant details:

  • stop_reason is the control signal, not the assistant's text content. The loop continues because stop_reason is "tool_use", not because the text "looks like" it's asking for more information or because the model said something like "let me check that."
  • Tool results must be appended to conversation history as their own message (role "user" with tool_result content blocks referencing the tool_use_id) so that the next API call gives Claude the full context to reason about what to do next. Without this, Claude has no memory of what the tool returned.
  • Model-driven decision-making vs. pre-configured sequences. The agentic loop pattern lets Claude decide which tool to call next based on the current state of the conversation: this is different from a hard-coded decision tree where your application code decides the next step. The power (and the risk) of agentic loops is that the model is in the driver's seat for sequencing, which is why enforcement mechanisms (Task Statement 1.4, 1.5) matter for steps that must not be skipped.

Pseudocode for a correct agentic loop:

messages = [{"role": "user", "content": user_input}]

while True:
    response = client.messages.create(
        model="claude-...",
        max_tokens=4096,
        tools=tool_definitions,
        messages=messages,
    )
    messages.append({"role": "assistant", "content": response.content})

    if response.stop_reason == "tool_use":
        tool_results = []
        for block in response.content:
            if block.type == "tool_use":
                result = execute_tool(block.name, block.input)
                tool_results.append({
                    "type": "tool_result",
                    "tool_use_id": block.id,
                    "content": result,
                })
        messages.append({"role": "user", "content": tool_results})
        continue  # loop again so Claude can see the results

    if response.stop_reason == "end_turn":
        return extract_text(response.content)  # done
◆ Pitfall · loop-termination anti-patterns

Anti-patterns the exam explicitly calls out. Know these cold:

  • Parsing the assistant's natural-language text to decide whether to keep looping (e.g., scanning for words like "done" or "I'll now check…"). Text content is unreliable and not designed as a control signal.
  • Using an arbitrary iteration cap as the primary stopping mechanism. A max-iteration safety valve is fine as a backstop against runaway loops, but it should never be the main way you decide the task is complete, stop_reason is.
  • Checking for the presence of assistant text content as a completion indicator. Claude can emit text alongside tool calls (e.g., "Let me look that up") while stop_reason is still "tool_use": the presence of text doesn't mean the turn is over.

3.2 Task Statement: Orchestrate multi-agent systems with coordinator-subagent patterns

Hub-and-spoke architecture. In a coordinator-subagent design, one coordinator agent is the hub; all subagents are spokes. The coordinator:

  • Decomposes the incoming task into subtasks
  • Decides which subagents to invoke (not all systems need every subagent every time: a query-complexity-aware coordinator dynamically selects a subset)
  • Routes all inter-subagent communication through itself (subagents don't talk directly to each other)
  • Aggregates results from subagents into a final answer
  • Owns error handling for subagent failures (see Domain 5, Task 5.3)

This centralization is a deliberate architectural choice: it gives you a single place to observe, log, and control the system, and a single place to implement consistent error handling and information routing, rather than scattering that logic across every subagent pair.

◆ Key idea · no automatic context inheritance

Subagents have isolated context by default. A subagent spawned by the coordinator does not automatically inherit the coordinator's conversation history. If the synthesis subagent needs the web-search subagent's findings, the coordinator must explicitly place those findings in the synthesis subagent's prompt: there's no implicit shared memory. This is one of the most heavily tested facts in this domain (see Task Statement 1.3).

◆ Exam lens · narrow decomposition

Task decomposition risk: too narrow a scope. A coordinator that decomposes "impact of AI on creative industries" into "AI in digital art," "AI in graphic design," and "AI in photography" has produced three subagents that will each succeed individually while the system fails, because music, writing, and film were never assigned to anyone. This is the single most common root-cause pattern tested in this domain: when subagents "did their job correctly" but overall output is deficient, look first at whether the coordinator's decomposition covered the full scope, not at the subagents.

Skills to internalize:

  • Dynamic subagent selection. Don't always invoke the full pipeline (search → analyze → synthesize → report) regardless of the query. A coordinator should analyze what the query actually requires and invoke only the necessary subagents.
  • Partitioning to minimize duplication. When multiple subagents search or analyze, assign each a distinct subtopic, source type, or angle rather than letting them redundantly cover the same ground.
  • Iterative refinement loops. A coordinator should be able to evaluate the synthesis output for gaps, re-delegate to search/analysis subagents with targeted follow-up queries addressing the specific gap, and re-invoke synthesis, rather than treating the pipeline as strictly one-shot/one-directional.
  • Routing everything through the coordinator, even when it would be technically possible for two subagents to communicate directly, because centralized routing preserves observability and consistent error handling.

3.3 Task Statement: Configure subagent invocation, context passing, and spawning

◆ Key idea · the Task tool

The Task tool. In the Agent SDK, subagents are spawned via the Task tool. For a coordinator to be able to invoke subagents at all, its allowedTools configuration must include "Task": this is a specific, testable fact. If a coordinator's config omits Task from allowedTools, it structurally cannot delegate, no matter how well the prompt is written.

Context must be passed explicitly. Because subagents don't inherit the parent's context (3.2), the coordinator's prompt to each subagent must contain everything that subagent needs: e.g., the actual text of prior findings, not just a reference like "use the results from earlier." Concretely: when invoking a synthesis subagent, the coordinator includes the actual web-search results and document-analysis outputs directly in the synthesis subagent's prompt.

Preserve attribution with structured data. When passing multiple prior agents' findings into a new subagent's prompt, don't just concatenate raw text. Use a structured format that separates content (the claim/finding) from metadata (source URL, document name, page number) so that downstream synthesis can still attribute claims correctly. Example:

{
  "findings": [
    {
      "claim": "Global e-commerce grew 9% YoY in 2025.",
      "source_url": "https://example.com/report-2025",
      "source_name": "Industry Report 2025",
      "page": 12,
      "collected_date": "2026-02-01"
    }
  ]
}

AgentDefinition configuration. Each subagent type is configured with a description (used partly for the coordinator/model to understand its purpose), a system prompt (its role and instructions), and tool restrictions (which tools it's allowed to use: see Domain 2, Task 2.3, on scoping tools per role).

Parallel spawning. To run subagents in parallel rather than sequentially, the coordinator emits multiple Task tool calls within a single response/turn, rather than issuing them across separate turns (which would force sequential round-trips). This is a concrete latency lever: sequential subagent calls compound their latency; parallel calls run concurrently.

Fork-based session management. fork_session lets you create an independent branch of a session from a shared baseline: useful when you want to explore two divergent approaches (e.g., two different refactoring strategies) that both start from the same prior analysis, without either branch polluting the other or forcing you to redo the shared analysis twice. (See also Task 1.7.)

Goal-oriented vs. procedural subagent prompts. Coordinator prompts to subagents should generally specify the research goals and quality criteria ("find at least 3 credible sources per subtopic, prioritizing peer-reviewed or primary sources") rather than rigid step-by-step procedures. This gives the subagent room to adapt its approach to what it actually finds, rather than following a script that may not fit the situation.

Domain 1 · Chapter 5

Workflows, Hooks & Session Management

3.4 Task Statement: Implement multi-step workflows with enforcement and handoff patterns

◆ Key idea · enforcement vs. guidance

Programmatic enforcement vs. prompt-based guidance. These are two fundamentally different reliability tiers:

  • Prompt-based guidance ("Always verify the customer's identity before processing a refund") relies on the model choosing to comply. It has a non-zero failure rate: good most of the time, but not deterministic.
  • Programmatic enforcement (hooks, prerequisite gates in your application code) makes non-compliance structurally impossible, e.g., your code blocks the process_refund tool call unless get_customer has already returned a verified customer ID in this conversation.
◆ Tip · the exam's most-repeated judgment call

When to require deterministic compliance. Any step with financial, legal, safety, or irreversible consequences (identity verification before a refund, a human sign-off before deleting production data) should use programmatic enforcement, not prompt instructions alone. This is one of the most-repeated judgment calls on the exam: "prompt instructions failed X% of the time, what's the fix?" The answer is essentially always "add a programmatic/hook-based gate," not "reword the prompt" or "add more few-shot examples."

◆ Note · structured handoff payloads

Structured handoff for escalation. When a workflow hands off mid-process to a human (see Domain 5, Task 5.2), the handoff payload should be a structured summary containing at minimum: customer/case details, a root-cause analysis of what's been tried, and a recommended next action, because the human agent receiving the handoff typically does not have access to the full conversation transcript and needs a self-contained brief.

Multi-concern decomposition. A single customer message might bundle multiple distinct issues (a billing question and a shipping complaint). The correct pattern is to decompose the request into its distinct items, investigate each (in parallel where possible, sharing context so investigations don't duplicate work), and then synthesize one unified response, rather than answering only the first-mentioned issue or looping through them so mechanically that the reply reads disjointed.

3.5 Task Statement: Apply Agent SDK hooks for tool call interception and data normalization

◆ Key idea · hooks run outside the model

Hooks let you insert deterministic application logic into the agentic loop, without relying on the model.

  • PostToolUse hooks run after a tool returns, before the model sees the result. Use them to normalize heterogeneous data coming back from different tools/backends, e.g., one MCP tool returns Unix timestamps, another returns ISO 8601 strings, another returns numeric status codes; a PostToolUse hook can convert all of these into one consistent shape before Claude ever reasons over them. This reduces model confusion and errors that stem from inconsistent formats, not model reasoning failures.
  • Tool-call interception hooks run before a tool executes and can block it outright. Use these to enforce hard business rules deterministically, e.g., intercept process_refund calls and block any refund above $500, redirecting the flow to a human-escalation path instead of letting the tool execute.
  • Choosing hooks over prompts. As in Task 1.4: whenever a business rule must be guaranteed, not just "usually followed," hooks are the correct mechanism. Prompts are probabilistic; hooks are deterministic code that runs regardless of what the model "decided."

3.6 Task Statement: Design task decomposition strategies for complex workflows

Two decomposition patterns, and knowing which fits which situation is a recurring exam judgment call:

  • Prompt chaining (fixed sequential pipeline). Best for predictable, multi-aspect work where the steps are known in advance, e.g., a code review broken into "review file A," "review file B," …, "review file N," then a final "cross-file integration pass" that looks at how the files interact. The steps don't change based on what's found; only the content being processed changes.
  • Dynamic/adaptive decomposition. Best for open-ended investigation where you don't know the right subtasks until you've learned something about the problem, e.g., "add comprehensive tests to a legacy codebase" starts with mapping the codebase's structure, then identifying high-impact/high-risk areas, and only then building a prioritized task plan, a plan that itself may need to adapt as new dependencies are discovered mid-execution.
◆ Exam lens · attention dilution

Why splitting large reviews into per-file + cross-file passes matters: processing many files in a single pass causes attention dilution: inconsistent depth of analysis across files, missed obvious issues, and even contradictory findings (flagging a pattern as a bug in one file while implicitly approving the identical pattern in another file in the same pass). Splitting into (a) individual per-file local-issue passes and (b) a separate cross-file/integration pass restores consistency and specifically targets cross-file issues (like inconsistent data flow) that a per-file pass would miss by design.

3.7 Task Statement: Manage session state, resumption, and forking

  • --resume <session-name>: continue a specific, named prior conversation. Best when the prior context is still valid, e.g., resuming a long investigation the next morning where nothing relevant has changed.
  • fork_session: branch off an independent copy of a session from a shared baseline, to explore two (or more) divergent approaches without one branch's changes affecting the other, e.g., comparing "migrate to library X" vs. "migrate to library Y" starting from the same codebase-analysis baseline.
  • Stale tool results after external changes. If files were modified outside the session (e.g., a teammate pushed changes) since the session last read them, resuming naively risks the agent reasoning over stale information. Two correct responses: (a) explicitly tell the resumed session which specific files changed, so it does a targeted re-analysis rather than needing to re-explore everything from scratch, or (b) if enough of the prior context is now invalid, start a fresh session and inject a structured summary of what's still true, rather than resuming and hoping the agent notices staleness on its own. The exam favors "start fresh with an injected structured summary" over "resume and hope the stale tool results don't cause a problem" when a large fraction of the prior state is now invalid.
Domain 1 · Chapter 6

Domain 1: Practice Questions

D1-Q1 · single select
Your customer support agent's system prompt says, "Always verify the customer's identity via get_customer before calling process_refund." Logs show this instruction is followed 91% of the time; the other 9% of refunds are processed against unverified accounts. What should you implement?
AA more detailed system prompt with additional emphasis and repetition of the rule.
BA PreToolUse-style programmatic gate that blocks process_refund unless get_customer has already returned a verified ID in the current session.
CFew-shot examples showing the agent always calling get_customer first.
DA confidence threshold that requires the agent to self-report certainty before calling process_refund.
B is correct. This is a financial-consequence workflow ordering requirement: prompt-based approaches (A, C, D) are all probabilistic and, per the exam guide's own findings, "have a non-zero failure rate." Only a programmatic prerequisite gate provides a deterministic guarantee.
D1-Q2 · single select
A coordinator in a multi-agent research system needs to send three independent web-search queries to three separate search subagents at once, to minimize latency. How should the coordinator do this?
AIssue one Task tool call, wait for the result, then issue the next.
BEmit all three Task tool calls within a single coordinator response/turn.
CSpawn a single subagent and have it internally run three sequential searches.
DUse fork_session to create three branches that each run one search.
B is correct. Parallel subagent execution requires multiple Task calls emitted in the same turn; A is sequential (slower), C defeats the purpose of parallelism, and D (fork_session) is for exploring divergent approaches from a shared baseline, not for parallelizing independent subtasks.
D1-Q3 · single select
Which condition correctly and completely determines that an agentic loop should terminate and return its final answer to the user?
AThe assistant's text content contains a phrase like "Here is my final answer."
Bstop_reason equals "end_turn".
CThe loop has executed 10 iterations.
DNo tool_use blocks appear anywhere in the assistant's message.
B is correct. stop_reason is the authoritative signal. A is an anti-pattern (parsing NL text). C is an anti-pattern if used as the primary mechanism (a backstop cap is fine, but not the primary signal). D is close but not quite right as a general rule: the correct check is stop_reason, which the API sets precisely for this purpose.
D1-Q4 · single select
A coordinator delegates "AI's effect on transportation" to subagents that end up researching only "self-driving cars" and "electric vehicle software," entirely missing logistics, aviation, and public transit automation. Each subagent's output is accurate for what it was asked. What is the most likely root cause and correct fix?
AThe subagents' tools are misconfigured; give them more tools.
BThe coordinator's task decomposition was too narrow; fix the decomposition logic/prompt so subtopic assignment covers the full scope of the query.
CThe synthesis subagent should have flagged the gap; add gap-detection instructions to synthesis only.
DIncrease the number of subagents from two to four without changing what they're assigned.
B is correct. This mirrors the exam's canonical "narrow decomposition" pattern: the fix belongs at the coordinator's decomposition step, not downstream.
D1-Q5 · single select
In an Agent SDK application, what configuration is required for a coordinator agent to be able to spawn subagents at all?
AThe Task tool must be included in the coordinator's allowedTools.
BEach subagent must have fork_session enabled.
CThe coordinator's system prompt must mention "delegate" explicitly.
DAll subagents must share a single conversation history object with the coordinator.
A is correct. Without Task in allowedTools, the coordinator has no mechanism to invoke subagents, regardless of prompt wording.
D1-Q6 · single select
You're building a code-review pipeline for pull requests that reliably touch 3-5 files with well-understood, similar structure each time. Which task-decomposition pattern is most appropriate?
AFully dynamic/adaptive decomposition that regenerates subtasks from scratch on every PR.
BPrompt chaining: a fixed sequence of per-file passes followed by a cross-file integration pass.
CA single pass reviewing the whole diff regardless of file count.
DRandomized task assignment across available subagents to balance load.
B is correct. The task is predictable and multi-aspect (per-file + cross-file), which is exactly the profile prompt chaining is suited for; dynamic decomposition is reserved for open-ended, less predictable investigation work.
D1-Q7 · single select
A developer resumes a long investigation session the next day using --resume investigate-auth-bug, unaware that a teammate refactored the authentication module overnight. What is the most reliable next step?
ALet the agent continue reasoning from its existing (now partially stale) tool results without comment.
BExplicitly tell the resumed session which specific files changed so it performs a targeted re-analysis of just those files.
CDiscard the session and start completely from scratch every time any file changes anywhere in the repo.
DIncrease max_tokens to let the agent re-read the whole repository in one turn.
B is correct. Informing the agent about specific changed files enables targeted, efficient re-analysis rather than either silently reasoning over stale data (A) or over-correcting with a full re-exploration (C/D).
D1-Q8 · single select
A synthesis subagent receives raw web-search results and document-analysis text pasted together as one long block, with no separation between claims and their sources. Later, the final report attributes a statistic to the wrong source. What change would have prevented this?
AIncrease the subagent's max_tokens so it can process more text.
BPass findings to the subagent using a structured format that separates content (claims) from metadata (source URL, document name, page number).
CHave the coordinator re-run the synthesis subagent a second time and average the two outputs.
DSwitch the synthesis subagent to a larger context-window model.
B is correct. Preserving attribution requires structuring inputs so content and source metadata are explicitly linked, not concatenating raw text and hoping the model tracks provenance correctly.
D1-Q9 · select 2
Which of the following is an explicit anti-pattern the exam guide warns against for determining agentic loop termination? (Select all that apply, multiple response)
AChecking stop_reason == "tool_use" to continue the loop.
BParsing assistant text content for natural-language completion signals.
CUsing an arbitrary iteration cap as the primary stopping mechanism.
DAppending tool results to conversation history before the next API call.
B and C are correct. A and D describe correct behavior, not anti-patterns.
D1-Q10 · single select
A coordinator's synthesis output has a factual gap: it under-covers one subtopic. The system supports re-delegation. What is the best next action?
APublish the report as-is, noting the gap in a footnote with no further action.
BHave the coordinator evaluate the synthesis output for gaps, re-delegate targeted follow-up queries to the relevant search/analysis subagents, then re-invoke synthesis.
CRestart the entire pipeline from scratch for all subtopics, not just the gapped one.
DAsk the user to manually supply the missing information.
B is correct. This is the iterative refinement loop pattern described in Task 1.2: targeted re-delegation, not a full restart or silent acceptance of the gap.
Domain 2 · Chapter 7

4. Domain 2: Tool Design & MCP Integration (18%)

This domain covers how to design tool interfaces so an LLM reliably picks the right one, how to build structured error handling into tools, how to distribute tools across agents (and configure tool_choice), how to integrate MCP servers into Claude Code and agent workflows, and when to reach for built-in tools (Read/Write/Edit/Bash/Grep/Glob).

4.1 Task Statement: Design effective tool interfaces with clear descriptions and boundaries

◆ Key idea · descriptions drive tool selection

Tool descriptions are the primary mechanism an LLM uses to select which tool to call. This is the single most important idea in this domain. When descriptions are minimal ("Retrieves customer information" / "Retrieves order details"), the model lacks the information it needs to reliably tell two similar tools apart, and you get misrouting, e.g., calling get_customer when the user actually asked about an order.

What a good tool description includes: - The tool's purpose, stated specifically (not just a restatement of its name) - Expected input formats (e.g., "accepts an order number in the format ORD-##### or a tracking number") - Example queries that should route to this tool - Edge cases and boundaries: explicitly stating what this tool is not for, and how it differs from similarly named/purposed tools

Common misrouting causes and fixes: - Near-identical descriptions on different tools (e.g., analyze_content vs. analyze_document): fix by renaming for clarity and rewriting descriptions to be mutually exclusive (e.g., rename analyze_content to extract_web_results with a web-specific description). - A generic, overloaded tool trying to do too much (e.g., a single analyze_document tool used for extraction, summarization, and verification): fix by splitting it into purpose-specific tools with clear input/output contracts: extract_data_points, summarize_content, verify_claim_against_source. - System-prompt keyword sensitivity: sometimes the system prompt itself (not the tool description) contains wording that creates unintended associations, causing a tool to be over- or under-selected. Always review the system prompt for keyword collisions when debugging tool-selection issues, not just the tool descriptions in isolation.

◆ Tip · fix descriptions first

Rule of thumb for the exam: if a question describes a tool-selection/misrouting problem and the tools currently have thin, generic descriptions, the correct first-line fix is almost always "improve/expand the tool descriptions": not few-shot examples, not a routing layer, not consolidating tools (those may be valid later steps, but improving descriptions is the low-effort, high-leverage first move).

4.2 Task Statement: Implement structured error responses for MCP tools

The isError flag. MCP's pattern for signaling tool failure back to the agent is a structured isError: true (or equivalent) flag in the tool result, rather than the tool result silently looking like a normal (if unhelpful) response.

Error categories matter. Not all failures are the same, and lumping them together prevents the agent from making good recovery decisions:

CategoryExampleRetryable?
TransientTimeout, service temporarily unavailableUsually yes
ValidationMalformed/invalid inputUsually no (fix the input first)
BusinessPolicy violation (e.g., "refund exceeds allowed threshold")No, needs a different path (e.g., escalation), not a retry
PermissionCaller lacks accessNo, needs different credentials/escalation
◆ Pitfall · generic error messages

Why generic errors are harmful. A tool that always returns "Operation failed" gives the agent no basis for deciding what to do next: should it retry? Ask the user for different input? Escalate? Give up? Structured, categorized errors let the agent make an appropriate choice.

Recommended error payload shape:

{
  "isError": true,
  "errorCategory": "business",
  "isRetryable": false,
  "message": "This refund exceeds the $500 self-service threshold and requires manager approval.",
}

Local recovery before propagation. Within a subagent, transient errors should generally be retried/recovered locally first. Only errors the subagent cannot resolve on its own should propagate up to the coordinator, and when they do, they should include partial results and a description of what was attempted, not just a bare failure signal (this connects directly to Domain 5, Task 5.3).

◆ Note · empty result vs. failure

Empty results are not errors. A query that runs successfully and legitimately finds nothing (e.g., "no orders found for this customer") is a valid empty result, not an access failure: these two situations must be distinguished in your error/response design, because they call for very different agent behavior (one is "this is the answer," the other is "something went wrong, decide whether to retry").

4.3 Task Statement: Distribute tools appropriately across agents and configure tool choice

◆ Key idea · tool-set size hurts reliability

Fewer, well-scoped tools beat many tools. Giving one agent 18 tools instead of 4-5 measurably degrades tool-selection reliability: more options means more opportunities for the model to pick wrong. Scope each agent's toolset tightly to its actual role.

Cross-specialization misuse. An agent given tools outside its specialization tends to misuse them, e.g., a synthesis agent that has full web-search tools available may attempt ad hoc searches instead of staying focused on synthesis, duplicating or conflicting with the dedicated search agent's work.

Scoped cross-role tools for high-frequency needs. Sometimes an agent legitimately needs some capability from another role's domain frequently enough that routing every instance through the coordinator is wasteful. The fix isn't "give it the whole toolset", it's giving it one narrowly scoped tool for that specific high-frequency need (e.g., a verify_fact tool for a synthesis agent that often needs quick fact-checks), while still routing rarer/more complex cases of that need through the coordinator to the full search agent.

tool_choice configuration options: - "auto": the model may choose to call a tool or just respond with text. Use when you want the model to decide. - "any": the model must call some tool (any of the available ones), but can pick which. Use when you need to guarantee a tool call happens (e.g., guaranteeing structured output rather than risking a plain-text reply). - Forced tool choice, {"type": "tool", "name": "extract_metadata"}: the model must call this specific named tool. Use when a particular step must run first (e.g., forcing extract_metadata before any enrichment tools can run), then handling subsequent steps in follow-up turns once that tool's output is available.

4.4 Task Statement: Integrate MCP servers into Claude Code and agent workflows

Scoping: project vs. user. - Project-level (.mcp.json in the repo root): shared team tooling, version-controlled, everyone on the project gets the same servers. - User-level (~/.claude.json): personal or experimental servers, not shared with teammates. - Both scopes are discovered and available simultaneously: a developer sees their personal experimental server and the shared project servers at the same time.

Environment variable expansion. .mcp.json supports variable expansion (e.g., ${GITHUB_TOKEN}) so that credentials are supplied via environment variables at runtime rather than being committed to the repo in plaintext. Example:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
    }
  }
}

Tool discovery. Tools from all configured MCP servers (project + user scope) are discovered at connection time and made available to the agent simultaneously: there isn't a separate activation step per server once connected.

MCP resources vs. tools. Tools represent actions the agent can invoke; resources represent content the agent can browse/reference, like a catalog of issue summaries, a documentation hierarchy, or a database schema. Exposing a content catalog as an MCP resource (rather than forcing the agent to make exploratory tool calls to discover what exists) reduces wasted round-trips and helps the agent understand what's available up front.

Description quality drives adoption. If an MCP tool's description is thin, the agent may default to a built-in tool it already trusts (e.g., using Grep to search code text instead of a purpose-built, more capable MCP indexing/search tool) simply because the built-in tool's behavior is better understood by the model. Enhancing MCP tool descriptions, explaining capabilities and expected outputs in detail, helps the agent actually prefer the more capable tool when appropriate.

Build vs. buy. For standard integrations (e.g., Jira, GitHub, Slack), prefer existing community MCP servers over building your own from scratch. Reserve custom MCP server development for genuinely team-specific or proprietary workflows that no existing server covers.

4.5 Task Statement: Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively

ToolBest for
GrepSearching file contents for patterns: function names, error messages, import statements
GlobFinding files by path/name pattern, e.g., **/*.test.tsx
ReadLoading the full contents of a specific file
WriteWriting/overwriting a full file
EditTargeted modification via unique text matching (find-and-replace on a specific anchor string)

Edit failure fallback. If Edit cannot find a unique match for its anchor text (e.g., the text you want to replace appears multiple times in the file), the reliable fallback is Read the full file, then Write the modified version back: rather than repeatedly trying slightly different anchor strings.

Incremental codebase understanding. Don't read every file upfront. The efficient pattern is: start with Grep to locate entry points or relevant symbols, use Read to follow imports and trace execution flow from there, and expand only as needed. This keeps context usage proportional to what's actually relevant.

Tracing usage across wrapper/re-export modules. To find all callers of a function that's re-exported under different names in various modules, first identify all the exported names it might be imported as, then Grep for each of those names across the codebase: a single Grep for the original name will miss call sites that import it under an alias or a wrapper.

Domain 2 · Chapter 8

Domain 2: Practice Questions

D2-Q1 · single select
Two MCP tools, get_customer ("Retrieves customer information") and lookup_order ("Retrieves order details"), are frequently confused by the agent when users ask about their orders. What's the most effective first fix?
AAdd 5-8 few-shot examples showing correct routing.
BExpand both tools' descriptions with input formats, example queries, and explicit boundaries distinguishing the two.
CMerge them into one lookup_entity tool.
DBuild a keyword-based pre-routing layer.
B is correct. improving thin tool descriptions is the direct, low-effort fix for a root cause that is literally "the descriptions don't differentiate the tools."
D2-Q2 · single select
An MCP tool call to a payment backend times out. Which response design lets the agent make the best recovery decision?
AReturn {"status": "failed"} with no further detail.
BReturn {"isError": true, "errorCategory": "transient", "isRetryable": true, "message": "Payment service timeout after 10s"}.
CSilently retry three times internally and, if still failing, return an empty success response.
DThrow an unhandled exception that crashes the agent process.
B is correct. structured, categorized error data (transient + retryable) gives the agent the basis to decide to retry or escalate; A is a generic uninformative failure, C hides a real failure as success, D is not a recoverable design at all.
D2-Q3 · single select
A synthesis subagent has been given the full suite of web-search tools "just in case." What is the most likely consequence, and the better design?
ANo consequence, more tools always improve capability; keep it as is.
BThe synthesis agent may misuse search tools outside its specialization, duplicating or conflicting with the dedicated search subagent; instead, scope its tools tightly to synthesis, adding at most a narrow verify_fact tool for high-frequency simple checks.
CRemove all tools from the synthesis agent so it cannot call any tool.
DGive every subagent identical toolsets for consistency.
B is correct. over-provisioning tools outside an agent's role degrades reliability; the fix is scoped, role-appropriate tool distribution.
D2-Q4 · single select
You need to guarantee that extract_metadata runs before any enrichment tool in a document-processing pipeline, on the very next model turn. Which tool_choice configuration enforces this?
A{"type": "auto"}
B{"type": "any"}
C{"type": "tool", "name": "extract_metadata"}
DOmitting tool_choice entirely and relying on tool description ordering.
C is correct. forced tool choice is the only option that guarantees a specific named tool is called next.
D2-Q5 · single select
Where should a shared, team-wide MCP server configuration live so all developers get it automatically when they clone the repo, with credentials supplied via environment variables rather than committed secrets?
A~/.claude.json with the token hardcoded.
B.mcp.json at the project root, using ${TOKEN_NAME} environment variable expansion.
CA .env file referenced nowhere in Claude Code configuration.
DEach developer's personal Claude Code settings, configured individually.
B is correct. project-scoped .mcp.json with environment variable expansion is exactly this pattern.
D2-Q6 · single select
You need to find every file in a repository whose filename ends in .test.tsx, regardless of directory. Which tool is correct?
AGrep, searching for the string ".test.tsx" in file contents.
BGlob, with pattern **/*.test.tsx.
CRead on every file in the repo, filtering client-side.
DBash find piped through Write.
B is correct. Glob is for path/filename pattern matching; Grep is for content search.
D2-Q7 · single select
Edit fails because the anchor text you're trying to replace appears three times in the file, and none of your attempts at adding surrounding context make it unique. What should you do?
AGive up and ask the user to edit manually.
BRead the full file, construct the modified content, and Write it back in full.
CDelete the file and recreate it from a template.
DRun Edit repeatedly with random variations until one succeeds.
B is correct. this is the documented fallback for non-unique Edit anchors.
D2-Q8 · single select
An agent has access to an MCP-provided search_docs tool with a thin description ("Searches documentation") alongside the built-in Grep tool. Logs show the agent almost always uses Grep on raw doc files instead of the more capable search_docs, missing semantic matches Grep can't find. What's the best fix?
ARemove Grep from the agent's toolset entirely.
BRewrite search_docs's description to explain its capabilities (e.g., semantic search across doc versions) and expected outputs in detail so the agent has grounds to prefer it when appropriate.
CRename Grep to something less appealing.
DForce tool_choice to search_docs for every single turn.
B is correct. the fix targets the root cause (thin MCP tool description causing the agent to default to a familiar built-in tool), without removing legitimate use cases for Grep (A) or over-constraining every turn (D).
D2-Q9 · select 2
Which of the following are appropriate MCP error-category / retryability pairings?
ATimeout → transient, retryable
BRefund exceeds $500 policy limit → business, retryable
CInvalid/malformed input → validation, generally not retryable without fixing the input
DRefund exceeds $500 policy limit → business, not retryable (needs escalation instead)
A and D are correct. A policy violation isn't fixed by retrying the same call, it needs a different workflow path (escalation), so B is wrong and D is right; C is also a reasonable pairing, but the question asks for exactly two, and A/D are the clearest canonical pairings tested.
D2-Q10 · single select
Your team needs a Jira integration for a coordinator agent. No team-specific customization is required: just standard issue lookup/creation. What's the recommended approach?
ABuild a custom MCP server from scratch for full control.
BUse an existing community MCP server for Jira, reserving custom development for genuinely team-specific workflows.
CSkip MCP entirely and call the Jira REST API directly from tool-calling code with no MCP layer.
DWait until a team-specific need arises before integrating Jira at all.
B is correct. prefer existing community servers for standard integrations; build custom only when there's a genuine gap.
Domain 3 · Chapter 9

5. Domain 3: Claude Code Configuration & Workflows (20%)

This domain covers configuring Claude Code for teams: the CLAUDE.md hierarchy, custom slash commands and skills, path-specific rules, plan mode vs. direct execution, iterative refinement techniques, and CI/CD integration.

5.1 Task Statement: Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization

The three-level hierarchy: - User-level: ~/.claude/CLAUDE.md: applies only to that individual user, on their machine. Not shared via version control. If instructions live only here, teammates never see them. - Project-level: .claude/CLAUDE.md or a root CLAUDE.md: version-controlled, applies to everyone who works on the project. - Directory-level: a CLAUDE.md placed in a specific subdirectory: applies when working in that subdirectory (e.g., package-specific conventions in a monorepo).

◆ Exam lens · the "new hire" diagnostic

Classic diagnostic scenario: a new team member isn't receiving instructions that "should" apply to everyone. The most common root cause is that those instructions were placed in user-level configuration (on the original author's machine) rather than project-level configuration that ships with the repo. The fix is to move universal instructions into project-level CLAUDE.md.

@import syntax. Lets a CLAUDE.md reference external files rather than duplicating content, keeping configuration modular, e.g., each package's CLAUDE.md can @import only the standards files relevant to that package's maintainers, instead of a single, unwieldy monolith covering every package's conventions at once.

.claude/rules/ as an alternative to one giant CLAUDE.md. Rather than a single sprawling CLAUDE.md file, you can split topic-specific content into individual files inside .claude/rules/ (e.g., testing.md, api-conventions.md, deployment.md). This keeps each concern focused and independently maintainable (and, per Task 3.3, .claude/rules/ files can also carry path-scoping so they only load when relevant).

The /memory command. Use it to inspect which memory/configuration files are actually loaded in the current session: this is the correct diagnostic tool when behavior is inconsistent across sessions or across team members, rather than guessing at what might be misconfigured.

5.2 Task Statement: Create and configure custom slash commands and skills

Slash commands: project vs. user scope. - .claude/commands/ (in the repo): project-scoped, version-controlled, shared with the whole team automatically when they clone/pull. - ~/.claude/commands/: user-scoped, personal, not shared.

If a task says "every developer should get this command automatically when they clone the repo," the answer is .claude/commands/ in the project, full stop, not a config file that doesn't exist (there is no .claude/config.json commands array), and not CLAUDE.md (which holds context/instructions, not command definitions).

Skills. Live in .claude/skills/ with a SKILL.md file that supports frontmatter configuration: - context: fork: runs the skill in an isolated sub-agent context so its (possibly verbose) output doesn't pollute the main conversation. Use this for skills that produce a lot of exploratory or intermediate content (e.g., a full codebase-analysis skill, or a brainstorming skill that considers many discarded alternatives): you want the conclusion, not the scratch work, in your main session. - allowed-tools: restricts which tools are available while the skill runs (e.g., limiting a "generate documentation" skill to file-write operations only, so it structurally cannot perform destructive actions like deleting files). - argument-hint: prompts the developer for required parameters when they invoke the skill without arguments, improving usability.

Personal skill variants. A developer can create a personalized variant of a shared skill in ~/.claude/skills/ under a different name, customizing it to their own preferences without affecting teammates who use the shared, project-scoped version.

◆ Key idea · skills vs. CLAUDE.md

Skills vs. CLAUDE.md - when to use which: Skills are for on-demand, task-specific workflows you invoke when needed (e.g., "run the release-notes skill"). CLAUDE.md is for always-loaded, universal standards that should shape every interaction regardless of the specific task (e.g., "we use tabs, not spaces" or "always write tests for new functions"). If content should apply to literally everything, it belongs in CLAUDE.md; if it's a discrete workflow invoked situationally, it belongs in a skill.

5.3 Task Statement: Apply path-specific rules for conditional convention loading

.claude/rules/ with YAML frontmatter paths globs. Each rule file can declare which file paths it applies to, e.g.:

---
paths: ["src/api/**/*"]
---
# API conventions
Use async/await. Return typed error objects. ...

The rule loads into context only when Claude is working with a file matching that glob, keeping irrelevant conventions out of context the rest of the time (reducing token usage and noise).

Why glob-based rules beat directory-level CLAUDE.md for cross-cutting conventions. Directory-level CLAUDE.md is directory-bound: it applies to files physically located in that directory tree. But some conventions cut across the whole codebase by file type, not by location, e.g., test files (Button.test.tsx sitting right next to Button.tsx) are scattered everywhere. A directory-level CLAUDE.md can't cleanly express "apply this rule to every test file no matter where it lives", but a .claude/rules/ file with paths: ["**/*.test.tsx"] can, because it matches by pattern, not by physical location.

◆ Exam lens · rules vs. directory CLAUDE.md

This is a frequently tested distinction: whenever a scenario describes conventions that need to apply "regardless of directory" or "wherever files of type X live," the answer is .claude/rules/ with glob-pattern path scoping, not per-directory CLAUDE.md files, not a single monolithic CLAUDE.md relying on the model to infer which section applies, and not a skill (skills require invocation, they don't apply automatically based on file path).

5.4 Task Statement: Determine when to use plan mode vs. direct execution

Plan mode is for: - Large-scale changes touching many files - Situations with multiple valid approaches that need to be weighed - Architectural decisions (e.g., service boundaries in a monolith-to-microservices migration) - Anything where exploring and designing before committing avoids costly rework

Direct execution is for: - Simple, well-scoped changes with a clear, singular path (e.g., adding one validation check to one function, a single-file bug fix with a clear stack trace)

◆ Tip · plan mode is immediate, not a fallback

Decision rule for the exam: if a scenario states up front that a task involves "dozens of files," "multiple approaches," or "architectural decisions," plan mode is correct immediately: you don't need to "try direct execution first and switch if it gets complicated." The complexity is already established by the task description, not something that might emerge later.

Explore subagent. For verbose discovery/investigation phases (e.g., "map this legacy codebase"), delegate to the Explore subagent so the verbose exploration output stays isolated, and only a summary comes back to the main conversation: this prevents context window exhaustion during multi-phase tasks, similar in spirit to context: fork for skills.

Combining modes. It's entirely valid to use plan mode for the investigation/design phase, then switch to direct execution to implement the now-agreed-upon plan: plan mode and direct execution aren't mutually exclusive across an entire task; they can be sequenced.

5.5 Task Statement: Apply iterative refinement techniques for progressive improvement

  • Concrete input/output examples are the most effective way to communicate an expected transformation when prose descriptions alone produce inconsistent results. If you've described a transformation in words and gotten inconsistent output, the fix is 2-3 concrete before/after examples, not a longer paragraph of prose.
  • Test-driven iteration. Write a test suite (expected behavior, edge cases, performance requirements) before implementation, then iterate by sharing test failures with Claude to guide progressive correction: this gives concrete, falsifiable feedback rather than vague "this doesn't look right" comments.
  • The interview pattern. Before implementing something in an unfamiliar domain, have Claude ask you questions first to surface considerations you might not have thought of (e.g., cache invalidation strategy, failure modes): this front-loads design thinking instead of discovering gaps mid-implementation.
  • Batching vs. sequencing fixes. If multiple issues interact with each other (fixing one changes the right fix for another), address them together in a single detailed message. If issues are independent, fix them sequentially, one at a time, so each fix can be verified in isolation.

5.6 Task Statement: Integrate Claude Code into CI/CD pipelines

  • -p / --print flag: runs Claude Code in non-interactive mode: it processes the prompt, prints the result, and exits, instead of waiting for interactive input (which would hang a CI job indefinitely). This is the fix whenever a pipeline script "hangs waiting for input."
  • --output-format json plus --json-schema: enforce machine-parseable structured output so CI tooling can reliably parse findings (e.g., to post them as inline PR comments) without fragile text-scraping.
  • CLAUDE.md for CI context. The same CLAUDE.md mechanism used interactively also feeds project context (testing standards, fixture conventions, review criteria) to Claude Code when it's invoked non-interactively in CI.
  • Session/context isolation for review. A Claude session that just generated some code is less effective at critically reviewing that same code than an independent session with no prior reasoning context, because the generating session tends to retain (and defend) its own reasoning rather than scrutinizing it fresh. For CI code review, use a separate, independent invocation rather than having the same session that wrote the diff also review it.
  • Avoiding duplicate PR comments across re-runs. When re-running a review after new commits, include the prior review findings in context and instruct Claude to report only new or still-unaddressed issues: otherwise every re-run re-flags everything from scratch.
  • Avoiding low-value/duplicate generated tests. Provide the existing test files in context during test-generation so Claude doesn't propose scenarios already covered, and document testing standards, valuable-test criteria, and available fixtures in CLAUDE.md to raise the baseline quality of generated tests.
Domain 3 · Chapter 10

Domain 3: Practice Questions

D3-Q1 · single select
A new engineer joins the team, clones the repo, and doesn't receive any of the coding conventions that "everyone" is supposed to follow. Investigation shows the conventions were written into a CLAUDE.md file. What is the most likely cause and fix?
AThe conventions are in ~/.claude/CLAUDE.md on the original author's machine (user-scoped); move them to a project-level .claude/CLAUDE.md or root CLAUDE.md that's committed to the repo.
BCLAUDE.md files don't support conventions at all; use .claude/rules/ instead.
CThe new engineer needs to manually run /memory load.
DConventions must be re-typed by each new engineer on first use.
A is correct. this is the canonical CLAUDE.md hierarchy diagnostic: user-level settings don't propagate via version control.
D3-Q2 · single select
You want a skill that performs a large, verbose codebase analysis, but you don't want the intermediate exploration output cluttering the main conversation: only the final conclusion should appear. What frontmatter option achieves this?
Aallowed-tools: []
Bargument-hint: "path"
Ccontext: fork
Dscope: isolated
C is correct. context: fork runs the skill in an isolated sub-agent context, keeping verbose output out of the main session.
D3-Q3 · single select
Test files are scattered throughout the repository next to the code they test (Foo.test.tsx beside Foo.tsx), and you want consistent testing conventions applied regardless of which directory a test file lives in. What's the most maintainable configuration?
AA directory-level CLAUDE.md in every directory that happens to contain a test file.
BA .claude/rules/ file with paths: ["**/*.test.tsx"] frontmatter.
CA single root CLAUDE.md with a section titled "Testing," relying on Claude to infer when it applies.
DA skill that must be manually invoked before writing any test.
B is correct. glob-based path scoping in .claude/rules/ applies by file pattern regardless of directory, which is exactly the requirement here.
D3-Q4 · single select
You've been asked to migrate a monolith into microservices, touching dozens of files, with several valid ways to draw service boundaries. What's the correct approach?
AStart direct execution immediately since Claude can figure out boundaries as it goes.
BEnter plan mode to explore the codebase and design an approach before making any changes.
CWrite out, by hand, exhaustive instructions for every file before starting.
DBegin in direct execution and only switch to plan mode if it turns out to be hard.
B is correct. the complexity (many files, multiple valid approaches, architectural decisions) is stated up front, which is exactly plan mode's use case.
D3-Q5 · single select
Your CI pipeline runs claude "Review this PR for security issues" and the job hangs. What flag fixes this?
A--headless
B-p (or --print)
C--ci
D--no-interactive-wait
B is correct. -p/--print is the documented non-interactive mode flag; the others don't exist.
D3-Q6 · single select
You want your CI pipeline to programmatically parse Claude Code's review findings and post them as inline PR comments. What should you configure?
A--output-format json with --json-schema to define the expected shape.
BAsk Claude to "format your response as JSON" in the prompt only, with no CLI flags.
CPost the raw stdout text directly as a single PR comment.
DUse --output-format markdown.
A is correct. CLI flags that enforce structured, schema-validated JSON output are the reliable mechanism for CI parsing, not prompt-only requests.
D3-Q7 · single select
The same Claude Code session that generated a risky refactor is then asked to review its own diff for bugs before merge. What's the concern, and the better design?
ANo concern, self-review is equally effective as independent review.
BThe generating session retains its own reasoning context and is less likely to critically question its own decisions; use a separate, independent session/instance with no prior context to review the diff.
CSelf-review is always superior because the session already understands the change's intent.
DReviews should never be automated regardless of session setup.
B is correct. this is the session-context-isolation principle: independent review instances catch more issues than self-review.
D3-Q8 · single select
You want developers to be prompted for a required parameter when they invoke a custom skill without arguments. Which frontmatter field achieves this?
Acontext: fork
Bargument-hint
Callowed-tools
Drequired: true
B is correct. argument-hint is the documented mechanism for prompting for missing parameters.
D3-Q9 · single select
Claude Code re-runs a PR review after a developer pushes a small fix. Without any special handling, it re-reports every issue from the original review, frustrating the developer. What's the fix?
ADisable re-reviews on subsequent commits entirely.
BInclude the prior review's findings in context and instruct Claude to report only new or still-unaddressed issues.
CReduce max_tokens so fewer issues can be reported.
DSwitch to a different model for re-reviews.
B is correct. providing prior findings and instructing "only new/unaddressed" avoids duplicate reporting across re-runs.
D3-Q10 · single select
You're fixing a single, well-understood bug: a null check is missing in one function, and the stack trace points directly at the line. What's the appropriate approach?
APlan mode, to explore alternative architectural approaches first.
BDirect execution, the change is simple, well-scoped, and doesn't require exploring alternatives.
CSpawn three subagents to independently propose fixes, then vote.
DWrite a full design document before touching the code.
B is correct. this is the canonical "simple, well-scoped, one clear path" case for direct execution.
Domain 4 · Chapter 11

6. Domain 4: Prompt Engineering & Structured Output (20%)

This domain covers writing prompts that reduce false positives, using few-shot examples effectively, enforcing structured output via tool_use and JSON schemas, validation-retry loops, batch processing strategy, and multi-pass/multi-instance review architectures.

6.1 Task Statement: Design prompts with explicit criteria to improve precision and reduce false positives

◆ Key idea · explicit criteria over vague adjectives

Specific criteria beat vague instructions. "Flag comments only when the claimed behavior contradicts the actual code behavior" is testable and precise. "Check that comments are accurate" is vague and produces inconsistent judgment calls. When precision (false-positive rate) is the problem, the fix is explicit, categorical criteria: not vaguer instructions like "be conservative" or "only report high-confidence findings," which don't actually give the model a rule to apply consistently; they just ask it to feel more certain, which doesn't reliably change what it flags.

False positives erode trust unevenly. If one category of finding has a high false-positive rate, it damages developer trust in all categories, including accurate ones. A pragmatic interim fix while you improve the prompt: temporarily disable the high-false-positive category rather than let it erode confidence in everything else.

Severity classification needs concrete examples per level, not just adjectives ("critical," "major," "minor"): pair each severity level with a concrete code example so classification is consistent across different reviewers/runs.

6.2 Task Statement: Apply few-shot prompting to improve output consistency and quality

When to reach for few-shot examples: when detailed prose instructions alone produce inconsistent formatting or judgment. Few-shot examples are the most effective lever for: - Achieving consistent output format (e.g., always: location, issue, severity, suggested fix) - Demonstrating ambiguous-case handling, e.g., which tool to pick when a request could plausibly go to either of two tools, or what counts as a real branch-coverage gap vs. an acceptable one - Reducing hallucination in extraction tasks, e.g., correctly handling informal units ("about a dozen" vs. "12"), or varied document structures (inline citations vs. a bibliography)

Good few-shot examples show reasoning, not just input→output. 2-4 targeted examples for genuinely ambiguous scenarios, ideally each showing why one action was chosen over a plausible alternative: this helps the model generalize the underlying judgment to novel cases it hasn't seen, rather than just pattern-matching the literal examples.

Distinguishing acceptable patterns from genuine issues. Include examples of code/patterns that look like they might be flaggable but are actually fine, alongside examples of genuine issues: this reduces false positives while still letting the model generalize (as opposed to a purely negative list of "don't flag X," which doesn't generalize to X-like-but-not-identical cases).

6.3 Task Statement: Enforce structured output using tool use and JSON schemas

tool_use + JSON schema is the most reliable path to guaranteed schema-compliant output. It structurally eliminates JSON syntax errors (malformed brackets, missing commas, etc.) because the model is filling a schema-constrained tool input, not free-typing JSON text that could be malformed.

◆ Pitfall · schemas guarantee shape, not correctness

What it does not eliminate: semantic errors. A syntactically valid, schema-compliant object can still be wrong in meaning, e.g., line items that don't sum to the stated total, or a value placed in the wrong (but type-compatible) field. Structured output guarantees shape, not correctness of content. That's what validation-retry loops (6.4) are for.

tool_choice recap in the extraction context: - "auto": model might reply with plain text instead of extracting; not appropriate when you need guaranteed structured output. - "any": model must call some tool; use this when you have multiple possible extraction schemas and don't yet know the document type, letting the model pick the applicable one but still guaranteeing a structured call happens. - Forced tool choice ({"type": "tool", "name": "extract_metadata"}): use to guarantee a specific extraction runs first, before enrichment steps that depend on its output.

Schema design principles: - Optional/nullable fields for information that may genuinely be absent from the source document. If a field is marked required but the source doesn't contain that data, the model is incentivized to fabricate a value just to satisfy the schema. Making the field nullable lets the model correctly return null instead of inventing data. - Enum + "other" + detail-string pattern for categorical fields that need to stay extensible: category: enum["invoice", "receipt", "other"] plus category_other_detail: string | null lets you capture novel categories without either rejecting them or forcing a bad-fit enum value. Similarly, an "unclear" enum value handles genuinely ambiguous cases honestly instead of forcing a false-confidence pick. - Format normalization instructions belong alongside the schema (in the prompt), since the schema defines shape but doesn't by itself normalize inconsistent source formatting (e.g., different date formats across documents): you still need to instruct the model on how to normalize into the schema's expected format.

6.4 Task Statement: Implement validation, retry, and feedback loops for extraction quality

Retry-with-error-feedback pattern. When a validation check fails (e.g., a Pydantic model or JSON Schema validator rejects the output), send a follow-up request that includes: the original document, the failed extraction, and the specific validation error message: this gives the model concrete, actionable feedback to self-correct, rather than just re-asking the same question and hoping for a different (better) random result.

◆ Exam lens · when retries can't help

Know when retries will and won't help. This is a heavily tested judgment call: - Retries help when the failure is a format/structural mismatch, e.g., a date in the wrong format, a field that's the wrong type, a total that's a string instead of a number. - Retries do NOT help when the failure is because the required information simply isn't present in the source document at all (e.g., you're asking for a field, and the document genuinely never states that value). No amount of retrying will surface information that was never there: the fix is a nullable field (per 6.3) or fetching the information from elsewhere (e.g., an external document not currently provided), not more retries against the same input.

Feedback loops for systematic pattern analysis. Add a detected_pattern field to structured findings so that when developers dismiss/reject a finding, you can later analyze which code constructs or patterns are systematically triggering false positives, turning ad hoc dismissals into a data-driven prompt-improvement signal.

Self-correction / discrepancy-detection design. For financial-style extraction, extract both a calculated_total (computed from line items) and a stated_total (as written in the document) as separate fields, so a mismatch between them is automatically flagged rather than silently trusting whichever value the model happened to output. Similarly, a conflict_detected: boolean field can flag when source data is internally inconsistent, prompting downstream handling rather than silent pass-through.

6.5 Task Statement: Design efficient batch processing strategies

Message Batches API characteristics: - 50% cost savings vs. real-time/synchronous calls - Processing window up to 24 hours: no guaranteed latency SLA (it might finish much sooner, but you cannot rely on that) - No multi-turn tool calling within a single batch request: you cannot execute a tool mid-request and feed the result back within the same batch call; batch requests are effectively single-shot - custom_id fields let you correlate each response back to its corresponding request

◆ Key idea · batch vs. blocking workflows

Fit-for-purpose decision rule: batch processing is appropriate for non-blocking, latency-tolerant workloads: overnight technical-debt reports, weekly audits, nightly test generation. It is inappropriate for blocking workflows: anything a human is actively waiting on, like a pre-merge check gating a PR. If a scenario mixes one blocking and one non-blocking workflow and proposes moving both to batch "for the cost savings," the correct answer keeps the blocking workflow on the synchronous/real-time API and moves only the non-blocking one to batch.

SLA math. If you have a downstream SLA (e.g., "results must be ready within 30 hours of document arrival") and batch processing can take up to 24 hours, you need to calculate submission frequency so that the worst-case batch completion time still meets the SLA, e.g., submitting every 4 hours leaves a 24-hour batch window plus buffer, comfortably inside a 30-hour SLA; submitting less frequently might not.

Failure handling. When some documents in a batch fail, identify them by custom_id and resubmit only the failed ones, with appropriate modifications, e.g., chunking a document that exceeded context limits before resubmitting it, rather than reprocessing the entire batch from scratch.

Prompt-refine-before-scale. Before submitting a large batch (e.g., thousands of documents), refine your prompt against a small representative sample first, to maximize first-pass success rate: this reduces costly iterative resubmission cycles at scale.

6.6 Task Statement: Design multi-instance and multi-pass review architectures

◆ Pitfall · self-review is structurally weaker

Self-review limitations. A model that just generated some output retains the reasoning context that led to that output, making it less likely to critically question its own decisions within the same session, even with explicit "please review your work critically" instructions, or with extended thinking enabled. This is a structural limitation of self-review, not something you can fully prompt your way out of.

Independent review instances catch more. A separate Claude instance, invoked fresh with no access to the generator's reasoning trace, is more effective at catching subtle issues: it evaluates the output on its own merits rather than inheriting the generator's assumptions.

Multi-pass review for large reviews. As covered in Domain 1 (Task 1.6), splitting a large multi-file review into (a) per-file local-issue passes and (b) a separate cross-file integration pass avoids attention dilution and the contradictory-findings problem that comes from processing everything in one pass.

Calibrated confidence self-reporting. Having the model report a confidence score alongside each finding (rather than as a blanket "how sure are you overall") enables calibrated routing, e.g., low-confidence findings go to human review, high-confidence findings can be auto-applied or auto-flagged, provided the confidence scores have actually been validated against ground truth (see Domain 5, Task 5.5) rather than trusted blindly.

Domain 4 · Chapter 12

Domain 4: Practice Questions

D4-Q1 · single select
Your code-review prompt currently says, "Only report high-confidence findings; be conservative." False-positive rates remain high across several finding categories. What's the more effective fix?
AAdd the word "very": "be very conservative."
BReplace vague conservatism instructions with explicit, categorical criteria defining exactly which conditions constitute a reportable issue for each category.
CLower max_tokens so fewer findings can be generated.
DSwitch to a different model with no other prompt changes.
B is correct. vague confidence-based instructions don't reliably change judgment; specific, testable criteria do.
D4-Q2 · single select
You're extracting invoice data and want to prevent the model from inventing a "due date" value when a source invoice genuinely doesn't list one. What schema design choice addresses this?
AMake due_date a required string field with a default value of "N/A".
BMake due_date a nullable/optional field so the model can correctly return null when the information isn't present.
CRemove due_date from the schema entirely.
DAdd a few-shot example showing a due date being correctly extracted from a document that has one.
B is correct. required fields for genuinely-sometimes-absent data incentivize fabrication; nullable fields let the model honestly report absence.
D4-Q3 · single select
An extraction pipeline uses tool_use with a strict JSON schema. Outputs are always syntactically valid, but you discover several outputs where line items don't sum to the stated invoice total. What does this indicate?
AThe JSON schema is broken and needs to be redefined.
Btool_use schemas eliminate syntax errors but not semantic errors; add a validation step that checks totals and triggers a retry-with-feedback if they don't reconcile.
CSwitch off tool_use and go back to free-text JSON generation.
DThis is expected and requires no further action.
B is correct. this is precisely the syntax-vs-semantic-error distinction the exam tests; the fix is semantic validation plus retry, not touching the schema mechanism itself.
D4-Q4 · single select
A validation-retry loop keeps failing on the same document because the document simply never states the customer's tax ID, which your schema requires. Repeated retries with error feedback don't help. What should you conclude and do?
AKeep retrying with slightly different prompt wording until it eventually works.
BRecognize that retries can't surface information that isn't in the source; make the field nullable, or source the information from elsewhere, rather than continuing to retry against the same document.
CIncrease max_tokens on the retry request.
DSwitch tool_choice from a forced tool to "auto".
B is correct. this is the canonical "retries help with format errors, not missing-information errors" distinction.
D4-Q5 · single select
You need to process 5,000 legal documents for a nightly compliance summary that isn't reviewed until the next morning. Cost is a significant concern. What's the appropriate API strategy?
AThe synchronous Messages API, for guaranteed low latency.
BThe Message Batches API, since the workload is non-blocking/latency-tolerant and this saves ~50% in cost.
CA custom polling loop calling the synchronous API every second.
DSplitting the 5,000 documents across multiple accounts to parallelize cost.
B is correct. an overnight, non-blocking, latency-tolerant workload is exactly the Batches API's ideal use case.
D4-Q6 · single select
Your team wants to move a pre-merge PR check (developers wait on the result before merging) to the Message Batches API to save on cost. What's the correct evaluation?
AApprove, 50% savings apply regardless of workflow type.
BReject for this workflow, batch processing has no guaranteed latency SLA (up to 24 hours), which is incompatible with a blocking, developer-waiting workflow; keep it on the synchronous API.
CApprove, but add a client-side timeout that falls back to a cached response.
DApprove only if the team also reduces max_tokens.
B is correct. batch processing is unsuitable for blocking workflows regardless of the cost incentive.
D4-Q7 · single select
40 of 2,000 submitted batch documents fail processing. What's the correct remediation approach?
AResubmit the entire batch of 2,000 documents again.
BIdentify the 40 failed documents by custom_id, diagnose why each failed (e.g., exceeded context limits), apply appropriate fixes (e.g., chunking), and resubmit only those.
CDiscard the failed documents permanently and report a 98% completion rate.
DSwitch immediately to the synchronous API for all future submissions.
B is correct. custom_id-based targeted resubmission of only the failed items is the correct, efficient remediation.
D4-Q8 · single select
You want the same Claude session that just wrote a complex refactor to also review it for bugs before merging. A colleague suggests this is sufficient if you add "please critically review your own work" to the prompt. Is this a reliable practice?
AYes, explicit self-review instructions fully substitute for independent review.
BNo, the generating session retains reasoning context and tends not to critically question its own decisions even with explicit self-review instructions; use an independent instance/session instead.
CYes, but only if extended thinking is also enabled.
DNo, self-review should never be attempted even as a first-pass check.
B is correct. this is the documented self-review limitation; independent instances are more effective, though a quick self-pass isn't harmful, it shouldn't be the only review.
D4-Q9 · single select
You're designing an extraction schema for a document category field where new, previously unseen categories occasionally appear. Which pattern best balances structure with extensibility?
AA free-text string field with no enum constraint at all.
BA strict enum with a fixed, closed list of categories and no fallback value.
CAn enum including known categories plus "other", paired with a separate category_other_detail string field.
DA boolean field indicating whether the category is "standard" or not.
C is correct. the enum + "other" + detail-string pattern captures novel values without breaking schema structure or forcing a bad-fit categorization.
D4-Q10 · single select
A large PR review produces contradictory feedback: the same code pattern is flagged as a bug in one file and implicitly accepted in another file within the same review pass. What's the best architectural fix?
ARun the exact same single-pass review three times and average results.
BSplit the review into individual per-file passes for local issues, plus a separate cross-file integration pass, rather than one large single pass.
CReduce the PR size requirement to one file per PR going forward, with no change to the review architecture.
DAdd an instruction telling the model "be consistent across files."
B is correct. this is the attention-dilution fix: splitting into per-file plus integration passes, not simply asking for more consistency in one large pass.
Domain 5 · Chapter 13

7. Domain 5: Context Management & Reliability (15%)

This domain covers preserving critical information across long interactions, escalation/ambiguity resolution, error propagation across multi-agent systems, managing context in large codebase exploration, human review workflow design, and provenance/uncertainty handling in synthesis.

7.1 Task Statement: Manage conversation context to preserve critical information across long interactions

◆ Pitfall · summarization erodes hard facts

Progressive summarization risk. Repeatedly summarizing a long conversation to save tokens tends to erode exactly the details that matter most operationally: precise numbers, percentages, dates, and specific customer-stated expectations get smoothed into vague paraphrases ("the customer mentioned some amount around…" instead of "$247.83"). Summarize the narrative, but extract and persist hard facts separately, verbatim.

"Lost in the middle." Long inputs are processed reliably at the beginning and end, but details buried in the middle are more likely to be under-weighted or missed. Mitigate by placing key findings/summaries first, and organizing detailed supporting material with explicit section headers so nothing important is stranded in an undifferentiated middle block.

Verbose tool outputs bloat context disproportionately to relevance. An order lookup might return 40+ fields; if only 5 are relevant to the current task (e.g., handling a return), keep only those 5 in context going forward rather than letting the full raw payload accumulate turn after turn.

◆ Tip · the persistent "case facts" block

Practical pattern: a persistent "case facts" block. Extract transactional facts (amounts, dates, order numbers, statuses) into a dedicated, structured block that is included in every prompt, separate from (and immune to) the summarized/compressed conversation history. This guarantees the facts that matter most survive regardless of how aggressively the rest of the conversation gets compressed.

Multi-agent context budgets. When a downstream agent (e.g., a synthesis agent with a limited context budget) depends on an upstream agent's output, have the upstream agent emit structured data (key facts, citations, relevance scores) instead of verbose prose and reasoning chains: this respects the downstream agent's context budget while preserving what's actually needed.

7.2 Task Statement: Design effective escalation and ambiguity resolution patterns

◆ Key idea · the three real escalation triggers

When to escalate - three canonical triggers: 1. The customer explicitly asks for a human: honor this immediately, without first attempting your own investigation. 2. There's a policy gap or exception: the policy is silent or ambiguous about the customer's specific situation (e.g., a competitor price-match request when policy only covers the company's own past sales): this is a gap, not merely "a complex case," and gaps should escalate. 3. The agent is unable to make meaningful progress on the issue.

◆ Pitfall · sentiment and self-confidence are not triggers

What's NOT a reliable escalation trigger: - Sentiment/frustration detection: frustration doesn't reliably correlate with actual case complexity; a frustrated customer with a simple, resolvable issue shouldn't be escalated just because they're annoyed (acknowledge frustration and offer to resolve; only escalate if they then reiterate wanting a human). - Self-reported confidence scores: a model can be confidently wrong on exactly the hard cases where confidence-based routing would matter most; self-reported confidence is not a validated calibration signal on its own (see 7.5 for how to actually validate confidence).

Multiple ambiguous matches require clarification, not heuristic guessing. If a customer lookup returns multiple plausible matches, the agent should ask for an additional identifying detail, not silently pick the "most likely" match based on a heuristic, which risks operating on the wrong account entirely.

7.3 Task Statement: Implement error propagation strategies across multi-agent systems

(This overlaps with Domain 2's Task 2.2 and Domain 1's coordinator patterns: the exam tests it from the "system reliability" angle here.)

  • Structured error context enables intelligent coordinator recovery: failure type, what was attempted, any partial results obtained, and possible alternative approaches: this is what lets a coordinator decide to retry differently, try an alternate path, or proceed with partial results and flag the gap.
  • Access failures vs. valid empty results must be distinguished: a timeout is a "something went wrong, decide what to do" situation; a successful query that legitimately found nothing is a valid answer, not a failure.
  • Generic statuses hide value. "Search unavailable" tells the coordinator nothing actionable: was it a timeout? Rate limit? Invalid query? Each implies a different recovery path.
  • Two explicit anti-patterns: silently suppressing errors (returning an empty result as if it were a successful search, hiding a real failure) and terminating the entire multi-agent workflow because of one subagent's failure (when the workflow could reasonably proceed with partial results and an annotated gap).
  • Coverage annotations in synthesis. When some sources were unavailable, the final synthesized output should explicitly annotate which findings are well-supported vs. which topic areas have coverage gaps due to unavailable sources, rather than presenting a report that looks uniformly complete when it isn't.

7.4 Task Statement: Manage context effectively in large codebase exploration

  • Context degradation in extended sessions. In very long exploration sessions, models can start giving inconsistent answers or referencing generic "typical patterns" instead of the specific classes/functions they actually discovered earlier in the session, a sign that earlier, specific findings have effectively been pushed out of effective attention.
  • Scratchpad files. Have the agent persist key findings to a scratchpad file as it explores, and reference that file for later questions: this counteracts context degradation by giving the agent a durable, explicit record instead of relying on it "remembering" everything from deep in a long session.
  • Subagent delegation for isolation. Spawn subagents to investigate specific, bounded questions ("find all test files," "trace the refund flow's dependencies") while the main agent stays focused on high-level coordination: this parallels the Explore subagent pattern from Domain 3 and keeps the main session's context budget from being consumed by exploratory noise.
  • Summarize before delegating the next phase. Summarize key findings from one exploration phase, and inject that summary into the initial context of the next phase's subagents, rather than re-deriving everything from scratch or hoping context carries forward implicitly.
  • Crash recovery via structured state exports. Design each agent to export its state to a known location (a "manifest"); on resume, the coordinator loads the manifest and injects the relevant state into the resumed agents' prompts: this makes recovery survive crashes without needing full re-exploration.
  • /compact. Use this to reduce context usage during long exploration sessions once context fills with verbose discovery output, rather than letting the session silently degrade or hit hard context limits.

7.5 Task Statement: Design human review workflows and confidence calibration

  • Aggregate accuracy can mask segment-level failure. A 97% overall accuracy figure can hide the fact that one document type or one specific field performs far worse than the aggregate suggests: always break down accuracy by document type and by field, not just as one overall number, before deciding it's safe to reduce human review.
  • Stratified random sampling. Even for extractions the model reports as high-confidence, take a stratified random sample for ongoing human review: this measures the true error rate on "confident" outputs (which is not necessarily zero) and helps detect novel error patterns that wouldn't show up if you only ever reviewed low-confidence cases.
  • Field-level confidence, calibrated against labeled data. Have the model output a confidence score per field (not one blanket document-level score), and calibrate the meaning of those scores (e.g., "confidence 0.8 corresponds to roughly X% actual accuracy") using a labeled validation set: routing decisions should be based on this calibrated mapping, not the model's raw, unvalidated confidence number.
  • Routing priority. Send low-confidence extractions, and extractions from ambiguous or internally contradictory source documents, to human review first: this prioritizes limited reviewer capacity where it has the highest expected value.

7.6 Task Statement: Preserve information provenance and handle uncertainty in multi-source synthesis

  • Summarization loses attribution by default. If findings are compressed during a summarization step without deliberately preserving which claim came from which source, that link is gone: attribution has to be a first-class structured field, not something you hope survives prose compression.
  • Structured claim-source mappings (claim, evidence excerpt, source URL/document name, publication/collection date) should be preserved and merged, not discarded, as findings flow from research/analysis subagents through to the synthesis agent.
  • Conflicting statistics from credible sources. Don't arbitrarily pick one value and discard the other. Annotate the conflict explicitly, with both values and their respective source attributions, and let the report itself (or the coordinator, before final synthesis) present the disagreement rather than silently resolving it in one direction.
  • Temporal data. Require publication/collection dates on structured findings so that a difference between two sources that's actually just a temporal difference (the world changed between when each source was published) isn't misread as a contradiction.
  • Content-appropriate rendering. Different content types deserve different presentation in a synthesized report: financial data as tables, news narrative as prose, technical findings as structured lists, rather than flattening everything into one uniform text format, which tends to obscure exactly the structure (numeric precision, categorical breakdowns) that makes each type useful.
Domain 5 · Chapter 14

Domain 5: Practice Questions

D5-Q1 · single select
Across a long customer support conversation, the agent progressively summarizes earlier turns to save tokens. Eventually it responds to the customer with "your refund of approximately some amount" instead of the exact figure discussed 20 turns earlier. What's the best fix?
AStop summarizing entirely and always pass the full raw transcript, regardless of length.
BExtract transactional facts (exact amounts, dates, order numbers) into a persistent "case facts" block included in every prompt, separate from the summarized narrative.
CAsk the customer to repeat the amount each turn.
DRound all monetary figures to the nearest ten dollars to simplify tracking.
B is correct. persistent structured fact extraction directly counters progressive-summarization erosion of precise details.
D5-Q2 · single select
A customer says, "This is fine, but I'd really like to speak to a person about it," early in an otherwise simple, resolvable interaction. What should the agent do?
AAttempt to resolve the issue first since it's simple, then ask again if they still want a human.
BHonor the explicit request for a human immediately, without first attempting to investigate or resolve the issue.
CIgnore the request since the issue is within the agent's capability.
DEscalate only after asking the customer to rate their frustration level 1-10.
B is correct. explicit requests for a human should be honored immediately, regardless of whether the underlying issue looks simple.
D5-Q3 · single select
A web-search subagent times out. The coordinator receives only {"status": "search unavailable"}. What's the primary problem with this design?
ANothing, the coordinator can proceed without any further information.
BThe generic status hides actionable context (failure type, what was attempted, partial results), preventing the coordinator from making an intelligent recovery decision.
CThe status should have been an HTTP 500 code instead of text.
DThe subagent should have crashed the whole pipeline instead of returning a status.
B is correct. this is the "generic error hides value" anti-pattern; structured context (failure type, attempted query, partial results, alternatives) is required for good recovery decisions.
D5-Q4 · single select
During a multi-hour codebase exploration session, the agent starts describing "typical" patterns instead of the specific classes it identified two hours earlier. What's the most effective mitigation?
ARestart the session from scratch every 30 minutes as a preventive measure.
BHave the agent maintain a scratchpad file recording key findings and reference it for later questions, counteracting context degradation.
CReduce max_tokens for each response to force brevity.
DDisable all tool use for the remainder of the session.
B is correct. scratchpad persistence is the documented countermeasure for context degradation over long sessions.
D5-Q5 · single select
An extraction system reports 97% overall accuracy. Should you reduce human review across the board based on this number alone?
AYes, 97% comfortably clears most production accuracy bars.
BNot necessarily, aggregate accuracy can mask poor performance on specific document types or fields; break down accuracy by document type and field first.
CYes, but only reduce review by half as a compromise.
DNo, never reduce human review regardless of measured accuracy.
B is correct. the exam explicitly tests this masking risk; segment-level validation must precede reducing review.
D5-Q6 · single select
Two credible sources report different figures for the same statistic in a research synthesis task. What's the correct handling?
APick the source that seems more authoritative and silently discard the other value.
BAverage the two numbers and present the average as the figure.
CPreserve both values with their respective source attributions, explicitly annotate the conflict, and let the report distinguish well-established from contested findings.
DOmit the statistic entirely to avoid the appearance of inconsistency.
C is correct. conflicting credible sources should be annotated, not arbitrarily resolved or hidden.
D5-Q7 · single select
A customer lookup tool returns three possible matches for the name and email provided. What should the agent do?
APick the match with the most recent account activity.
BPick the first match returned by the API.
CAsk the customer for an additional identifying detail (e.g., order number, billing zip) to disambiguate.
DProceed with a merged view treating all three matches as one customer.
C is correct. multiple ambiguous matches require clarification, not heuristic selection.
D5-Q8 · single select
A subagent hits a transient network error mid-task. What's the best-practice sequencing?
AImmediately propagate the raw exception to the coordinator with no local handling.
BAttempt local recovery/retry within the subagent first; only propagate to the coordinator if it cannot resolve the issue locally, including partial results and what was attempted.
CSilently return an empty result marked successful.
DTerminate the entire multi-agent workflow immediately.
B is correct. local recovery first, escalate only unresolvable errors with context, is the correct layered approach.
D5-Q9 · single select
Findings from a document-analysis subagent are passed to synthesis as a single block of prose with dates and sources woven informally into sentences. Later, temporal differences between two sources are misreported as a factual contradiction. What structural fix addresses this?
ARequire subagents to include explicit publication/collection dates as structured fields (not just embedded in prose) so synthesis can correctly attribute differences to timing rather than contradiction.
BInstruct the synthesis agent to "always assume sources agree."
COnly use the most recently published source and discard all older ones.
DRemove dates from the report entirely to sidestep the issue.
A is correct. structured, explicit temporal metadata prevents timing differences from being misclassified as contradictions.
D5-Q10 · single select
Which combination of signals is the least reliable basis for deciding whether to escalate a customer support case to a human?
ACustomer explicitly asks for a human agent.
BThe stated policy is silent on the customer's specific scenario.
CThe model's self-reported confidence score and detected customer sentiment/frustration level.
DThe agent has made no meaningful progress after reasonable attempts.
C is correct. self-reported confidence and sentiment are both explicitly called out as unreliable proxies for actual case complexity; A, B, and D are all legitimate, well-supported escalation triggers.
Chapter 15

8. The Six Official Exam Scenarios: Deep Walkthroughs

The exam presents 4 of these 6 scenarios at random each sitting. Each scenario below explains what it's really testing and which domain concepts to have ready.

Scenario 1: Customer Support Resolution Agent

You are building a customer support resolution agent using the Claude Agent SDK. The agent handles high-ambiguity requests like returns, billing disputes, and account issues. It has access to your backend systems through custom MCP tools (get_customer, lookup_order, process_refund, escalate_to_human). Target: 80%+ first-contact resolution while knowing when to escalate.

Primary domains tested: Agentic Architecture & Orchestration, Tool Design & MCP Integration, Context Management & Reliability.

What to have ready: - The enforcement vs. prompt distinction for the get_customer → process_refund ordering (Domain 1, Task 1.4/1.5): programmatic gates, not prompt reminders, when money is involved. - Tool description quality for get_customer vs. lookup_order: thin, near-identical descriptions cause misrouting (Domain 2, Task 2.1). - Escalation calibration: explicit criteria + few-shot examples, not sentiment or self-confidence (Domain 5, Task 5.2). - Structured error handling for process_refund (business-rule violations like refund-over-threshold) vs. transient failures (Domain 2, Task 2.2). - Multi-concern decomposition when a customer bundles several issues in one message (Domain 1, Task 1.4). - Ambiguous customer matches requiring clarification (Domain 5, Task 5.2). - Structured handoff summaries for escalate_to_human (Domain 1, Task 1.4).

Scenario 2: Code Generation with Claude Code

You use Claude Code for code generation, refactoring, debugging, documentation. You need custom slash commands, CLAUDE.md configuration, and to know when to use plan mode vs. direct execution.

Primary domains tested: Claude Code Configuration & Workflows, Context Management & Reliability.

What to have ready: - CLAUDE.md hierarchy: user vs. project vs. directory scope, and the classic "new teammate doesn't get the rules" diagnostic (Domain 3, Task 3.1). - Slash command scoping: .claude/commands/ (project, shared) vs. ~/.claude/commands/ (personal) (Domain 3, Task 3.2). - Plan mode vs. direct execution decision criteria: scale, ambiguity of approach, architectural stakes (Domain 3, Task 3.4). - Path-specific rules in .claude/rules/ for conventions that vary by file type/area (Domain 3, Task 3.3). - Iterative refinement techniques: concrete examples, test-driven iteration, the interview pattern (Domain 3, Task 3.5). - Explore subagent and /compact for managing context during long exploration (Domain 5, Task 5.4).

Scenario 3: Multi-Agent Research System

A coordinator delegates to a web-search subagent, a document-analysis subagent, a synthesis subagent, and a report-generation subagent. Produces cited, comprehensive reports.

Primary domains tested: Agentic Architecture & Orchestration, Tool Design & MCP Integration, Context Management & Reliability.

What to have ready: - Task decomposition breadth: the "narrow decomposition misses whole subtopics" failure mode is the single most repeated pattern for this scenario (Domain 1, Task 1.2). - Explicit context passing between subagents (no automatic inheritance), and structured content/metadata separation for attribution (Domain 1, Task 1.3). - Parallel subagent spawning via multiple Task calls in one turn (Domain 1, Task 1.3). - Scoped tool distribution: synthesis agent shouldn't have full search tools; maybe a narrow verify_fact tool (Domain 2, Task 2.3). - Error propagation: structured context on subagent failure, distinguishing access failures from valid empty results (Domain 5, Task 5.3). - Provenance preservation: claim-source mappings, conflict annotation, temporal metadata (Domain 5, Task 5.6).

Scenario 4: Developer Productivity with Claude

An agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate, and automate repetitive tasks, using built-in tools (Read, Write, Bash, Grep, Glob) plus MCP servers.

Primary domains tested: Tool Design & MCP Integration, Claude Code Configuration & Workflows, Agentic Architecture & Orchestration.

What to have ready: - Built-in tool selection: Grep for content search, Glob for filename patterns, Read/Write vs. Edit, and the Edit-fails-on-non-unique-match fallback (Domain 2, Task 2.5). - Incremental exploration: Grep for entry points, then Read to trace flows, not reading everything upfront (Domain 2, Task 2.5). - MCP resources vs. tools for exposing content catalogs, and MCP server scoping (project vs. user) (Domain 2, Task 2.4). - Task decomposition for open-ended work, e.g., "add comprehensive tests to a legacy codebase" (Domain 1, Task 1.6). - Subagent delegation for context isolation during large-scale exploration (Domain 5, Task 5.4).

Scenario 5: Claude Code for Continuous Integration

Claude Code runs automated code reviews, generates test cases, and gives PR feedback in CI/CD. You need prompts that give actionable feedback and minimize false positives.

Primary domains tested: Claude Code Configuration & Workflows, Prompt Engineering & Structured Output.

What to have ready: - -p/--print for non-interactive CI runs; --output-format json + --json-schema for machine-parseable output (Domain 3, Task 3.6). - Session isolation for review: an independent instance reviews better than the generating session reviewing itself (Domain 3, Task 3.6 / Domain 4, Task 4.6). - Explicit precision criteria to reduce false positives, not vague "be conservative" instructions (Domain 4, Task 4.1). - Avoiding duplicate re-review comments across commits, and avoiding duplicate generated tests (Domain 3, Task 3.6). - Multi-pass review for large PRs to avoid attention dilution/contradictions (Domain 1, Task 1.6 / Domain 4, Task 4.6).

Scenario 6: Structured Data Extraction

Extracts information from unstructured documents, validates output using JSON schemas, handles edge cases, integrates downstream.

Primary domains tested: Prompt Engineering & Structured Output, Context Management & Reliability.

What to have ready: - tool_use + JSON schema for guaranteed-shape output; know it doesn't catch semantic errors (Domain 4, Task 4.3). - Nullable fields to prevent fabrication; enum + "other" for extensibility (Domain 4, Task 4.3). - Validation-retry loops and knowing when retries can't help (missing info vs. format errors) (Domain 4, Task 4.4). - Batch processing fit: Message Batches API for latency-tolerant bulk extraction, not blocking workflows (Domain 4, Task 4.5). - Human review routing: field-level calibrated confidence, stratified sampling, accuracy by document type/field (Domain 5, Task 5.5).

Chapter 16

9. Official Sample Questions (from the Exam Guide, with explanations)

These 12 questions are reproduced directly from the official Claude Certified Architect - Foundations Exam Guide, which explicitly publishes them "to illustrate the format and difficulty level of the exam." They are the closest thing to real, sanctioned exam items available for study, so make sure you can explain why each wrong answer is wrong, not just which letter is correct.

Scenario: Customer Support Resolution Agent

Sample Q1 · single select
Production data shows that in 12% of cases, your agent skips get_customer entirely and calls lookup_order using only the customer's stated name, occasionally leading to misidentified accounts and incorrect refunds. What change would most effectively address this reliability issue?
AAdd a programmatic prerequisite that blocks lookup_order and process_refund calls until get_customer has returned a verified customer ID.
BEnhance the system prompt to state that customer verification via get_customer is mandatory before any order operations.
CAdd few-shot examples showing the agent always calling get_customer first, even when customers volunteer order details.
DImplement a routing classifier that analyzes each request and enables only the subset of tools appropriate for that request type.
A is correct. When a specific tool sequence is required for critical business logic (like verifying customer identity before processing refunds), programmatic enforcement provides deterministic guarantees that prompt-based approaches cannot. B and C rely on probabilistic LLM compliance, insufficient when errors have financial consequences. D addresses tool availability, not tool ordering, not the actual problem.
Sample Q2 · single select
Production logs show the agent frequently calls get_customer when users ask about orders (e.g., "check my order #12345"), instead of calling lookup_order. Both tools have minimal descriptions ("Retrieves customer information" / "Retrieves order details") and accept similar identifier formats. What's the most effective first step to improve tool selection reliability?
AAdd few-shot examples to the system prompt demonstrating correct tool selection patterns, with 5-8 examples showing order-related queries routing to lookup_order.
BExpand each tool's description to include input formats it handles, example queries, edge cases, and boundaries explaining when to use it versus similar tools.
CImplement a routing layer that parses user input before each turn and pre-selects the appropriate tool based on detected keywords and identifier patterns.
DConsolidate both tools into a single lookup_entity tool that accepts any identifier and internally determines which backend to query.
B is correct. Tool descriptions are the primary mechanism LLMs use for tool selection. Minimal descriptions leave models without context to differentiate similar tools; B directly fixes the root cause with a low-effort, high-leverage change. Few-shot examples (A) add token overhead without fixing the underlying issue. A routing layer (C) is over-engineered and bypasses the LLM's natural-language understanding. Consolidating tools (D) is valid but is more effort than warranted for a "first step."
Sample Q3 · single select
Your agent achieves 55% first-contact resolution, well below the 80% target. Logs show it escalates straightforward cases (standard damage replacements with photo evidence) while attempting to autonomously handle complex situations requiring policy exceptions. What's the most effective way to improve escalation calibration?
AAdd explicit escalation criteria to your system prompt with few-shot examples demonstrating when to escalate versus resolve autonomously.
BHave the agent self-report a confidence score (1-10) before each response and automatically route requests to humans when confidence falls below a threshold.
CDeploy a separate classifier model trained on historical tickets to predict which requests need escalation before the main agent begins processing.
DImplement sentiment analysis to detect customer frustration levels and automatically escalate when negative sentiment exceeds a threshold.
A is correct. Explicit escalation criteria with few-shot examples directly address the root cause: unclear decision boundaries. This is the proportionate first response before adding infrastructure. B fails because self-reported confidence is poorly calibrated: the agent is already incorrectly confident on hard cases. C is over-engineered without labeled data/ML infrastructure justification. D solves a different problem: sentiment doesn't correlate with case complexity.

Scenario: Code Generation with Claude Code

Sample Q4 · single select
You want to create a custom /review slash command that runs your team's standard code review checklist, available to every developer when they clone or pull the repository. Where should you create this command file?
AIn the .claude/commands/ directory in the project repository
BIn ~/.claude/commands/ in each developer's home directory
CIn the CLAUDE.md file at the project root
DIn a .claude/config.json file with a commands array
A is correct. Project-scoped custom slash commands live in .claude/commands/ within the repo: version-controlled and automatically available to all developers on clone/pull. B is for personal, unshared commands. C is for project instructions/context, not command definitions. D describes a mechanism that doesn't exist in Claude Code.
Sample Q5 · single select
You've been assigned to restructure the team's monolithic application into microservices, involving changes across dozens of files and decisions about service boundaries and module dependencies. Which approach should you take?
AEnter plan mode to explore the codebase, understand dependencies, and design an implementation approach before making changes.
BStart with direct execution and make changes incrementally, letting the implementation reveal the natural service boundaries.
CUse direct execution with comprehensive upfront instructions detailing exactly how each service should be structured.
DBegin in direct execution mode and only switch to plan mode if you encounter unexpected complexity during implementation.
A is correct. Plan mode is designed for complex tasks with large-scale changes, multiple valid approaches, and architectural decisions: exactly this scenario. It enables safe exploration and design before committing to changes. B risks costly rework from late-discovered dependencies. C assumes the right structure is already known without exploring the code. D ignores that the complexity is already stated in the requirements, not something that might emerge later.
Sample Q6 · single select
Your codebase has distinct areas with different conventions (React functional components with hooks; API handlers with async/await and specific error handling; database models with a repository pattern). Test files are spread throughout the codebase next to the code they test, and you want all tests to follow the same conventions regardless of location. What's the most maintainable way to ensure Claude automatically applies the correct conventions?
ACreate rule files in .claude/rules/ with YAML frontmatter specifying glob patterns to conditionally apply conventions based on file paths
BConsolidate all conventions in the root CLAUDE.md file under headers for each area, relying on Claude to infer which section applies
CCreate skills in .claude/skills/ for each code type that include the relevant conventions in their SKILL.md files
DPlace a separate CLAUDE.md file in each subdirectory containing that area's specific conventions
A is correct. .claude/rules/ with glob patterns (e.g., **/*.test.tsx) applies conventions automatically based on file path regardless of directory location: essential for test files spread throughout the codebase. B relies on inference, not explicit matching. C requires manual invocation or model choice, contradicting the need for deterministic, automatic application. D can't easily cover files spread across many directories since CLAUDE.md files are directory-bound.

Scenario: Multi-Agent Research System

Sample Q7 · single select
After running the system on "impact of AI on creative industries," each subagent completes successfully, but the final report covers only visual arts, missing music, writing, and film. The coordinator's logs show it decomposed the topic into "AI in digital art creation," "AI in graphic design," and "AI in photography." What is the most likely root cause?
AThe synthesis agent lacks instructions for identifying coverage gaps in the findings it receives from other agents.
BThe coordinator agent's task decomposition is too narrow, resulting in subagent assignments that don't cover all relevant domains of the topic.
CThe web search agent's queries are not comprehensive enough and need to be expanded to cover more creative industry sectors.
DThe document analysis agent is filtering out sources related to non-visual creative industries due to overly restrictive relevance criteria.
B is correct. The coordinator's logs reveal the root cause directly: decomposition into only visual-arts subtasks, omitting music, writing, film. Subagents executed their assigned tasks correctly. The problem is what they were assigned. A, C, and D incorrectly blame downstream agents working correctly within their assigned scope.
Sample Q8 · single select
A web search subagent times out while researching a complex topic. Which error-propagation approach best enables intelligent recovery by the coordinator?
AReturn structured error context including the failure type, the attempted query, any partial results, and potential alternative approaches.
BImplement automatic retry with exponential backoff within the subagent, returning a generic "search unavailable" status only after all retries are exhausted.
CCatch the timeout within the subagent and return an empty result set marked as successful.
DPropagate the timeout exception directly to a top-level handler that terminates the entire research workflow.
A is correct. Structured error context gives the coordinator what it needs for intelligent recovery decisions. B's generic status hides valuable context. C suppresses the error by marking failure as success, preventing recovery. D terminates the whole workflow unnecessarily when recovery could succeed.
Sample Q9 · single select
The synthesis agent frequently needs to verify specific claims while combining findings; currently it returns control to the coordinator, which invokes the search agent, then re-invokes synthesis: 2-3 round trips per task, +40% latency. 85% of verifications are simple fact-checks; 15% need deeper investigation. What's the most effective approach to reduce overhead while maintaining reliability?
AGive the synthesis agent a scoped verify_fact tool for simple lookups, while complex verifications continue delegating to the web search agent through the coordinator.
BHave the synthesis agent accumulate all verification needs and return them as a batch to the coordinator at the end of its pass, which then sends them all to the web search agent at once.
CGive the synthesis agent access to all web search tools so it can handle any verification need directly without round-trips through the coordinator.
DHave the web search agent proactively cache extra context around each source during initial research, anticipating what the synthesis agent might need to verify.
A is correct. This applies least-privilege: give synthesis only what it needs for the 85% common case, preserving existing coordination for complex cases. B's batching creates blocking dependencies since synthesis steps may depend on earlier-verified facts. C over-provisions, violating separation of concerns. D relies on speculative caching that can't reliably predict verification needs.

Scenario: Claude Code for Continuous Integration

Sample Q10 · single select
Your pipeline script runs claude "Analyze this pull request for security issues" but the job hangs indefinitely, waiting for interactive input. What's the correct approach for automated pipelines?
AAdd the -p flag: claude -p "Analyze this pull request for security issues"
BSet the environment variable CLAUDE_HEADLESS=true before running the command
CRedirect stdin from /dev/null: claude "Analyze this pull request for security issues" < /dev/null
DAdd the --batch flag: claude --batch "Analyze this pull request for security issues"
A is correct. -p/--print is the documented non-interactive mode: it processes the prompt, outputs to stdout, and exits without waiting for input. The others reference non-existent features or Unix workarounds that don't properly address Claude Code's syntax.
Sample Q11 · single select
Real-time Claude calls power two workflows: (1) a blocking pre-merge check that must complete before developers can merge, and (2) a technical-debt report generated overnight. Your manager proposes switching both to the Message Batches API for its 50% savings. How should you evaluate this?
AUse batch processing for the technical debt reports only; keep real-time calls for pre-merge checks.
BSwitch both workflows to batch processing with status polling to check for completion.
CKeep real-time calls for both workflows to avoid batch result ordering issues.
DSwitch both to batch processing with a timeout fallback to real-time if batches take too long.
A is correct. The Batches API offers 50% savings but up to 24-hour processing with no guaranteed latency SLA: unsuitable for blocking pre-merge checks where developers wait, but ideal for overnight jobs. B is wrong because "often faster" isn't acceptable for blocking workflows. C reflects a misconception: batch results correlate via custom_id. D adds unnecessary complexity when matching each API to its use case is simpler.
Sample Q12 · single select
A pull request modifies 14 files across the stock-tracking module. A single-pass review of all files together produces inconsistent results: detailed feedback for some files, superficial comments for others, missed obvious bugs, and contradictory feedback (flagging a pattern as problematic in one file while approving identical code elsewhere in the same PR). How should you restructure the review?
ASplit into focused passes: analyze each file individually for local issues, then run a separate integration-focused pass examining cross-file data flow.
BRequire developers to split large PRs into smaller submissions of 3-4 files before the automated review runs.
CSwitch to a higher-tier model with a larger context window to give all 14 files adequate attention in one pass.
DRun three independent review passes on the full PR and only flag issues that appear in at least two of the three runs.
A is correct. Splitting into focused passes directly addresses attention dilution when processing many files at once; file-by-file analysis ensures consistent depth, and a separate integration pass catches cross-file issues. B shifts burden to developers without improving the system. C misunderstands that larger context windows don't fix attention-quality issues. D would suppress detection of real bugs caught only intermittently.
Chapter 17

Full Practice Exam · Q1-10

This section simulates real exam pacing: a mix of scenario-flavored, multiple-choice and multiple-response questions spanning all five domains, roughly weighted to the blueprint. Answer every question first, then check the answer key at the end: resist the urge to peek early, since the point is to rehearse the actual exam experience (120 minutes / 60 items ≈ 2 minutes/item; try 30 items in ~55-60 minutes).

Practice Exam · Q1 · single select
In an agentic loop, which single field on the API response should your application code check to decide whether to keep executing tools or return the final answer to the user?
Acontent[0].text
Bstop_reason
Crole
Dusage.output_tokens
B is correct. stop_reason is the authoritative control signal for loop continuation/termination.
Practice Exam · Q2 · single select
A coordinator agent's allowedTools list does not include "Task". What is the direct consequence?
ASubagents run slower
BThe coordinator cannot spawn subagents at all
CSubagents inherit full parent context automatically
DHooks stop functioning
B is correct. Task must be in allowedTools for subagent spawning to be possible at all.
Practice Exam · Q3 · single select
Which of these is the correct behavior when a subagent needs information gathered by a previous subagent?
ARely on shared memory automatically maintained by the SDK
BThe coordinator must explicitly include that information in the new subagent's prompt
CThe new subagent should re-derive the information independently every time
DUse fork_session to inherit the prior subagent's full context
B is correct. subagents don't inherit context automatically; the coordinator must explicitly pass it.
Practice Exam · Q4 · single select
A support agent's refund tool should never process a refund above $500 without human sign-off, no matter what the model decides. What's the correct mechanism?
AA prominent instruction at the top of the system prompt
BA tool-call interception hook that blocks the call and redirects to escalation
CA few-shot example showing refusal above $500
DIncreasing the temperature to make the model more cautious
B is correct. deterministic enforcement (a hook) is required when a business rule must never be violated.
Practice Exam · Q5 · select 2
(Multiple response, select 2) Which are legitimate reasons to use fork_session rather than --resume?
AYou want to explore two divergent refactoring approaches from the same analysis baseline.
BYou want to continue the exact same investigation with no branching.
CYou want to compare two different testing strategies starting from shared context.
DYou want to permanently merge two unrelated sessions into one.
A and C are correct. fork_session is for exploring divergent approaches from a shared baseline.
Practice Exam · Q6 · single select
A generic analyze_document tool is used for summarization, extraction, and fact-checking, and the agent frequently applies the wrong sub-behavior. What's the best fix?
AAdd a temperature parameter to the tool
BSplit it into purpose-specific tools (e.g., summarize_content, extract_data_points, verify_claim_against_source) with clear contracts
CRename the tool without changing its description
DAdd a confidence field to its output schema
B is correct. splitting an overloaded generic tool into purpose-specific tools with clear contracts fixes misapplied sub-behaviors.
Practice Exam · Q7 · single select
Which MCP error field indicates whether the agent should attempt the same call again?
AerrorCategory
BisRetryable
Cmessage
DstatusCode
B is correct. isRetryable explicitly signals whether a retry is appropriate.
Practice Exam · Q8 · single select
A synthesis agent is given all 12 of the system's tools "to be safe." What's the likely effect on reliability?
AImproved reliability, since more tools mean more flexibility
BDegraded tool-selection reliability and likely misuse of tools outside its specialization
CNo measurable effect either way
DImproved latency due to fewer round trips
B is correct. too many tools (especially outside an agent's specialization) degrades selection reliability.
Practice Exam · Q9 · single select
Which tool_choice setting guarantees a tool call happens but lets the model pick which tool?
A"auto"
B"any"
CForced/named tool selection
DOmitting tool_choice
B is correct. "any" guarantees a tool call while leaving tool choice to the model.
Practice Exam · Q10 · single select
Where should credentials for a team-shared MCP server be referenced to avoid committing secrets to version control?
AHardcoded directly in .mcp.json
BVia environment variable expansion (e.g., ${TOKEN}) inside .mcp.json
CIn a comment inside CLAUDE.md
DIn the tool's description field
B is correct. environment variable expansion in .mcp.json avoids committing secrets.
Chapter 18

Full Practice Exam · Q11-20

Practice Exam · Q11 · single select
What best distinguishes an MCP resource from an MCP tool?
AResources are faster than tools
BResources expose browsable content (e.g., a catalog or schema); tools perform actions
CTools are user-scoped; resources are project-scoped
DThere is no meaningful difference
B is correct. resources expose browsable content; tools perform actions.
Practice Exam · Q12 · single select
A developer wants a personal MCP server for an experimental integration not shared with the team. Where should it be configured?
A.mcp.json in the repo
B~/.claude.json
C.claude/rules/
DCLAUDE.md
B is correct. personal/experimental servers belong in user-scoped ~/.claude.json.
Practice Exam · Q13 · single select
Which built-in tool is correct for locating every file whose name matches **/*.config.js?
AGrep
BGlob
CRead
DBash cat
B is correct. Glob matches file path/name patterns; Grep searches file contents.
Practice Exam · Q14 · single select
Edit cannot find a unique anchor for the text you want to change. What's the reliable fallback?
AKeep retrying with random whitespace changes
BRead the file fully, then Write the modified version back
CGive up and skip the edit
DUse Grep to force a match
B is correct. Read + Write is the reliable fallback when Edit's anchor text isn't unique.
Practice Exam · Q15 · single select
A new hire doesn't receive project-wide coding conventions that are supposedly universal. Where were they most likely misconfigured?
AProject-level .claude/CLAUDE.md, committed to the repo
BUser-level ~/.claude/CLAUDE.md on the original author's machine
C.claude/rules/ with correct glob patterns
D.claude/commands/
B is correct. user-level CLAUDE.md doesn't propagate via version control to new teammates.
Practice Exam · Q16 · single select
Which frontmatter field runs a skill in an isolated sub-agent context so its verbose output doesn't pollute the main conversation?
Aallowed-tools
Bargument-hint
Ccontext: fork
Dscope: private
C is correct. context: fork isolates a skill's execution context from the main conversation.
Practice Exam · Q17 · single select
Conventions must apply to every file matching **/*.test.tsx regardless of directory. What's the most maintainable mechanism?
ADirectory-level CLAUDE.md files in every folder containing tests
B.claude/rules/ with YAML frontmatter paths glob scoping
CA monolithic CLAUDE.md with a "testing" section
DA skill that must be manually run before writing tests
B is correct. glob-scoped .claude/rules/ applies by file pattern regardless of directory.
Practice Exam · Q18 · single select
Which task profile is the clearest fit for plan mode?
AAdding one null check to one function with a known stack trace
BA cross-cutting library migration touching 45+ files with multiple valid integration approaches
CFixing a typo in a log message
DRenaming a single local variable
B is correct. large scale, multiple valid approaches, and architectural decisions are plan mode's use case.
Practice Exam · Q19 · single select
What CLI flag prevents Claude Code from hanging on interactive input inside a CI job?
A--ci
B-p / --print
C--headless
D--batch
B is correct. -p/--print runs Claude Code non-interactively.
Practice Exam · Q20 · single select
Why is it generally unreliable to have the same Claude Code session both generate a risky refactor and then review it for bugs?
AIt costs more in tokens
BThe generating session retains its own reasoning context and is less likely to critically question its own decisions
CReviews always require a different model
DSessions cannot be reused for any purpose
B is correct. the generating session's retained reasoning context makes it a weaker self-reviewer than an independent instance.
Chapter 19

Full Practice Exam · Q21-30

Practice Exam · Q21 · select 2
(Multiple response, select 2) Which are effective techniques for improving output consistency when prose instructions alone produce inconsistent results?
A2-3 concrete input/output examples
BA longer paragraph restating the same instruction more emphatically
CFew-shot examples demonstrating correct handling of ambiguous cases
DLowering max_tokens
A and C are correct. concrete examples and targeted few-shot examples are the effective consistency levers; B and D don't address inconsistency.
Practice Exam · Q22 · single select
A JSON-schema-constrained extraction tool always returns syntactically valid output, but line items sometimes don't sum to the stated total. What does this indicate?
AThe schema mechanism has failed and needs replacing
Btool_use schemas eliminate syntax errors but not semantic errors; add a validation/retry step for semantic checks
CThis is unavoidable and requires no action
DSwitch to plain-text JSON generation instead
B is correct. tool_use schemas guarantee syntactic validity, not semantic correctness; semantic validation/retry is still needed.
Practice Exam · Q23 · single select
A required schema field asks for a "contract end date," but many source contracts are open-ended and never state one. What's the correct schema design?
ARequire the field and instruct the model to guess a plausible date
BMake the field nullable/optional so the model can correctly return null when absent
CRemove date handling from the schema entirely
DDefault the field to today's date
B is correct. nullable/optional fields prevent fabrication when source data is genuinely absent.
Practice Exam · Q24 · single select
Retry attempts on a failed extraction keep failing because the requested field is never mentioned anywhere in the source document. What should you conclude?
AKeep retrying with more emphatic error messages
BRetries can't surface information absent from the source; use a nullable field or a different data source instead
CIncrease temperature to encourage creative inference
DSwitch tool_choice to "auto"
B is correct. retries can't manufacture information that was never in the source; use nullable fields or another source.
Practice Exam · Q25 · single select
Which workload is appropriate for the Message Batches API?
AA blocking pre-merge PR check
BAn overnight technical-debt report reviewed the next morning
CA live chat response to a waiting customer
DA real-time fraud-detection check during checkout
B is correct. non-blocking, latency-tolerant overnight work is the Batches API's ideal fit; A, C, D are all blocking/real-time needs.
Practice Exam · Q26 · single select
What does the custom_id field in a batch request/response pair enable?
AGuaranteed sub-second latency
BCorrelating each response back to its corresponding request
CAutomatic retries with no code changes
DMulti-turn tool calling within one batch request
B is correct. custom_id correlates batch requests to their responses.
Practice Exam · Q27 · single select
Which technique most directly reduces false positives caused by vague review criteria like "only report high-confidence issues"?
AReplacing vague criteria with explicit, categorical rules defining exactly what counts as reportable
BLowering the model's max_tokens
CIncreasing the number of files reviewed per pass
DRemoving all severity levels
A is correct. explicit, categorical criteria (not vague confidence language) reduce false positives.
Practice Exam · Q28 · single select
In a long customer support conversation, progressive summarization risks losing which kind of detail most?
AGeneral conversational tone
BPrecise numbers, dates, and customer-stated expectations
CThe customer's name
DThe overall sentiment trend
B is correct. precise transactional/numeric details are most at risk of being smoothed away by progressive summarization.
Practice Exam · Q29 · select 2
What is the most reliable trigger set for escalating a customer interaction to a human? (Multiple response, select 2)
AThe customer explicitly asks for a human agent
BThe agent's self-reported confidence drops below 5/10
CThe relevant policy is silent or ambiguous about the customer's specific situation
DDetected negative sentiment exceeds a fixed threshold
A and C are correct. explicit human requests and genuine policy gaps are reliable triggers; self-reported confidence and raw sentiment are explicitly called out as unreliable proxies.
Practice Exam · Q30 · single select
Two subagents report different statistics for the same fact from two credible sources. What's the correct synthesis behavior?
ASilently pick the higher number
BPreserve both values with source attribution and explicitly annotate the conflict rather than resolving it silently
CDrop the statistic to avoid controversy
DAverage the two values and present the average as fact
B is correct. conflicting credible sources should be preserved and annotated, not silently resolved, averaged, or dropped.
Chapter 20

11. Domain Cheat Sheets (Final-Review Quick Reference)

Domain 1: Agentic Architecture & Orchestration (27%)

  • Loop control = stop_reason (tool_use → keep going; end_turn → done). Never parse NL text or rely on an iteration cap as the primary mechanism.
  • Coordinator = hub; subagents = spokes. Subagents have no automatic context inheritance: pass everything explicitly.
  • Task tool must be in coordinator's allowedTools to spawn subagents at all.
  • Parallel subagents = multiple Task calls in one turn.
  • Narrow decomposition is the #1 root cause of "each subagent worked, but coverage failed."
  • Enforcement (hooks/prerequisite gates) beats prompts whenever compliance must be guaranteed (money, identity, safety).
  • PostToolUse hooks normalize data; tool-interception hooks block policy violations deterministically.
  • Prompt chaining = fixed, predictable multi-step pipelines. Dynamic decomposition = open-ended investigation.
  • --resume <name> for still-valid context; fork_session for divergent-approach branching; inject a fresh structured summary when prior state is largely stale.

Domain 2: Tool Design & MCP Integration (18%)

  • Tool descriptions are THE primary tool-selection mechanism. Thin/near-identical descriptions → misrouting. Fix descriptions before adding few-shot examples or routing layers.
  • isError flag + errorCategory (transient/validation/business/permission) + isRetryable boolean = structured error design. Generic "failed" messages are an anti-pattern.
  • Distinguish access failures (needs a decision) from valid empty results (a real, successful answer).
  • Fewer, role-scoped tools beat many tools (18 vs. 4-5 measurably hurts reliability). Give narrow cross-role tools for high-frequency needs only.
  • tool_choice: "auto" (model may skip tools), "any" (must call some tool), forced/named (must call this tool).
  • .mcp.json = project scope (shared, ${VAR} expansion for secrets); ~/.claude.json = personal scope. Both active simultaneously.
  • MCP resources = browsable content catalogs; MCP tools = actions.
  • Prefer existing community MCP servers for standard integrations; build custom only for team-specific gaps.
  • Grep = content search; Glob = filename/path pattern; Edit fails on non-unique anchor → fallback to Read + Write.

Domain 3: Claude Code Configuration & Workflows (20%)

  • CLAUDE.md hierarchy: user (~/.claude/CLAUDE.md, personal, not shared) → project (.claude/CLAUDE.md or root, shared/versioned) → directory (subfolder-scoped). "New hire missing rules" = usually a user-vs-project scoping bug.
  • @import keeps CLAUDE.md modular; .claude/rules/ splits topic-specific files as an alternative to one monolith.
  • .claude/commands/ = project-scoped, shared slash commands; ~/.claude/commands/ = personal.
  • Skills live in .claude/skills/; frontmatter: context: fork (isolate verbose output), allowed-tools (restrict tool access), argument-hint (prompt for missing args).
  • .claude/rules/ with YAML paths glob = conditional, file-pattern-based convention loading: the answer whenever conventions must apply "regardless of directory."
  • Plan mode = large scale, multiple valid approaches, architectural stakes. Direct execution = simple, well-scoped, one clear path. They can be sequenced (plan then execute).
  • Explore subagent isolates verbose discovery; /compact reduces context usage mid-session; /memory shows what's actually loaded.
  • Iterative refinement: concrete I/O examples > vague prose; test-driven iteration (write tests, share failures); the interview pattern (ask before building); batch interacting fixes, sequence independent ones.
  • CI: -p/--print for non-interactive mode; --output-format json + --json-schema for structured CI output; independent review instance beats self-review; include prior findings to avoid duplicate re-review comments; include existing tests to avoid duplicate generated tests.

Domain 4: Prompt Engineering & Structured Output (20%)

  • Explicit, categorical criteria reduce false positives; vague "be conservative"/confidence-based instructions don't.
  • Few-shot examples are the top lever for consistent formatting, ambiguous-case handling, and reduced extraction hallucination: 2-4 targeted examples showing why, not just input→output.
  • tool_use + JSON schema eliminates syntax errors, not semantic errors (sums, misplaced values): still need validation.
  • tool_choice: "any" when schema/document type is uncertain; forced/named when a specific extraction must run first.
  • Nullable/optional fields prevent fabrication when data is genuinely absent; enum + "other" + detail string handles novel categories; "unclear" enum handles genuine ambiguity honestly.
  • Retry-with-error-feedback fixes format/structural failures; it cannot fix "the information simply isn't in the document" failures.
  • Message Batches API: 50% cheaper, up to 24h processing, no SLA guarantee, no multi-turn tool calls, custom_id for correlation. Good for non-blocking/overnight; bad for blocking/real-time workflows.
  • Self-review is structurally weaker than independent-instance review (retained reasoning context). Split large reviews into per-file + cross-file integration passes to avoid attention dilution/contradictions.

Domain 5: Context Management & Reliability (15%)

  • Progressive summarization erodes precise facts (amounts, dates): extract them into a persistent "case facts" block outside the summarized narrative.
  • "Lost in the middle": put key findings first/last; use explicit section headers for detailed middle content.
  • Trim verbose tool outputs to only relevant fields before they accumulate in context.
  • Escalate on: explicit human request (immediately), policy gaps/silence, inability to progress. Do not rely on sentiment or self-reported confidence as escalation triggers.
  • Multiple ambiguous matches → ask for another identifier, don't guess heuristically.
  • Structured error propagation (failure type, attempted query, partial results, alternatives) enables coordinator recovery; distinguish access failures from valid empty results; never silently suppress errors or kill the whole workflow over one failure.
  • Long exploration sessions degrade: use scratchpad files, subagent delegation for isolated investigation, pre-phase summarization, manifest-based crash recovery, and /compact.
  • Aggregate accuracy can mask segment-level failure: validate by document type/field. Use stratified sampling on "confident" outputs. Calibrate field-level confidence against labeled data before routing on it.
  • Preserve claim-source mappings through synthesis; annotate (don't silently resolve) conflicting stats; require publication/collection dates to avoid mistaking temporal differences for contradictions; render different content types appropriately (tables, prose, lists).
Chapter 21

12. External Resources for Further Study

This guide is designed to be sufficient on its own, but if you want primary-source documentation or hands-on practice beyond it, these are the most relevant official resources (search for the current versions, since URLs and docs structure can change):

  • Anthropic Partner Academy: Claude Certified Architect - Foundations page: the official course page, exam guide PDF, terms and conditions, and exam policy (the source material this guide was built from).
  • Anthropic's official documentation site (docs.claude.com): look for sections on the Claude Agent SDK, Model Context Protocol, tool use, the Messages API, and Claude Code: these host the canonical, most current reference material for anything this guide summarizes.
  • Claude Code documentation: CLAUDE.md configuration, slash commands, Agent Skills, plan mode, and CLI reference: useful for hands-on practice mirroring Domain 3.
  • Model Context Protocol specification and server registry (modelcontextprotocol.io and its GitHub organization): the MCP spec itself, plus a directory of existing community MCP servers: useful for Domain 2's "prefer existing servers over custom builds" guidance and for seeing real tool/resource definitions.
  • Anthropic's prompt engineering documentation: deeper guidance on few-shot prompting, structured output via tool use, and prompt chaining: directly supports Domain 4.
  • Anthropic's cookbook/example repositories (typically found under Anthropic's GitHub organization): worked code samples for agentic loops, multi-agent patterns, and structured extraction pipelines: good for the hands-on practice this exam explicitly expects.
  • The other Claude certifications (Claude Certified Associate - Foundations, Claude Certified Developer - Foundations, Claude Certified Architect - Professional) on the same Anthropic Partner Academy site, in case you want a broader or deeper credential path afterward.

A final note on studying: this exam is explicitly scenario- and judgment-based, not trivia-based. The single highest-leverage thing you can do beyond reading this guide is to actually build a small version of each of the 6 scenarios, even a toy one, because the "why is A right and B, C, D wrong" reasoning throughout this guide is exactly the reasoning the real exam expects you to reconstruct on the fly for scenarios you haven't seen before. Good luck.

Appendix A · Part 1

API & Tool-Use Fundamentals

The exam is judgment-based, but its scenarios and answer options are written using the concrete artifacts of the Claude API, the Agent SDK, MCP, and Claude Code. You need to recognize these on sight, e.g., to know at a glance that {"type": "tool", "name": "..."} is a forced tool choice, or that a tool_result block carries an is_error flag. This appendix collects those artifacts in one place. The exam's own Appendix lists exactly these technologies as testable, so treat this as required recognition-level knowledge.

A.1 The Claude Messages API: request and response shape

A single API call sends a list of messages (alternating user / assistant roles), optional system prompt, tools, tool_choice, and max_tokens. Minimal request:

{
  "model": "claude-...",
  "max_tokens": 1024,
  "system": "You are a customer support agent. ...",
  "tools": [ /* tool definitions, see A.4 */ ],
  "tool_choice": {"type": "auto"},
  "messages": [
    {"role": "user", "content": "Where is my order #12345?"}
  ]
}

Key fields to recognize: - system: top-level system prompt (a string or list of blocks). Not a message with role: "system"; it's its own parameter. Wording here influences tool selection (Domain 2, Task 2.1). - max_tokens: hard cap on tokens generated in that response. If the model hits it mid-output, the response comes back with stop_reason: "max_tokens" (a truncated, not a completed, turn). - messages: the full conversation so far. The API is stateless: you resend the entire history every call. This is why "passing complete conversation history in subsequent requests" (Domain 5, Task 5.1) matters: the model has no memory beyond what you send. - content: can be a plain string or a list of typed content blocks (text, tool_use, tool_result, image, etc.). Multi-block content is what makes tool use work.

A.2 stop_reason values: the loop control signal

Every assistant response includes a stop_reason. This is the field your agentic loop inspects (Domain 1, Task 1.1).

stop_reasonMeaningLoop action
"tool_use"The model emitted one or more tool_use blocks and is waiting for resultsContinue: execute tools, append tool_result(s), call again
"end_turn"The model finished naturallyTerminate: return final answer
"max_tokens"Output was cut off by the max_tokens capHandle as truncation (raise limit / continue), not as completion
"stop_sequence"A configured stop sequence was hitTerminal, like end_turn, but triggered by your stop string

The exam's canonical anti-patterns: deciding termination by scanning assistant text ("looks done"), or using an iteration cap as the primary stop mechanism. Both are wrong because stop_reason is the designed, reliable signal.

A.3 tool_use and tool_result content blocks

When stop_reason is "tool_use", the assistant message contains one or more blocks like:

{
  "type": "tool_use",
  "id": "toolu_01A2b3...",
  "name": "lookup_order",
  "input": {"order_id": "12345"}
}

You execute the tool, then append a new user message whose content contains a matching tool_result block referencing the same id:

{
  "role": "user",
  "content": [
    {
      "type": "tool_result",
      "tool_use_id": "toolu_01A2b3...",
      "content": "{\"status\": \"shipped\", \"eta\": \"2026-07-24\"}",
      "is_error": false
    }
  ]
}

Recognition points that show up in answer options: - The tool_use_id on the result must match the id of the tool_use block: that's how the model correlates request to result. - is_error: true is the API-level signal that a tool call failed. This is the mechanism behind MCP's isError pattern (Domain 2, Task 2.2): a failed tool doesn't throw; it returns a result flagged as an error so the model can reason about recovery. - Parallel tool use: a single assistant turn can contain multiple tool_use blocks. You return all their results in a single following user message (multiple tool_result blocks). This is the API basis for "emit multiple Task calls in one turn" (Domain 1, Task 1.3).

A.4 Tool definition schema

A tool is defined by a name, a description (the primary selection signal, Domain 2, Task 2.1), and an input_schema (JSON Schema):

{
  "name": "lookup_order",
  "description": "Retrieve the status, line items, and shipping details for a single order. Use when the user references an order number (format ORD-##### or a bare 5-digit number) or asks about shipping/delivery/returns for a specific purchase. Do NOT use for account-level questions. Use get_customer for those.",
  "input_schema": {
    "type": "object",
    "properties": {
      "order_id": {"type": "string", "description": "Order number, e.g. ORD-12345"}
    },
    "required": ["order_id"]
  }
}

Notice the description does the four things the exam rewards: states purpose, gives input format, gives when-to-use, and draws a boundary against the similar get_customer tool.

Appendix A · Part 2

Tool Choice, Hooks & MCP Artifacts

A.5 tool_choice object syntax

ObjectBehaviorWhen to use
{"type": "auto"}Model may call a tool or reply with textDefault; conversational agents
{"type": "any"}Model must call some tool, its pickGuarantee structured output when document/schema type is unknown
{"type": "tool", "name": "extract_metadata"}Model must call this specific toolForce a required step first (then continue in follow-up turns)
{"type": "none"}Model may not call any tool this turnForce a text-only reply

(There is also an optional disable_parallel_tool_use flag to force one-tool-at-a-time; recognize it but it's a minor point.)

A.6 Agent SDK: AgentDefinition and hooks

AgentDefinition (the configuration for a subagent type) conceptually carries: - a description (what this agent is for; helps the coordinator/model decide when to delegate to it), - a system prompt / instructions (its role and quality criteria: prefer goals over rigid procedures, Domain 1, Task 1.3), - tool restrictions (allowedTools / an allowed tool set: scope tightly to role, Domain 2, Task 2.3), - optionally a model choice.

For a coordinator to spawn subagents, its allowedTools must include "Task" (Domain 1, Task 1.3).

Hooks run deterministic code inside the loop, independent of the model's choices (Domain 1, Task 1.5):

HookFiresTypical use
PreToolUse (tool-call interception)Before a requested tool executesBlock a policy-violating call (e.g., refund > $500) and redirect to escalation; enforce prerequisite gates (block process_refund until get_customer verified)
PostToolUseAfter a tool returns, before the model sees the resultNormalize heterogeneous data (Unix ts vs ISO 8601 vs status codes) into one shape; trim/redact verbose fields

Conceptually a PreToolUse hook can allow, block, or modify the pending call; a PostToolUse hook can transform the result. The exam's core point: use hooks (deterministic) whenever a rule must be guaranteed; use prompts only for probabilistic guidance.

A.7 MCP artifacts

MCP tool: same shape as an API tool (name, description, inputSchema), exposed by an MCP server. On failure, an MCP tool returns a result with isError: true plus (best practice) structured metadata:

{
  "isError": true,
  "errorCategory": "transient",   // transient | validation | business | permission
  "isRetryable": true,
  "message": "Order service timed out after 10s."
}

MCP resource: content, not an action. Identified by a URI, with a name and MIME type; the agent can list and read resources to understand what data exists (issue catalogs, doc hierarchies, DB schemas) without exploratory tool calls (Domain 2, Task 2.4). Rule of thumb: tools = verbs (do something), resources = nouns (browse something).

.mcp.json (project scope: shared, version-controlled) with environment-variable expansion for secrets:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {"GITHUB_TOKEN": "${GITHUB_TOKEN}"}
    }
  }
}

Personal/experimental servers go in user scope (~/.claude.json). Tools from all connected servers are available simultaneously.

Appendix A · Part 3

Claude Code Config, Schemas & Batches

A.8 Claude Code configuration files

CLAUDE.md hierarchy (all three can coexist; more specific augments more general): - ~/.claude/CLAUDE.md: user scope (personal, not shared via version control) - .claude/CLAUDE.md or root CLAUDE.md: project scope (shared, committed) - <subdir>/CLAUDE.md: directory scope - @path/to/file.md inside a CLAUDE.md: import syntax to keep it modular - /memory: command to inspect which memory files are actually loaded

Slash commands: .claude/commands/<name>.md (project, shared) vs ~/.claude/commands/<name>.md (personal).

Skill: .claude/skills/<name>/SKILL.md with frontmatter:

---
name: analyze-codebase
description: Map module structure and dependencies for a target directory.
context: fork          # run in isolated sub-agent context; keeps verbose output out of main convo
allowed-tools: [Read, Grep, Glob]   # restrict tools during skill execution
argument-hint: "<directory path>"    # prompt user for args if invoked without them
---
Instructions the skill follows...

Path-scoped rule: .claude/rules/<name>.md with glob paths frontmatter (loads only when editing matching files, regardless of directory):

---
paths: ["**/*.test.tsx", "**/*.test.ts"]
---
# Testing conventions
Use React Testing Library. One assertion theme per test. ...

CLI flags for CI/CD (Domain 3, Task 3.6): - -p / --print: non-interactive mode (prints result and exits; prevents CI hangs) - --output-format json: machine-parseable output - --json-schema <schema>: constrain that JSON output to a schema - --resume <session-name>: continue a named session; fork_session (SDK): branch from a baseline - /compact: compress context mid-session; Explore subagent: isolate verbose discovery

A.9 JSON Schema patterns for structured output

Structured output via tool_use uses JSON Schema for the tool input_schema. Patterns the exam expects (Domain 4, Task 4.3):

{
  "type": "object",
  "properties": {
    "invoice_number": {"type": "string"},
    "due_date": {"type": ["string", "null"]},          // nullable: model returns null instead of fabricating
    "document_type": {"type": "string", "enum": ["invoice", "receipt", "other"]},
    "document_type_detail": {"type": ["string", "null"]}, // paired with "other"
    "confidence": {"type": "number"},
    "line_items": {"type": "array", "items": {"type": "object"}}
  },
  "required": ["invoice_number", "document_type"]
}
  • Nullable = "type": ["string", "null"] (or anyOf). Use for data that may genuinely be absent, so the model returns null rather than inventing a value.
  • Enum + "other" + detail keeps categories extensible; add "unclear" for genuine ambiguity.
  • required vs optional: mark a field required only if it must always be present; over-requiring drives fabrication.
  • Strict schemas eliminate syntax errors, not semantic ones: a schema-valid object can still have line items that don't sum to the total. That's what validation-retry loops and self-check fields (calculated_total vs stated_total, conflict_detected) are for (Domain 4, Task 4.4).
  • Pydantic is commonly used to validate the parsed object server-side; a validation failure feeds the retry-with-error-feedback loop.

A.10 Message Batches API shape

For latency-tolerant bulk work (Domain 4, Task 4.5): ~50% cheaper, up to 24h processing, no latency SLA, no multi-turn tool calling within a request, correlate by custom_id.

{
  "requests": [
    {"custom_id": "doc-001", "params": {"model": "...", "max_tokens": 1024, "messages": [ ... ]}},
    {"custom_id": "doc-002", "params": { ... }}
  ]
}

Each result comes back tagged with its custom_id and a status such as succeeded, errored, canceled, or expired. On partial failure, resubmit only the failed custom_ids (e.g., chunk a document that exceeded context, then resubmit just that one). Use it for overnight/weekly jobs; never for a blocking, human-waiting workflow (pre-merge checks).

Appendix B

Appendix B: Tradeoff Decision Tables

This exam is fundamentally about choosing correctly between close alternatives under a specific constraint. These tables compress the recurring decisions. For each, the exam almost always signals the answer through one keyword in the scenario (the "tell"). Learn the tells.

B.1 Prompt instruction vs. programmatic enforcement (hook/gate)

Use a prompt instructionUse programmatic enforcement (hook/prerequisite gate)
Guidance where occasional deviation is tolerableRule that must be guaranteed every time
Style, tone, soft preferencesMoney, identity, safety, irreversible actions, compliance
"usually," "prefer," "try to""must never," "always before," "under no circumstances"

Tell: if the scenario reports a failure rate ("in 9-12% of cases it skips X") on a consequential step, the answer is enforcement, not a reworded prompt or more few-shot examples. Probabilistic fixes for deterministic requirements are always distractors here.

B.2 Session resumption vs. fork vs. fresh start

SituationChoice
Continue the same line of work; prior context still valid--resume <session-name>
Explore two divergent approaches from one shared baselinefork_session
Prior tool results are largely stale/invalidStart fresh, inject a structured summary of what's still true
A few specific files changed since last sessionResume, but explicitly tell it which files changed → targeted re-analysis

Tell: "compare two approaches" → fork. "stale/changed a lot" → fresh + summary. "changed these specific files" → resume + targeted note.

B.3 Plan mode vs. direct execution

Plan modeDirect execution
Many files, architectural decisions, multiple valid approachesSingle, well-scoped change with one clear path
Migration touching 45+ files; monolith → microservicesOne-file bug fix with a clear stack trace; add one validation
Cost of rework is highCost of rework is low

Tell: the scenario states the complexity up front (dozens of files / multiple approaches / boundaries) → plan mode now, not "try direct first and switch later." "Only switch to plan mode if it gets hard" is a distractor when complexity is already known.

B.4 Synchronous API vs. Message Batches API

Synchronous (real-time)Batches
Blocking: a human/process waits on the resultNon-blocking, latency-tolerant
Pre-merge checks, live chat, checkout fraud checkOvernight reports, weekly audits, nightly test gen
Needs multi-turn tool callingSingle-shot; no mid-request tool loop

Tell: "developers wait / pre-merge / real-time" → sync. "overnight / next morning / weekly / save cost on bulk" → batch. Moving a blocking workflow to batch "for the 50% savings" is always wrong.

B.5 tool_choice: auto vs. any vs. forced

ConstraintSetting
Model should decide whether to use a toolauto
Must produce structured output but schema/type is uncertainany
A specific tool must run first (e.g., extract before enrich){"type": "tool", "name": "..."}

B.6 Skill vs. CLAUDE.md vs. .claude/rules/

NeedMechanism
Always-on universal standards for every interactionCLAUDE.md
On-demand, task-specific workflow invoked when neededSkill (.claude/skills/)
Conventions that auto-apply by file type/path, anywhere in the tree.claude/rules/ with glob paths

Tell: "regardless of directory / wherever these files live / automatically" → rules with globs. "run this workflow when I ask" → skill. "everyone should always follow" → CLAUDE.md. Note the distinction between .claude/rules/ for conditional convention loading and directory-level CLAUDE.md, which is directory-bound.

B.7 Fixing output quality: criteria vs. few-shot vs. schema

ProblemFirst-line fix
Vague judgment / high false positivesExplicit categorical criteria (not "be conservative")
Inconsistent format or ambiguous-case handling2-4 targeted few-shot examples showing reasoning
Malformed/invalid JSON structuretool_use + JSON schema
Fabricated values for absent dataNullable/optional fields
Values valid but semantically wrong (don't sum)Validation-retry loop + self-check fields

B.8 Escalate vs. resolve (customer support)

EscalateResolve autonomously
Customer explicitly asks for a human (immediately)Straightforward, in-policy request
Policy gap/silence on this specific caseClear policy coverage
No meaningful progress possibleProgress is achievable

Never escalate based on sentiment/frustration alone or self-reported confidence: acknowledge frustration and offer to resolve; escalate only if the customer reiterates. Multiple ambiguous identity matches → ask for another identifier, don't guess.

B.9 Retry vs. don't retry (extraction)

Retry will helpRetry won't help
Format mismatch (wrong date format)Information simply not in the source document
Wrong field placement / structural output errorRequires an external document not provided
Values fail semantic validation but data exists(use nullable field or fetch the data elsewhere)

B.10 Tool descriptions: improve vs. split vs. consolidate

SymptomFix
Two similar tools confused; both have thin descriptionsImprove/expand descriptions first (cheapest, highest-leverage)
One generic tool doing several jobs, wrong sub-behaviorSplit into purpose-specific tools with clear contracts
Near-identical names/descriptionsRename for clarity + rewrite to be mutually exclusive
Agent prefers a built-in tool over a better MCP toolEnhance the MCP tool's description (capabilities + outputs)
Appendix C

Appendix C: How to Read Exam Questions (Distractor Patterns & Elimination Strategy)

Most items give you four (or more) plausible-sounding options where more than one would "work": the exam wants the best answer given the constraint, usually the most proportionate, root-cause-addressing, and correctly-layered one. The wrong answers are not random; they recur in predictable shapes. If you can name the shape, you can eliminate it.

C.1 The recurring wrong-answer archetypes

  1. The over-engineered solution. Introduces heavy infrastructure (a trained classifier, an ML pipeline, a separate routing model, a new service) when a prompt/description/config change would fix the root cause. Tell: "train a model," "deploy a classifier," "build a routing layer." Usually wrong when a simpler first step hasn't been tried.

  2. The probabilistic fix for a deterministic need. Offers a prompt tweak, more few-shot examples, or a confidence threshold for a rule that must be guaranteed (money, identity, ordering). Tell: the scenario cites a failure rate on a consequential step. Beaten by a hook/prerequisite gate.

  3. Blame the downstream agent. In multi-agent scenarios, points at the synthesis/analysis/search agent when the logs show the coordinator's decomposition (or context passing) was the real cause. Tell: "each subagent completed successfully." The fault is upstream, in what they were assigned.

  4. The bigger hammer. "Switch to a larger context-window / higher-tier model." Rarely correct: attention dilution, self-review bias, and missing-information problems are not solved by more context or a bigger model.

  5. Silent suppression / false success. "Return an empty result marked successful," "catch the error and continue quietly." Always an anti-pattern: hides failures the coordinator needs to see.

  6. Nuke the workflow. "Terminate the entire pipeline on one subagent failure." Over-reacts; partial results + annotated gaps are usually preferable.

  7. The plausible-but-nonexistent feature. Invented flags/config: --headless, CLAUDE_HEADLESS=true, --batch, .claude/config.json commands array, scope: private. If you don't recognize it from Appendix A, be suspicious.

  8. Solves a different problem. Technically fine but addresses tool availability when the issue is tool ordering, or sentiment when the issue is complexity. Re-read what the scenario actually asked.

  9. Fabricate to satisfy structure. Making a field required and telling the model to "provide a best guess" when data may be absent: drives hallucination. Nullable is the fix.

  10. Consensus/averaging that hides truth. "Only flag issues appearing in 2 of 3 runs" (suppresses real intermittent bugs); "average the two conflicting statistics" (fabricates a number). Preserve and annotate instead.

C.2 A four-step elimination method

  1. Identify the constraint. What does the scenario optimize for: determinism? latency? cost? precision? coverage? attribution? That single constraint usually decides it.
  2. Find the root cause. Especially in multi-agent items: read the logs described. If "each subagent succeeded," suspect the coordinator.
  3. Match proportionality. Prefer the smallest change that addresses the root cause. "First step / most effective first" phrasing rewards the cheap high-leverage fix (often: improve descriptions, add explicit criteria) over architecture.
  4. Check the layer. Is this a guarantee need (→ hook/gate/enforcement) or a guidance need (→ prompt/few-shot)? Is recovery local (subagent) or escalated (coordinator)? Wrong-layer answers are the most common trap.

C.3 Answering multiple-response items

The item states how many to select. Treat each option as an independent true/false against the scenario; don't force a pattern. A common design: two clearly-correct best practices plus two that are real anti-patterns dressed in reasonable language (e.g., "self-reported confidence" and "sentiment threshold" as escalation triggers). Select exactly the number asked: partial-credit rules vary, so don't over- or under-select.

C.4 Time and flag strategy

60 items in 120 minutes = ~2 minutes each. Scenario stems are long; read the question sentence first, then mine the stem for the specific fact it hinges on (a failure rate, a log excerpt, a latency number, an SLA). Flag-and-return on anything past ~2.5 minutes: the scenario context you've already loaded makes later questions in the same scenario faster, so momentum matters more than perfection on any single item.

Appendix D

Appendix D: Glossary

TermMeaning
Agentic loopthe cycle of send request → inspect stop_reason → execute tools → append results → repeat until end_turn.
AgentDefinitionAgent SDK configuration for a subagent type: description, system prompt, tool restrictions, optional model.
allowedToolsthe set of tools an agent may use; must include "Task" for a coordinator to spawn subagents.
Attention dilutiondegraded, inconsistent analysis when too much (e.g., 14 files) is processed in one pass; fixed by splitting into focused passes.
Batch (Message Batches API)asynchronous bulk processing: ~50% cheaper, up to 24h, no latency SLA, no multi-turn tool calls, correlated by custom_id.
Case facts blocka persistent, structured block of hard facts (amounts, dates, IDs) included in every prompt, immune to conversation summarization.
CLAUDE.mdClaude Code memory/instruction file; hierarchy of user (~/.claude/), project (.claude/ or root), and directory scopes.
context: forkSKILL.md frontmatter that runs a skill in an isolated sub-agent context so verbose output stays out of the main conversation.
Coordinator (hub-and-spoke)the agent that decomposes tasks, selects and invokes subagents, routes all inter-agent communication, aggregates results, and owns error handling.
custom_ididentifier correlating a batch request to its response and enabling targeted resubmission of failures.
Direct executionmaking changes immediately without a planning phase; for simple, well-scoped, single-path tasks.
errorCategorystructured error classification: transient / validation / business / permission.
Explore subagentClaude Code subagent that isolates verbose discovery and returns a summary, preserving main-session context.
Few-shot examples2-4 targeted input/output (ideally with reasoning) examples; top lever for consistency, ambiguous-case handling, and reduced extraction hallucination.
fork_sessioncreate an independent session branch from a shared baseline to explore divergent approaches.
Glob patternfile-matching pattern (e.g., **/*.test.tsx) used in .claude/rules/ paths frontmatter and by the Glob tool.
Hook (PreToolUse / PostToolUse)deterministic code in the loop; PreToolUse intercepts/blocks/modifies a call before execution, PostToolUse transforms a result before the model sees it.
Hub-and-spokearchitecture where all subagent communication routes through the coordinator for observability and consistent handling.
isError / is_errorflag marking a tool result as a failure so the model can reason about recovery rather than treating it as success.
Iterative refinement loopcoordinator evaluates synthesis for gaps, re-delegates targeted queries, re-synthesizes until coverage is sufficient.
JSON Schemastructure definition for tool inputs/outputs; supports required/optional, enum, nullable (["string","null"]), strict mode.
Lost in the middlemodels process the start and end of long inputs more reliably than the middle; mitigate with key-findings-first ordering and section headers.
MCP (Model Context Protocol)standard for exposing tools (actions) and resources (browsable content) to Claude via servers.
MCP resourcecontent exposed by URI (catalogs, schemas, doc hierarchies) that reduces exploratory tool calls; contrast with tools (actions).
.mcp.jsonproject-scoped MCP server config (shared, version-controlled), supports ${VAR} env expansion; user scope is ~/.claude.json.
-p / --printClaude Code non-interactive mode flag for CI/CD.
Plan modeexplore and design before changing code; for large-scale, architectural, multi-approach tasks.
Progressive summarizationrepeatedly condensing history to save tokens; risks losing precise numbers/dates/expectations.
Prompt chainingfixed sequential decomposition into focused passes; for predictable multi-aspect work.
Scratchpad filea file where an agent persists key findings across context boundaries to counteract long-session degradation.
Stratified random samplingsampling high-confidence extractions across strata to measure true error rates and catch novel error patterns.
stop_reasonresponse field controlling the agentic loop: tool_use (continue), end_turn (done), max_tokens, stop_sequence.
Structured handoffa self-contained escalation summary (customer ID, root cause, recommended action) for a human who lacks the transcript.
Subagentan agent spawned via the Task tool with isolated context (no automatic inheritance); receives context explicitly in its prompt.
Task decompositionsplitting a job into subtasks; too-narrow decomposition is the classic multi-agent coverage failure.
tool_choicecontrols tool calling: auto, any, forced ({"type":"tool","name":...}), or none.
tool_use / tool_resultpaired content blocks (correlated by id / tool_use_id) representing a tool call and its returned result.
Appendix E

Appendix E: Exam-Readiness Self-Assessment

Score yourself honestly. If you can't do a line from memory (concept and why the alternatives are wrong), return to the referenced domain. Aim to clear every box before scheduling. Because the passing bar is a scaled 720/1000 and Domain 1 is 27% of the exam, prioritize any Domain 1 gaps.

Domain 1: Agentic Architecture & Orchestration (27%)

  • I can write the agentic loop and name what each stop_reason value does (A.2).
  • I can explain why parsing text or an iteration cap are wrong loop-termination signals.
  • I can explain hub-and-spoke, and why subagents don't inherit context.
  • I can spot "narrow decomposition" as the root cause when subagents "each succeeded."
  • I know Task must be in allowedTools, and that parallel = multiple Task calls in one turn.
  • I can choose prompt vs. hook vs. prerequisite gate for a given rule.
  • I can pick prompt chaining vs. dynamic decomposition, and resume vs. fork vs. fresh.

Domain 2: Tool Design & MCP Integration (18%)

  • I can write a strong tool description (purpose, input format, when-to-use, boundary).
  • I know improve-descriptions is the first fix for confusion between similar tools.
  • I can design a structured MCP error (isError, errorCategory, isRetryable) and classify error types.
  • I can explain why 18 tools hurts vs. 4-5, and how scoped cross-role tools help.
  • I can choose auto vs. any vs. forced tool_choice.
  • I know project (.mcp.json) vs. user (~/.claude.json) scope and env-var expansion.
  • I can distinguish MCP resources (content) from tools (actions).
  • I can pick Grep vs. Glob vs. Read/Write vs. Edit, and the Edit→Read+Write fallback.

Domain 3: Claude Code Configuration & Workflows (20%)

  • I can place config correctly across the CLAUDE.md hierarchy and diagnose the "new hire" bug.
  • I know .claude/commands/ vs ~/.claude/commands/ scope.
  • I know SKILL.md frontmatter (context: fork, allowed-tools, argument-hint).
  • I know when .claude/rules/ globs beat directory CLAUDE.md.
  • I can decide plan mode vs. direct execution from the stated complexity.
  • I know -p, --output-format json, --json-schema, and why independent review beats self-review.
  • I know the iterative-refinement techniques (examples, test-driven, interview, batch vs. sequence).

Domain 4: Prompt Engineering & Structured Output (20%)

  • I can replace vague criteria with explicit categorical criteria to cut false positives.
  • I know when few-shot examples are the right lever and how many to use.
  • I know tool_use+schema fixes syntax but not semantics.
  • I can design nullable fields and enum+"other" patterns; I know why over-requiring causes fabrication.
  • I know when retries help (format) vs. don't (missing info).
  • I can judge sync vs. batch and do the SLA/submission-frequency math.
  • I know why independent/multi-pass review beats self-review for large reviews.

Domain 5: Context Management & Reliability (15%)

  • I can preserve facts via a case-facts block and mitigate lost-in-the-middle.
  • I know the three real escalation triggers and the two unreliable ones (sentiment, self-confidence).
  • I can design structured error propagation and distinguish access failures from empty results.
  • I know scratchpads, subagent isolation, manifests, and /compact for long sessions.
  • I know aggregate accuracy hides segment failure; I know stratified sampling and calibrated confidence.
  • I can preserve claim-source mappings, annotate conflicts, and use dates to avoid false contradictions.

Cross-cutting

  • I can name the distractor archetypes (Appendix C) and eliminate on sight.
  • I can recognize every artifact in Appendix A on screen.
  • I've taken the 30-question practice exam timed and reviewed every miss.
  • I've built (even a toy version of) at least 2 of the 6 scenarios end-to-end.

When every box is checked and you're consistently reconstructing the why-not for wrong options without looking, you're ready to schedule. Good luck.