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?
Correct Answer: C
The Messages API exposes stop_reason specifically so the application can determine why Claude stopped generating and what action is required next. A value of tool_use means Claude is requesting one or more tools and expects the application to execute them and return corresponding tool_result blocks. A value of end_turn means Claude has naturally completed the response. ( https://platform.claude.com/docs/en/build-with-claude /handling-stop-reasons ) Anthropic's agent-loop tutorial implements this as a loop that continues executing tools and returning results while stop_reason remains tool_use . Once the value changes, the response is treated according to the new terminal or continuation condition. ( https://platform.claude.com/docs/en/agents-and-tools/tool-use/build-a- tool-using-agent ) Option A is unreliable because an assistant response can contain both text and tool-use blocks. Text alone does not prove that the workflow is complete. Option B requires the application to predict that no further tool call is needed, defeating Claude's ability to adapt from tool results. Option D is an important safety limit but is not the primary completion signal; an arbitrary maximum may terminate a valid workflow prematurely. The harness should check stop_reason , process every requested tool call, append results to the conversation, and maintain a separate maximum-turn safeguard against runaway loops. Official references/topics: Messages API stop reasons, tool-use loops, tool-result continuation, bounded orchestration.
CCAR-F Exam Question 7
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?
Correct Answer: C
First-contact resolution does not require pretending that every backend operation succeeded. The agent can still resolve the informational portion of the interaction by explaining the charge and confirming eligibility using the successfully retrieved customer and order data. It must then distinguish that verified conclusion from the uncompleted refund transaction. Anthropic's tool-error guidance states that Claude should receive the failure information so it can retry, request clarification, or explain the limitation. A tool timeout must therefore be surfaced honestly rather than converted into an unsupported success claim. ( https://platform.claude.com/docs/en/agents-and-tools/tool-use /build-a-tool-using-agent?utm_source=chatgpt.com ) Anthropic also emphasizes transparent, simple agent designs and carefully constructed tool interfaces, which support explicit disclosure of tool failure and controlled escalation. ( https://www.anthropic.com/engineering/building-effective-agents ) Option A can create an unbounded or excessively long interaction; retries should be limited and conditioned on retryability. Option B falsely represents an incomplete financial operation as completed. Option D discards the useful work already performed and escalates before providing the customer with the available explanation. Option C preserves trust, delivers the information already established, clearly states what remains incomplete, and gives the customer a practical next step through bounded retry or human escalation. Official references/topics: Graceful tool failure, transparent customer communication, bounded retry, human escalation.
CCAR-F Exam Question 8
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 pipeline processes contracts that frequently include amendments. When a contract contains both original terms and later amendments (e.g., original clause specifies "30-day payment terms" while Amendment 1 changes this to "45 days"), the model inconsistently extracts one value or the other with no indication of which applies. What's the most effective approach to improve extraction accuracy for documents with amendments?
Correct Answer: B
The document contains multiple factually valid values whose applicability depends on chronology and legal context. Collapsing those values into a single scalar field discards essential provenance. Option B corrects the data model by representing each term as a structured record containing the extracted value, source location, document or amendment identifier, and effective date. Anthropic's Structured Outputs feature is designed for data-extraction use cases in which nested objects and arrays must conform to a defined JSON Schema. ( https://platform.claude.com/docs/en/build-with-claude /structured-outputs ) Anthropic also recommends grounding factual outputs in direct source material and making claims auditable through supporting evidence. ( https://docs.anthropic.com/en/docs/test-and-evaluate /strengthen-guardrails/reduce-hallucinations ) A provenance-aware schema applies both principles: it retains the original clause and the amendment instead of forcing Claude to resolve a potentially complex legal precedence question during extraction. Option A is destructive because removing superseded text prevents auditing and may eliminate terms still relevant to earlier periods. Option C oversimplifies amendment logic; the newest document is not automatically controlling for every date, jurisdiction, or clause. Option D identifies risk but does not improve the extracted representation and unnecessarily sends all amendment cases to manual review. After extraction, deterministic business logic can select the value effective on a requested date while retaining the complete contractual history. Official references/topics: Structured Outputs; Nested Schema Design; Provenance and Source Grounding; Temporal Data Modeling.
CCAR-F Exam Question 9
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 system has been operating with 100% human review for 3 months. Analysis shows that extractions with model confidence #90% have 97% accuracy overall. To reduce reviewer workload, you plan to automate high- confidence extractions. Before deploying, what validation step is most critical?
Correct Answer: A
An aggregate accuracy value can conceal severe performance disparities. A system may achieve 97% overall accuracy while performing poorly on a low-volume document type, a critical financial field, or a specific edge case. Automating outputs solely from the aggregate figure could therefore expose downstream systems to concentrated, high-impact errors. Anthropic's evaluation guidance states that evaluations should be task-specific, reflect the real-world task distribution, and explicitly include edge cases. It also emphasizes multidimensional success criteria rather than reliance on a single global metric. ( https://docs.anthropic.com/en/docs/build-with-claude/develop-tests ) Option A applies those principles by stratifying performance according to document type and field. This reveals whether confidence is calibrated consistently and whether the proposed automation threshold remains safe for every operationally significant segment. Option B is useful only after segment-level performance has been understood. Selecting a global threshold cannot correct a subgroup where confidence is systematically overstated. Option C is necessary governance work, but it treats the overall 97% result as though errors were uniformly distributed. Option D places unvalidated outputs into downstream systems and depends on passive error reporting, which may fail to detect silent corruption. The correct deployment gate is therefore segmented validation, followed by threshold selection, downstream acceptance criteria, and a controlled pilot. Official references/topics: Define Success Criteria; Task-Specific Evaluations; Edge-Case Coverage; Reliability Segmentation.
CCAR-F Exam Question 10
You are using Claude Code to accelerate software development. Your team uses it for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow with custom slash commands, CLAUDE.md configurations, and understand when to use plan mode vs direct execution. You're implementing a caching layer for API responses to speed up the /products endpoint. You have a rough idea-Redis with a 5-minute TTL-but you're new to production caching and aren't sure what other considerations a robust implementation requires. What's the most effective way to start your iterative workflow?
Correct Answer: A
The primary risk is not implementation difficulty but incomplete requirements. Production caching introduces decisions involving invalidation, stale-data tolerance, cache keys, tenant boundaries, serialization, stampede prevention, failure behavior, observability, deployment topology, and consistency expectations. Implementing Redis with a five-minute TTL before resolving these questions can produce a technically functional but operationally unsafe design. Anthropic recommends having Claude interview the user before beginning a larger feature when important requirements remain uncertain. The AskUserQuestion workflow is intended to surface technical implementation concerns, edge cases, trade-offs, and assumptions the user may not have considered. Anthropic further recommends converting the resulting answers into a self-contained specification with explicit scope and an end-to-end verification step. ( https://code.claude.com/docs/en/best-practices ) Option B provides useful codebase context but postpones requirement discovery. Option C creates avoidable rework by allowing architecture to emerge from production failures. Option D documents uncertainty but delegates unresolved design choices during implementation, when they may already constrain the code. After the interview produces a caching specification, Claude can enter plan mode to inspect the endpoint and map those requirements onto the existing architecture before implementation. Official references/topics: Requirements Interviewing; AskUserQuestion; Specification Development; Edge- Case and Trade-Off Discovery.