Q1 · Domain 1 · Agentic Architecture & Orchestration
A trip-planning assistant runs its own loop on the Messages API. The loop ends as soon as the latest response contains a text block. Users report the assistant saying "Let me check flights for you" and then going quiet. What is the bug, and what is the fix?
- A. The model needs a firmer instruction to finish its work before it replies, so add one to the system prompt.
- B. The loop needs a hard cap of 20 iterations so that it cannot stop before the work is done.
- C. Drive the loop from stop_reason: run the tools and continue on "tool_use", stop on "end_turn".
- D. Set tool_choice to "any" on every turn so that the model never answers in plain text at all.
Answer and explanation
Answer: C. stop_reason is the field the API sets to say why generation stopped. A text block can come before a tool_use block in the same response, so the text check exits while a tool call is still waiting. A cap is a safety net, not a completion signal. "any" on every turn would stop the assistant from ever giving a final answer. A prompt line is advice the model can still miss.
- A. A prompt line is advice the model can still miss, and the loop would still exit on the first text block.
- B. A cap is a safety net against a runaway loop. It is not a completion signal, and the loop would still exit on the first text block.
- C. Right. stop_reason is the field the API sets to say why generation stopped. A text block can come before a tool_use block in the same response, so the text check exits while a tool call is still waiting.
- D. Forcing a tool call on every turn means the assistant can never give its final answer in text.
Q2 · Domain 1 · Agentic Architecture & Orchestration
Your agent gets a response with stop_reason "max_tokens". The last content block is a tool_use block for create_invoice, and its input is cut off halfway through the line items. What should the loop do?
- A. Don't run it. Retry the request with a higher max_tokens so the whole tool call comes back.
- B. Run create_invoice with the line items that did arrive, then ask the model for the rest.
- C. Treat the turn as finished and show the user whatever text came before the tool call.
- D. Change tool_choice to "auto" and then resend exactly the same request a second time.
Answer and explanation
Answer: A. max_tokens means the output limit you set cut the response off. Anthropic's stop-reason docs say a truncated response with an incomplete tool_use block needs a retry with a higher max_tokens. Running a half-formed call writes a wrong invoice. Treating it as finished ignores pending work, and changing tool_choice does nothing about the limit that caused the cut.
- A. Right. max_tokens means the output limit you set cut the response off. Anthropic's stop-reason docs say an incomplete tool_use block needs a retry with a higher max_tokens.
- B. Running a half-formed call writes a wrong invoice. A truncated tool call should never run.
- C. The response stopped because of the limit, not because the work was done. Treating it as finished ignores the pending tool call.
- D. tool_choice does nothing about the output limit that caused the cut, so the same request gets cut off again.
Q3 · Domain 1 · Agentic Architecture & Orchestration
A coordinator agent sends a market-research subagent out first and a writing subagent second. The writer often quotes prices with no source, and some of them differ from what the researcher found. The two subagents never talk to each other. Where does the fix belong?
- A. Give the writer the same search tools as the researcher so it can look the prices up itself.
- B. Add a shared message queue so the writer can send the researcher questions while it drafts.
- C. Run both subagents inside one long-lived shared context so each can see what the other knows.
- D. Have the coordinator pass the researcher's findings on as claim, value, source and date.
Answer and explanation
Answer: D. A subagent only knows what the coordinator hands it. The writer is guessing because nothing was handed over. Extra search tools repeat work that is already done, a message queue adds a component and breaks the isolation the pattern relies on, and one shared context swaps a handoff problem for a context-size problem.
- A. The researcher already found the prices. Extra search tools repeat work that is already done.
- B. A message queue adds a new component and breaks the isolation the coordinator pattern relies on.
- C. One shared context swaps a handoff problem for a context-size problem.
- D. Right. A subagent only knows what the coordinator hands it. The writer is guessing because nothing was handed over, so pass each finding with its source and date.
Q4 · Domain 1 · Agentic Architecture & Orchestration
A returns agent must confirm the customer's identity with verify_customer before it may call issue_refund. Logs show it occasionally refunds first. Which two changes make that order impossible to skip? (Select 2)
- A. Put "ALWAYS verify the customer first" at the very top of the system prompt, in capitals.
- B. In the issue_refund handler, refuse unless the session holds a verified customer ID, and return an error saying why.
- C. Add four few-shot examples to the prompt in which verification always comes first.
- D. Register a PreToolUse hook in the Agent SDK that denies issue_refund when no verified ID is recorded.
- E. Move verify_customer to the first position in the tools array.
Answer and explanation
Answer: B and D. The handler check and the PreToolUse hook both act outside the model's choice, so the refund cannot run without a verified ID. Capitals, examples and tool order all change what the model is likely to do, and "likely" is how it already behaves. The handler check also protects you if the tool is ever called from somewhere else.
- A. Capitals change how likely the model is to verify first. It already verifies most of the time, and "most of the time" is the failure.
- B. Right. The handler refuses outside the model's choice, so the refund cannot run without a verified ID. It also protects you if the tool is ever called from somewhere else.
- C. Examples make the right order more likely. They don't make the wrong order impossible.
- D. Right. A PreToolUse hook runs before the call and can deny it, so the refund cannot run without a verified ID.
- E. The order of the tools array is not a rule about call order. Like the prompt options, it only changes what the model is likely to do.
Q5 · Domain 2 · Tool Design & MCP Integration
An intake service has three tools: extract_invoice, extract_receipt and extract_contract. You don't know which kind of document will arrive, but every response must be one of those tool calls, never prose. Your model supports forced tool use. Which tool_choice fits?
- A. {"type": "auto"}
- B. {"type": "any"}
- C. {"type": "tool", "name": "extract_invoice"}
- D. {"type": "none"}
Answer and explanation
Answer: B. "any" means the model must call one of the tools and picks which. "auto" lets it answer in text. "tool" forces one named tool, which is wrong for two of the three document types. "none" turns tools off. Check model support before relying on forcing: Anthropic's docs list newer models where "any" and "tool" return a 400, and point to "auto" with strict tool use or structured outputs instead.
- A. auto lets the model answer in plain text, which the scenario rules out.
- B. Right. any means the model must call one of the tools and picks which. Check model support before relying on it: the docs list newer models where any and tool return a 400.
- C. tool forces one named tool, which is wrong for two of the three document types.
- D. none turns tools off, so every response would be prose.
Q6 · Domain 2 · Tool Design & MCP Integration
A get_shipments MCP tool returns an empty list both when a customer has no shipments and when the carrier API times out. During an outage the agent tells customers they have nothing on the way. What should change?
- A. Add a prompt line: "If the shipment list comes back empty, tell the customer to try again later."
- B. Retry inside the tool up to five times, and return an empty list if the call still fails.
- C. On failure, return isError: true, a category, a retryable flag and a message. [] means none.
- D. Remove the tool entirely and have the agent ask each customer for their tracking numbers instead.
Answer and explanation
Answer: C. The agent can't tell "nothing found" from "couldn't look" because the tool gives the same answer for both. A structured error lets it say the right thing and decide whether to retry. The prompt line wrongly treats every real empty result as an outage, silent retries still hide the failure, and removing the tool throws away a working lookup.
- A. This treats every real empty result as an outage, so customers who have nothing on the way get told to try again.
- B. After the retries it still returns an empty list, so the failure is still hidden.
- C. Right. The agent can't tell "nothing found" from "couldn't look" while both come back as []. A structured error lets it say the right thing and decide whether to retry.
- D. Removing the tool throws away a lookup that works whenever the carrier API is up.
Q7 · Domain 2 · Tool Design & MCP Integration
In a large repo you need two lists: every file that calls chargeCard(, and every .json file inside any fixtures/ folder. Which pairing of Claude Code's built-in tools matches the two jobs?
- A. Grep for chargeCard( since it's file content; Glob for **/fixtures/**/*.json since it's a path.
- B. Glob for *chargeCard* to find the callers, and Glob for **/fixtures/**/*.json to find the data files.
- C. Grep for chargeCard( to find the callers, and Grep for the word fixtures to find the data files.
- D. Read every source file one at a time and note down the matches for both of the lists by hand.
Answer and explanation
Answer: A. Grep searches inside files; Glob matches file names and paths. Globbing for the function name only finds files whose names contain it. Grepping for "fixtures" finds files that mention the word, not files that live in that folder. Reading everything burns context. On macOS and Linux, current Claude Code may run these searches as find and grep through Bash, but the content-versus-path split is the same.
- A. Right. Grep searches inside files and Glob matches file names and paths, so each job goes to the tool built for it.
- B. Globbing for the function name only finds files whose names contain it, not files that call it.
- C. Grepping for "fixtures" finds files that mention the word, not files that live in that folder.
- D. Reading every file by hand burns context on work the search tools do directly.
Q8 · Domain 2 · Tool Design & MCP Integration
Your team wants an MCP server for its issue tracker to be available to everyone who clones the repo. The server needs an API token. What is the right setup?
- A. Each developer adds the server to their own ~/.claude.json and pastes the token into it.
- B. Commit .mcp.json with the token written inline, since the repository is private anyway.
- C. Describe the server and where the token lives in CLAUDE.md so Claude can set it up.
- D. Commit .mcp.json with the token as ${TRACKER_TOKEN}; each developer sets it locally.
Answer and explanation
Answer: D. Project scope, a .mcp.json at the repo root, is how a server is shared through git, and Claude Code expands ${VAR} references in it. A per-user config isn't shared. An inline token is a committed secret whatever the repo's visibility. A note in CLAUDE.md is advice, not configuration.
- A. A per-user config isn't shared through git, so every developer sets the server up alone.
- B. An inline token is a committed secret, whatever the repo's visibility.
- C. A note in CLAUDE.md is advice, not configuration. Nothing gets set up.
- D. Right. A .mcp.json at the repo root is project scope and is shared through git. Claude Code expands ${VAR} references in it, so the token stays on each developer's machine.
Q9 · Domain 3 · Claude Code Configuration & Workflows
SQL migration conventions should apply to db/migrations/**/*.sql and services/*/migrations/*.sql and nowhere else. The root CLAUDE.md is already long. What keeps these conventions out of unrelated sessions?
- A. Move the conventions into migrations.md and pull it into CLAUDE.md with an @migrations.md import.
- B. Create .claude/rules/migrations.md with a paths: list in its frontmatter holding both globs.
- C. Put a copy of the conventions in a CLAUDE.md file inside every migrations folder in the repo.
- D. Move the conventions out of the project and into your personal ~/.claude/CLAUDE.md file.
Answer and explanation
Answer: B. A rule with paths: frontmatter loads when Claude reads, writes or edits a matching file. Imported files load together with the CLAUDE.md that imports them, so an import tidies the file but saves no context. Per-folder copies duplicate the rule and drift. The personal file loads in every project and isn't shared with the team.
- A. An imported file loads together with the CLAUDE.md that imports it. The file gets tidier but no context is saved.
- B. Right. A rule with paths: frontmatter loads when Claude reads, writes or edits a matching file, and both globs fit in one list.
- C. Per-folder copies duplicate the rule, and copies drift apart.
- D. The personal file loads in every project and isn't shared with the team.
Q10 · Domain 3 · Claude Code Configuration & Workflows
Claude Code must never run git push --force against main in your repository. Which mechanism guarantees that?
- A. A line in the project CLAUDE.md stating that force pushes to main are forbidden.
- B. A PostToolUse hook on Bash that detects a force push and then reverts it.
- C. A PreToolUse hook on Bash that denies any command matching a force push to main.
- D. An instruction asking Claude to check with you before it runs any git command.
Answer and explanation
Answer: C. A PreToolUse hook runs before the tool call and can deny it. PostToolUse runs after the command has already happened, and a force-pushed history can't be reliably taken back. The CLAUDE.md line and the check-with-me instruction both depend on the model remembering.
- A. A CLAUDE.md line depends on the model remembering it, so it can't guarantee anything.
- B. PostToolUse runs after the command has already happened, and a force-pushed history can't be reliably taken back.
- C. Right. A PreToolUse hook runs before the tool call and can deny it, so the push never runs.
- D. An instruction to check with you still depends on the model remembering it.
Q11 · Domain 3 · Claude Code Configuration & Workflows
Your team's /release-notes skill has context: fork in its frontmatter. A developer complains that it ignores decisions they made earlier in the same conversation. Why?
- A. The forked skill runs as a subagent without your conversation history, so its prompt must stand alone.
- B. context: fork makes a git fork of the repository, so the skill is working from an older copy of the code.
- C. Skills can never read the conversation, whether they are forked or not, so this is expected behaviour.
- D. The skill has to live in ~/.claude/skills/ rather than .claude/skills/ before it can read the conversation.
Answer and explanation
Answer: A. context: fork starts a subagent and gives it the skill's content as its prompt. It doesn't get your conversation history; only its result comes back. Claude Code's docs say to fork the conversation instead when the task depends on that history. The git reading is the familiar-word trap. Skills without fork run inline, and the folder a skill lives in has nothing to do with it.
- A. Right. context: fork starts a subagent and gives it the skill's content as its prompt. It doesn't get your conversation history; only its result comes back.
- B. This is the familiar-word trap. context: fork has nothing to do with git.
- C. Skills without fork run inline in your conversation. Only the forked one runs without it.
- D. The folder a skill lives in has nothing to do with whether it sees the conversation.
Q12 · Domain 3 · Claude Code Configuration & Workflows
You want Claude Code to review each pull request in CI and emit findings that a script then parses. Nobody is at a keyboard. Which invocation fits?
- A. Start claude in a detached terminal session and have the CI job send it keystrokes.
- B. Run claude --ci --review-only so it skips prompts and prints only review findings.
- C. Set the CLAUDE_HEADLESS=true environment variable, then run claude as you normally would.
- D. Run claude -p "<review prompt>" --output-format json, plus --json-schema for a fixed shape.
Answer and explanation
Answer: D. -p (--print) runs without the interactive interface, --output-format json gives output a script can parse, and --json-schema validates the result against your schema. The flags in B and the variable in C don't appear in the Claude Code CLI reference. On this exam, a flag you have never seen in the docs is usually invented.
- A. -p already runs Claude Code without the interactive interface, so there is no need to drive a terminal with keystrokes.
- B. --ci and --review-only don't appear in the Claude Code CLI reference. A flag you have never seen in the docs is usually invented.
- C. That variable doesn't appear in the Claude Code CLI reference, and running claude as normal opens the interactive interface.
- D. Right. -p (--print) runs without the interactive interface, --output-format json gives output a script can parse, and --json-schema validates the result against your schema.
Q13 · Domain 4 · Prompt Engineering & Structured Output
You extract the delivery date from scanned delivery notes. The instruction "Return the delivery date as YYYY-MM-DD" works on clean notes and fails on unusual layouts, where the date sits in a stamp or a handwritten box. What do you try next?
- A. Fine-tune a model on a few thousand labelled delivery notes before going any further.
- B. Ask for step-by-step written reasoning on every single note before it gives its final answer.
- C. Add a few examples of awkward layouts with the correct output, including one with no date (null).
- D. Raise max_tokens so that the model has more room to search each note carefully.
Answer and explanation
Answer: C. The desired behaviour is easier to show than to describe, which is what few-shot examples are for, and including a no-date case stops the model inventing one. Fine-tuning is a last resort. Step-by-step reasoning helps when the reasoning path matters; spotting a date in a stamp is recognition. max_tokens caps output length and has nothing to do with this.
- A. Fine-tuning is a last resort. Showing the model a few examples comes first.
- B. Step-by-step reasoning helps when the reasoning path matters. Spotting a date in a stamp is recognition.
- C. Right. The behaviour is easier to show than to describe, which is what few-shot examples are for. The no-date example stops the model inventing a date.
- D. max_tokens caps output length. It has nothing to do with where the date sits on the page.
Q14 · Domain 4 · Prompt Engineering & Structured Output
Timesheet extraction returns daily_hours (a list of numbers) and week_total. Every output passes schema validation, yet some week_total values don't equal the sum of daily_hours. What is the fix?
- A. Add minimum and maximum bounds to week_total in the schema so that out-of-range totals get rejected.
- B. Add a model-level check that sum(daily_hours) equals week_total, and retry with that exact error.
- C. Set the temperature to zero so that the arithmetic comes out identical on every single run.
- D. Append the sentence "Always double-check your totals before answering" to the prompt.
Answer and explanation
Answer: B. Schema validation checks each field's type on its own. A rule that relates two fields needs a model-level validator (in Pydantic, a model_validator). Feeding the failed output and the specific error into the retry gives the model something to correct. Bounds check one field in isolation, temperature zero can be consistently wrong, and a reminder in the prompt is advice.
- A. Bounds check one field on its own. A total can be in range and still not match the days.
- B. Right. Schema validation checks each field on its own. A rule that relates two fields needs a model-level validator, and sending the specific error with the retry gives the model something to correct.
- C. Temperature zero makes the output consistent, not correct. It can be consistently wrong.
- D. A reminder in the prompt is advice. Nothing checks that it worked.
Q15 · Domain 4 · Prompt Engineering & Structured Output
Your extraction schema marks purchase_order_number as a required string. Many documents don't have one, and reviewers keep finding plausible PO numbers that appear nowhere in the source. What change fixes this at the cause?
- A. Add a regex pattern to the field so only well-formed PO numbers pass validation.
- B. Tell the model in the system prompt that it must never make anything up.
- C. Retry the extraction until the model returns a number matching the pattern.
- D. Make the field nullable and say "return null if the document doesn't state it".
Answer and explanation
Answer: D. A required field with no way to say "not present" pushes the model to fill it. A regex lets a well-formed invented number straight through, the prompt line is advice, and retrying until it matches rewards the invention. When the information really isn't in the source, don't retry at all: return null and route to review if it matters.
- A. A regex lets a well-formed invented number straight through.
- B. The prompt line is advice, and the required field still pushes the model to fill it.
- C. Retrying until it matches rewards the invention. When the information isn't in the source, don't retry at all.
- D. Right. A required field with no way to say "not present" pushes the model to fill it. With null allowed, a missing PO number comes back as null, and you can route that to review if it matters.
Q16 · Domain 4 · Prompt Engineering & Structured Output
Each night you classify about 40,000 support transcripts for a dashboard people read in the morning. During the day a chat widget classifies each message while the user waits. How should the Message Batches API be used?
- A. Batch the nightly job, poll until processing_status is "ended", then read results. Keep the widget live.
- B. Send both workloads through the Batches API, because batching halves the cost of every request you make.
- C. Put the widget traffic and the nightly job into the same batch so that both of them share one queue.
- D. Batch the nightly job and read all of its results straight after the create call returns a response.
Answer and explanation
Answer: A. Batches cost 50% of standard prices and most finish within an hour, but processing can take up to 24 hours with no latency guarantee. That suits work nobody is waiting on and fails a live user. The create call returns at once with processing_status "in_progress"; results are ready when it reads "ended", and custom_id ties each result to its request.
- A. Right. Batches suit work nobody is waiting on. Poll until processing_status reads "ended", read the results, and match them to requests by custom_id. The widget stays on the normal API.
- B. Batches have no latency guarantee and can take up to 24 hours, which fails a user waiting in the chat widget.
- C. Widget traffic in a batch waits as long as the batch does. A live user needs the answer now.
- D. The create call returns at once with processing_status "in_progress". Results are ready only when it reads "ended".
Q17 · Domain 5 · Context Management & Reliability
A billing support agent can hand a conversation to a human. Which two are sound triggers for that handoff? (Select 2)
- A. The customer explicitly asks to speak to a person.
- B. A sentiment score on the customer's last message drops below a set threshold.
- C. The request falls outside documented policy, or the agent hasn't resolved it within its allowed attempts.
- D. The model rates its own confidence in its answer below 70%.
- E. The customer's message runs longer than 150 words.
Answer and explanation
Answer: A and C. Escalate on conditions you can state and check: the customer asked, the case isn't covered, or the agent is stuck. The public exam guide calls sentiment and self-reported confidence unreliable proxies for how complex a case is. Message length tells you nothing about whether a human is needed.
- A. Right. An explicit request for a person is a condition you can state and check.
- B. The public exam guide calls sentiment an unreliable proxy for how complex a case is.
- C. Right. Outside documented policy, or stuck after the allowed attempts, are both conditions you can state and check.
- D. Self-reported confidence is the other proxy the exam guide calls unreliable.
- E. Message length tells you nothing about whether a human is needed.
Q18 · Domain 5 · Context Management & Reliability
Two sources disagree on when a supplier was founded. A company-registry record dated 2024 says 2011; a 2019 news article says 2009. Your research agent is writing the supplier profile. What should it do?
- A. Use 2010, the midpoint of the two, and mark the year as approximate in the profile.
- B. Report both years with their source and date, and flag the conflict for the reader.
- C. Keep the registry's year and drop the news article from the profile without comment.
- D. Leave the founding year out of the profile entirely, since the sources can't agree.
Answer and explanation
Answer: B. Keep each claim tied to its source and date, and show conflicts. Averaging invents a year neither source states. Dropping one silently hides evidence the reader may need. Leaving the field out loses both. Saying the registry is probably more reliable is fine, as long as both values stay visible.
- A. Averaging invents a year neither source states.
- B. Right. Each claim stays tied to its source and date, and the reader sees the conflict. Saying the registry is probably more reliable is fine, as long as both values stay visible.
- C. Dropping one source silently hides evidence the reader may need.
- D. Leaving the field out loses both pieces of evidence.
Q19 · Domain 5 · Context Management & Reliability
Three hours into a Claude Code debugging session you run /compact. Afterwards Claude has lost the exact error codes and the config values you agreed on, and its advice turns generic. What prevents this next time?
- A. Switch to a model with a larger context window so that compaction happens less often.
- B. Never compact at all, and start a brand-new session whenever the context fills up.
- C. Tell Claude at the start of the session to remember every number exactly as given.
- D. Keep exact values in a scratchpad file as you go, and tell /compact what must survive.
Answer and explanation
Answer: D. Compaction replaces the history with a summary, and summaries drop exact detail. A file survives compaction, and /compact accepts instructions about what to preserve. A bigger window only delays the same loss, a fresh session throws everything away, and an instruction to remember is advice.
- A. A bigger window only delays the same loss. Compaction still replaces the history with a summary.
- B. A fresh session throws everything away, including what you wanted to keep.
- C. An instruction to remember is advice, and the summary can still drop the numbers.
- D. Right. A file survives compaction, and /compact accepts instructions about what to preserve.
Q20 · Domain 5 · Context Management & Reliability
An invoice-extraction pipeline scores 96% accuracy overall. The team wants to stop human review of high-confidence outputs. What should happen first?
- A. Wait until the 96% figure has held steady for a full quarter, then switch review off.
- B. Hire enough extra reviewers that every single output can still be checked by hand before it ships.
- C. Check accuracy by document type and field, calibrate on labelled data, keep sampling after launch.
- D. Lower the confidence threshold so that a larger share of the outputs qualify as high-confidence.
Answer and explanation
Answer: C. An overall figure can look fine while one document type or field fails badly, because the large good segments dilute the small bad one. Check by segment, make sure the confidence score means something against labelled data, and keep a random sample under review after launch to catch new failure patterns. A stable aggregate is still an aggregate, more reviewers means no automation, and a lower threshold widens the risk.
- A. A stable aggregate is still an aggregate. One weak document type can hide inside it the whole time.
- B. Checking every output by hand means no automation at all.
- C. Right. An overall figure can look fine while one document type or field fails badly. Check by segment, make sure the confidence score means something against labelled data, and keep sampling after launch.
- D. A lower threshold sends more outputs past review and widens the risk.