FIRST 20 QUESTIONSAnswers & available explanations
QUESTION 1
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
Your code review assistant needs to analyze pull requests and provide feedback on three aspects: code style compliance, potential security issues, and documentation completeness. Each aspect requires reading files, running analysis tools, and generating a report section. The review process follows the same three-step workflow for every PR.
Which task decomposition pattern is most appropriate for this workflow?
- AA. Orchestrator-workers – have a central LLM analyze each PR to dynamically determine which checks are needed, then delegate to specialized worker LLMs for each identified subtask.
- BB. Prompt chaining – break the review into sequential steps where each aspect (style, security, documentation) is analyzed separately, with outputs combined in a final synthesis step.
- CC. Single comprehensive prompt – include all instructions in one prompt and let the model handle all three aspects simultaneously.
- DD. Routing – classify each PR by type (feature, bugfix, refactor) first, then route to different review prompts optimized for that category.
Show answer & explanation +
Correct answer: B
ExplanationThis PR review has a fixed, repeatable three-step workflow (style, security, docs) where each step reads files/runs tools and then contributes to a final report. Prompt chaining fits best: run each analysis step sequentially with clear intermediate outputs, then synthesize into one response. Orchestrator-workers is better when subtasks are dynamically discovered, and routing is for choosing among different pipelines rather than executing a known sequence.
QUESTION 2
You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JavaScript Object Notation (JSON) schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems.
Your extraction system processes two document types: standard monthly reports (archived after processing) and urgent exception reports (must trigger business alerts within 30 minutes of receipt). Both use the same JSON schema. You want to minimize API costs while meeting latency requirements.
How should you architect the processing pipeline?
- AA. Submit all documents to the real-time Messages API to ensure consistent processing latency across document types.
- BB. Submit all documents to the Batch API with custom _ids for tracking. When results arrive, immediately process urgent documents and trigger delayed alerts for exceptions.
- CC. Route standard reports to the Batch API for 50% cost savings, and route urgent exception reports to the real-time Messages API.
- DD. Queue all documents and submit hourly batches, flagging urgent documents for expedited handling when batch results return.
Show answer & explanation +
Correct answer: C
ExplanationUse the Batch API for non-urgent monthly reports to capture the typical ~50% cost savings, and use the real-time Messages API for urgent exception reports to meet the 30-minute alert SLA. Both can share the same JSON schema validation downstream, but latency-sensitive work should not depend on batch completion timing. Sending everything via Messages increases cost, while sending urgent items via Batch risks missing the SLA.
QUESTION 3
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
In production, you observe that simple fact-checking queries (e.g., “What year was the Paris Climate Agreement signed?”) traverse all four subagents sequentially, consuming 40+ seconds and significant tokens per query. Complex comparative research benefits from the full pipeline. Your query distribution is diverse and evolving as users discover new applications.
What’s the most effective approach to optimize for varying query complexity?
- AA. Have the coordinator analyze each query and dynamically decide which subagents to invoke based on its assessment of query requirements.
- BB. Implement pattern-based routing that categorizes queries by structure (single-fact vs. comparative vs. analytical) and maps each category to a predefined subagent combination. Most Voted
- CC. Create a fast-path for factual questions that bypasses subagents entirely, routing all other queries through the complete pipeline to ensure research thoroughness.
- DD. Train a query complexity classifier on labeled historical data to predict optimal subagent combinations, retraining periodically as query patterns evolve.
Show answer & explanation +
Correct answer: B
ExplanationRouting is the most effective way to optimize heterogeneous, evolving query mixes: classify queries (e.g., single-fact vs comparative/analytical) and map each class to an appropriate subagent path, avoiding unnecessary steps for simple requests. This aligns with the routing pattern’s goal of selecting the right workflow rather than always running the full chain. A purely dynamic coordinator decision (A) is less predictable and harder to control/monitor, and a hardcoded fast-path (C) is brittle as query types evolve.
QUESTION 4
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
Production monitoring shows the research phase takes longer than expected. Analysis reveals the coordinator invokes the web search subagent, waits for its response, then invokes the document analysis subagent and waits again. These tasks are independent – neither requires the other’s output.
How should you modify the system to run these subagents concurrently?
- AA. Add detailed instructions to the coordinator’s system prompt explaining the performance benefits of parallel execution and requesting it invoke both subagents at the same time.
- BB. Switch both subagents to use a Haiku-tier model instead of Sonnet to reduce their individual execution time.
- CC. Structure the coordinator to emit both Task tool calls (for web search and document analysis) in a single response message rather than across separate conversation turns.
- DD. Create an async orchestration layer outside the agent that spawns parallel threads, each running a separate coordinator-subagent pair, then aggregates results.
Show answer & explanation +
Correct answer: C
ExplanationTo achieve true concurrency in the Agent SDK/tool-use flow, the coordinator should emit both Task tool calls in the same model response so the runtime can execute them in parallel and then return results for aggregation. Merely instructing the model to “be parallel” (A) doesn’t change the turn-based execution pattern, and switching models (B) reduces latency per call but not the sequential dependency. Spawning separate coordinator-subagent pairs (D) adds unnecessary orchestration complexity versus parallelizing the independent tasks directly.
QUESTION 5
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
A user is expanding the research system beyond its single web search agent by adding specialized data sources. They add a financial API agent that returns structured JSON with revenue, margins, and growth rates; a news monitoring agent that returns prose summaries of recent developments; and a patent analysis agent that returns structured lists of technology areas. The synthesis agent combines these into executive briefings. Currently, it converts everything to bullet points, causing financial comparisons to lose tabular clarity and news summaries to lose narrative flow.
What change would most improve briefing quality?
- AA. Update the synthesis agent to render each content type appropriately – financial data as tables, news as prose
- BB. Add a format conversion layer between subagents and synthesis that transforms all outputs to a common intermediate representation
- CC. Standardize all subagent outputs to JSON with fields for ‘claim’, ‘evidence’, ‘source’, and ‘confidence’
- DD. Standardize all subagent outputs to prose summaries with inline citations
Show answer & explanation +
Correct answer: A
ExplanationBriefing quality improves most by preserving modality: render structured financial metrics as tables, keep news as narrative prose, and present patents as structured lists—then synthesize at the appropriate level. Forcing everything into a single intermediate format (B–D) often degrades information (e.g., tabular comparisons) and increases transformation overhead. In multi-agent systems, letting each subagent keep its strongest representation and having the synthesizer format-aware typically yields the clearest executive output.
QUESTION 6
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
The coordinator agent has AgentDefinitions configured for all four specialized subagents, each with appropriate descriptions, prompts, and tool restrictions. During testing, you notice the coordinator correctly reasons about when to delegate – it generates messages like “I’ll ask the web search agent to find sources on this topic” – but no subagent execution ever occurs. The coordinator then proceeds as if the delegation happened and continues with incomplete information. Logs show no errors.
What is the most likely cause?
- AA. The AgentDefinitions are configured correctly, but the coordinator’s system prompt doesn’t explicitly list the available subagent types, preventing the model from knowing they can be invoked.
- BB. Subagent context isolation means task descriptions from the coordinator don’t automatically reach subagents; you need to configure explicit context forwarding in ClaudeAgentOptions.
- CC. The coordinator’s allowedTools configuration doesn’t include “Task”, so while it can reason about delegation, it cannot invoke the tool required to spawn subagents.
- DD. The coordinator’s max_tokens setting is too low, causing the Task tool invocation to be truncated before the subagent type parameter can be specified.
Show answer & explanation +
Correct answer: C
ExplanationIn the Claude Agent SDK, spawning subagents is done via the Task tool; if the coordinator’s allowedTools/tool policy does not include Task, the model may still “talk about” delegating but cannot actually invoke the tool, so no subagent runs and no errors may surface beyond missing tool calls. AgentDefinitions alone don’t enable execution without the Task tool being permitted. Low max_tokens would more likely truncate outputs, and context forwarding is not the blocker for the tool invocation itself.
QUESTION 7
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
When analyzing complex legal cases that cite multiple precedents, the document analysis subagent processes each sequentially. A landmark case citing 12 precedents takes over 3 minutes to analyze completely.
What’s the most effective way to reduce this latency while preserving the coordinator’s ability to monitor and debug the system?
- AA. Create a recursive agent hierarchy where analysis agents subdivide work among child agents until reaching single-precedent granularity
- BB. Enable the document analysis subagent to spawn its own specialized subagents dynamically when it encounters cases with many citations
- CC. Have the coordinator spawn parallel document analysis subagents, each handling a subset of precedents, then aggregate results before synthesis
- DD. Implement a message queue where precedent analysis tasks are processed asynchronously by a pool of worker agents
Show answer & explanation +
Correct answer: C
ExplanationThe fastest way to cut latency is to parallelize precedent analysis: have the coordinator spawn multiple document-analysis tasks concurrently (each with a subset of precedents) and then aggregate before synthesis. This preserves centralized observability/debuggability because the coordinator remains the orchestrator and can log/trace each subtask. Recursive hierarchies or letting subagents spawn subagents can work but typically reduces control and complicates monitoring; a queue adds throughput but not necessarily lower end-to-end latency for a single request.
QUESTION 8
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
Production monitoring shows that follow-up queries like “summarize what we learned about market trends” consistently take 40+ seconds. Investigation reveals the coordinator spawns the synthesis subagent for each summarization request, passing 80K+ tokens of accumulated findings. The coordinator already has these findings in its context from orchestrating the research.
What’s the most effective way to improve response time for these follow-up summaries?
- AA. Enable prompt caching on the synthesis subagent to reduce the overhead of repeatedly transferring the same research findings.
- BB. Have the coordinator handle straightforward summarization requests directly using its existing context, reserving subagent spawning for complex analysis.
- CC. Spawn the synthesis subagent with reduced context and have it request specific findings from the coordinator on-demand.
- DD. Pre-generate and cache summaries at multiple granularities whenever new findings accumulate.
Show answer & explanation +
Correct answer: B
ExplanationIf the coordinator already holds the findings in its own context, the most effective improvement is to avoid spawning a synthesis subagent for simple summaries and answer directly, eliminating the extra model call and the cost of re-sending 80K+ tokens. Prompt caching helps when the same prefix is repeatedly sent to the model, but it still requires a separate subagent invocation and large-context handling. On-demand retrieval or pre-generated caches can help in some designs, but the simplest and highest-impact fix here is routing straightforward summarization to the coordinator.
QUESTION 9
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
The synthesis agent completes its initial pass but flags that three key research questions remain unanswered because the web search and document analysis agents didn’t find relevant information on those specific subtopics. The coordinator currently proceeds directly to report generation, producing reports with incomplete coverage.
What change would most effectively improve research completeness?
- AA. Give the synthesis agent direct access to web search tools so it can autonomously fill knowledge gaps without returning control to the coordinator.
- BB. Increase the initial breadth of queries sent to web search and document analysis to reduce the probability of missing relevant information.
- CC. Have the report generation agent note which research questions couldn’t be answered, so users understand the limitations of the final output.
- DD. Have the coordinator evaluate synthesis output for gaps, then re-delegate to web search and document analysis with targeted queries before invoking synthesis again.
Show answer & explanation +
Correct answer: D
ExplanationUse an iterative orchestrator-workers loop: the coordinator should inspect synthesis output for unanswered questions, then re-delegate targeted follow-up searches/analysis and run synthesis again before report generation. This is a standard multi-agent “chaining” pattern that improves completeness while keeping tool access and responsibilities separated. Giving synthesis direct web tools blurs roles and can increase risk/complexity; broader initial searches are inefficient; merely noting gaps doesn’t improve coverage.
QUESTION 10
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
The coordinator provides detailed step-by-step instructions to the web search subagent, specifying exact search queries, source priorities, and date filters. Production monitoring reveals three issues: (1) the subagent reports “insufficient results” rather than trying alternative approaches when pre-specified searches fail, (2) research quality drops for emerging topics that don’t match expected patterns, and (3) the subagent rarely surfaces valuable tangential sources.
What’s the most effective way to improve subagent adaptability?
- AA. Remove procedural details entirely, delegating with simple goals like “research X thoroughly” and relying on the subagent’s general capabilities.
- BB. Add explicit fallback directives to the detailed instructions: “If specified searches yield fewer than N results, attempt alternative query formulations before reporting failure.”
- CC. Specify research goals and quality criteria (coverage breadth, source diversity, recency) rather than procedural steps, letting the subagent determine its search strategy.
- DD. Implement a topic classification step where the coordinator categorizes requests as “well-defined” or “exploratory” and uses different instruction styles for each category.
Show answer & explanation +
Correct answer: C
ExplanationTo improve adaptability, delegate with outcome-based goals and quality criteria (e.g., breadth, diversity, recency) rather than rigid step-by-step procedures, allowing the subagent to choose and adjust its strategy when initial queries fail or topics are novel. This aligns with agent prompt best practices: specify constraints and success metrics, not brittle procedures. Adding fallbacks helps but still anchors behavior to a narrow plan; removing all guidance is too vague; topic classification can help but is secondary to better goal/criteria framing.
QUESTION 11
You are integrating Claude Code into your Continuous Integration/Continuous Deployment (CI/CD) pipeline. The system runs automated code reviews, generates test cases, and provides feedback on pull requests. You need to design prompts that provide actionable feedback and minimize false positives.
Your pipeline reviews every PR using a single API call with a static prompt containing the diff and full text of each changed file – unchanged files are not included. Reviews are posted asynchronously and don’t block PR creation. Developers report that reviews consistently miss bugs involving cross-file interactions – for example, a PR renames a function’s parameters but the review doesn’t flag callers in unchanged files that still use the old argument order. Evaluation shows cross-file bugs account for 35% of production incidents from reviewed PRs.
What is the most effective change to your review design?
- AA. Redesign the review as a turn-limited agentic task where the model can read files and search the codebase via tools, following references to verify cross-file findings.
- BB. Run parallel review passes per changed file with direct dependents included in each pass, then aggregate and deduplicate findings using a final summarization call.
- CC. Use static analysis to build a dependency graph of changed code, then expand the prompt to include all files within two dependency hops of any changed file.
- DD. Add chain-of-thought instructions asking the model to list all external references in the diff, then reason step-by-step about how each change might affect callers in other files.
Show answer & explanation +
Correct answer: A
ExplanationCross-file interaction bugs require the model to inspect callers and related modules that aren’t present in the static diff prompt. A turn-limited agentic review with tools (e.g., Grep/Glob/Read) lets Claude follow references, locate call sites in unchanged files, and verify findings before reporting—reducing false positives while catching real integration issues. Options B/C still rely on heuristic context expansion that can miss indirect usages or blow up context, and D (chain-of-thought prompting) cannot access missing files and is not a substitute for tool-based verification.
QUESTION 12
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
An engineer submits two requests: - Request A: “Rename the ‘getUserData’ function to ‘fetchUserProfile’ everywhere it’s used.” - Request B: “Improve error handling throughout the data processing module – add try/catch blocks, meaningful error messages, and ensure failures don’t silently corrupt data.”
For which request does specifying an explicit multi-phase workflow (such as analyze --> propose --> implement with review) most improve outcome quality?
- AA. Request A, the function rename task
- BB. Request B, the error handling task
- CC. Both requests benefit equally
- DD. Neither request benefits significantly
Show answer & explanation +
Correct answer: B
ExplanationRequest B is open-ended and quality-sensitive: improving error handling requires analysis of existing control flow, failure modes, and consistency across many files, so an explicit analyze → propose → implement (with review) workflow materially improves correctness and reduces regressions. Request A is largely mechanical and can often be handled reliably with search/replace plus compile/test checks, benefiting less from a multi-phase deliberative workflow. In Agent SDK patterns, multi-phase planning is most valuable when requirements are ambiguous and changes are systemic.
QUESTION 13
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
A developer asks the agent to investigate why a specific API endpoint intermittently returns 500 errors. The codebase has 200+ files and the developer doesn’t know which components are involved. The agent must trace the error through routing, middleware, business logic, and database layers.
What task decomposition approach would be most effective?
- AA. Have the agent first create a comprehensive plan mapping all code paths through the endpoint before beginning any file exploration or code reading.
- BB. Define a fixed sequence of investigation steps upfront – grep for error patterns, then read error handlers, then check database queries, then examine middleware – executing each step regardless of intermediate findings.
- CC. Run parallel worker agents that simultaneously investigate all four layers, then synthesize their findings to identify where the error originates.
- DD. Have the agent dynamically generate investigation subtasks based on what it discovers at each step, adapting its exploration plan as new information about the error path emerges.
Show answer & explanation +
Correct answer: D
ExplanationIntermittent 500s in an unknown path are best handled with adaptive exploration: the agent should generate and revise subtasks as it discovers routing, middleware, handlers, and DB calls, using tools to follow evidence (logs, stack traces, grep hits). This matches orchestrator-style behavior where the plan evolves based on intermediate findings. A and B are brittle (overplanning or fixed steps) and C can waste effort by parallelizing before the true execution path is known.
QUESTION 14
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
An engineer asks your agent to add comprehensive tests to a legacy codebase with 200 files and minimal existing test coverage. The engineer hasn’t specified which modules to prioritize.
How should the agent decompose this open-ended task?
- AA. Systematically read all 200 files to create a complete function inventory before writing any tests, ensuring the testing plan accounts for every function before beginning.
- BB. Start writing tests for the first module alphabetically, using test failures and imports to discover related files organically.
- CC. Create a fixed testing schedule upfront based on directory structure, allocating equal effort to each top-level directory regardless of code complexity or business importance.
- DD. Use Glob and Grep to map codebase structure, identify heavily-coupled modules, create a prioritized plan for high-impact areas, and revise as dependencies are discovered.
Show answer & explanation +
Correct answer: D
ExplanationFor an open-ended “add comprehensive tests” request, the agent should first map structure and risk using lightweight tools (Glob/Grep) to identify high-impact and highly-coupled modules, then prioritize and iterate as dependencies emerge. This aligns with agentic best practices: start broad with cheap discovery, then deepen selectively, revising the plan as new information appears. Reading all files (A) is inefficient, and B/C impose arbitrary ordering rather than impact-driven prioritization.
QUESTION 15
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
An engineer asks your agent to identify untested code paths in a legacy payment processing module spanning 45 files. After reading the first 8 source files, the agent’s responses are becoming noticeably less accurate – it’s forgetting previously discussed code patterns and hasn’t yet located all test files or traced critical payment flows.
What’s the most effective approach to complete this investigation?
- AA. Clear context with /clear, then selectively re-read only the most critical files discovered so far, writing key findings to a scratchpad file that persists between context resets.
- BB. Switch to using Grep to search for specific function names instead of reading full files, reducing the content loaded into context for remaining exploration.
- CC. Document all current findings in a summary report, clear context completely, then use that report as the sole reference for continuing the investigation.
- DD. Spawn subagents to investigate specific questions (e.g., “find all test files for payment processing,” “trace refund flow dependencies”) while the main agent coordinates findings and preserves high-level understanding.
Show answer & explanation +
Correct answer: D
ExplanationAccuracy degradation from long investigations is best addressed by decomposing into parallel, focused subagents (workers) that each explore a narrow question with tools, while the main agent (orchestrator) synthesizes results and maintains a stable high-level model. This reduces context pressure per thread and improves coverage (e.g., locating all tests, tracing flows) without relying on frequent full resets. A/C depend on context clearing and manual summarization (risking loss of detail), and B helps reduce context size but doesn’t solve coordination across multiple investigative threads.
QUESTION 16
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 Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate.
Your agent is handling a billing dispute. After calling ‘get_customer’ and ‘lookup_order’, it identifies that the dispute involves a promotional pricing error requiring manager approval – beyond the agent’s authorization level.
How should the workflow handle this mid-process escalation?
- AA. Attempt the refund with ‘process_refund’ anyway, escalating only if the system rejects the transaction.
- BB. Call ‘escalate_to_human’ passing only the customer’s original message.
- CC. Compile a structured handoff with customer details, order info, and the identified issue before calling ‘escalate_to_human’.
- DD. Persist the complete conversation and tool response history to a database, then call ‘escalate_to_human’ with a reference ID.
Show answer & explanation +
Correct answer: C
ExplanationWhen escalation is required mid-flow, best practice is to create a high-quality handoff: include the customer context, relevant tool outputs (customer + order), and the agent’s diagnosis (promo pricing error needing manager approval) before calling the escalation tool. This preserves continuity and reduces re-triage for the human. Passing only the original message (B) loses critical context, and attempting an unauthorized refund (A) violates policy/guardrails; persisting everything and sending only an ID (D) can work operationally but is less reliable unless the human system is guaranteed to fetch and render the full context.
QUESTION 17
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 Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate.
A customer contacts the agent about a warranty claim on a power drill. Resolving this requires multiple sequential tool calls: ‘get_customer’ to look up their account, ‘lookup_order’ to find the purchase details, and then either ‘process_refund’ or ‘escalate_to_human’ depending on warranty eligibility. You’re implementing the agentic loop that orchestrates these steps using the Claude API.
What is the primary mechanism your application uses to determine whether to continue the loop or stop?
- AA. You manually set the ‘tool_choice’ parameter to ‘“none”’ after the final expected tool call to force Claude to stop requesting tools.
- BB. You check whether Claude’s response contains a text content block – if text is present, the agent has produced its final answer and the loop should exit.
- CC. You track the number of tool calls made and exit the loop once a preconfigured maximum is reached.
- DD. You check the ‘stop_reason’ field in each API response – the loop continues while it equals ‘“tool_use”’ and exits when it changes to ‘“end_turn”’ or another terminal value.
Show answer & explanation +
Correct answer: D
ExplanationIn the Claude agentic loop, the application should inspect the API response’s stop_reason: continue when it is tool_use (meaning Claude is requesting a tool call) and stop when it becomes a terminal value like end_turn. Presence of text blocks (B) is not a reliable loop terminator because Claude can emit text alongside tool requests. Forcing tool_choice to none (A) is not the primary control mechanism, and max-tool-call limits (C) are a safety backstop rather than the main stop condition.
QUESTION 18
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 Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate.
You’re implementing the escalation logic for when the agent should call ‘escalate_to_human’. Your team proposes four different approaches for triggering escalation.
Which approach will most reliably identify cases that genuinely require human intervention?
- AA. Instruct the agent to escalate when the customer requests a human, when the issue requires policy exceptions, or when the agent cannot make meaningful progress.
- BB. Implement sentiment analysis that monitors for frustration indicators (negative language, repeated questions, exclamation marks) and trigger escalation when the frustration score exceeds a configured threshold.
- CC. Build a rules engine that maps specific issue types, customer segments, and product categories to escalation decisions, removing the need for model judgment calls.
- DD. Configure the agent to escalate after three consecutive tool calls that fail to resolve the customer’s stated issue, ensuring a reasonable attempt before involving a human.
Show answer & explanation +
Correct answer: A
ExplanationThe most reliable escalation trigger combines explicit user intent (asks for a human), clear policy/authorization boundaries (exceptions/manager approval), and a “stuck” condition (no meaningful progress), which aligns with Claude agent design guidance for safe, high-resolution workflows. Pure sentiment thresholds (B) can over-escalate and miss legitimate complex cases. A static rules engine (C) is brittle for high-ambiguity support and can under-handle novel scenarios, while “three failed tool calls” (D) is a useful fallback but misses non-tool-based dead ends (e.g., policy constraints) and can delay necessary escalation.
QUESTION 19
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 Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate.
During a billing dispute resolution, your agent successfully retrieves customer info via ‘get_customer’ and order details via ‘lookup_order’, but when attempting to call ‘process_refund’, the tool returns a timeout error. The agent has enough information to explain the charges and verify refund eligibility, but cannot actually process the refund due to the backend failure.
What approach best balances first-contact resolution with appropriate error handling?
- AA. Explain the billing, confirm refund eligibility, acknowledge the system issue preventing immediate processing, and offer escalation or retry later
- BB. Confirm the refund will be processed and close the conversation, since the system has all necessary information to complete it automatically
- CC. Implement automatic retries with exponential backoff for ‘process_refund’, keeping the conversation open until the refund is successfully processed
- DD. Escalate immediately to a human agent since the refund action cannot be completed
Show answer & explanation +
Correct answer: A
ExplanationBest practice is to be transparent: explain what you can (billing details and eligibility), acknowledge the backend/tool failure, and offer a next step (retry later or escalate) rather than promising an action you couldn’t complete. This maintains first-contact value while handling tool errors safely. Auto-closing with a promised refund (B) is incorrect, indefinite retries (C) can degrade UX and tie up the session, and immediate escalation (D) may be unnecessary if the user is satisfied with explanation plus a clear follow-up path.
QUESTION 20
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 Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate.
When the agent calls ‘lookup_order’ and receives order details showing the item was purchased 45 days ago, how does the agentic loop determine whether to call ‘process_refund’ or ‘escalate_to_human’ next?
- AA. The order details are added to the conversation and the model reasons about which action to take.
- BB. The agent follows a pre-configured decision tree mapping order attributes to specific tool calls.
- CC. The orchestration layer automatically routes to the next tool based on the order’s status field.
- DD. The agent executes the remaining steps in a tool sequence planned at the start of the request.
Show answer & explanation +
Correct answer: A
ExplanationIn an agentic loop with MCP tools, tool results (e.g., order age = 45 days) are appended to the conversation state, and the model reasons over that context to decide the next action—either call process_refund if policy allows or escalate_to_human if it requires exception/approval. A fixed decision tree (B) or orchestration auto-routing (C) is not the default Claude Agent SDK behavior unless you explicitly implement it. Pre-planning a rigid tool sequence (D) is less appropriate for high-ambiguity cases where branching depends on retrieved facts.