
Get CCAR-F Braindumps & CCAR-F Real Exam Questions
Anthropic CCAR-F Actual Questions and Braindumps
NEW 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.
An engineer asks the agent to find all callers of a function before removing it. The function is defined in a core library but is also exposed through wrapper modules that rename the function for domain-specific use (e.
g., calculateTax in the library becomes computeOrderTax in the orders module).
What exploration strategy will most reliably identify all callers?
- A. Use Grep to find all files that import from the library or wrapper modules, then read each file to check whether it uses the function.
- B. Use Grep to search for the function's original name across the codebase.
- C. Read the library and wrapper modules to identify all exposed names for the function, then Grep for each name across the codebase.
- D. Search for the function name in project documentation to understand intended usage patterns and navigate to documented integration points.
Answer: C
Explanation:
The search must first establish the function's complete naming surface. Reading the core definition and every wrapper or re-export reveals aliases such as computeOrderTax , names introduced through intermediate modules, and potentially different import paths. Once those names are known, the agent can search the entire codebase for each exposed identifier and inspect the resulting call sites.
Claude Code's Grep tool searches patterns inside file contents, whereas Read provides the surrounding implementation needed to determine whether a wrapper delegates to, renames, or conditionally invokes the original function. These tools are complementary: Read establishes semantic identity; Grep provides broad reference discovery. ( https://code.claude.com/docs/en/tools-reference?utm_source=chatgpt.com ) Option B misses every caller using a wrapper alias. Option A may find importing files, but import-level discovery is indirect and can miss re-exports, namespace imports, dependency injection, or calls made through a locally renamed symbol. It also requires unnecessary manual inspection of every consumer of the module. Option D relies on documentation, which may be incomplete or stale and cannot prove that all executable references have been found.
Before removal, the agent should also inspect tests, dynamic registrations, configuration-driven references, and generated code where relevant. The defining requirement is to map the alias chain first and then search all discovered public names.
Official references/topics: Read and Grep Tool Behavior; Symbol and Alias Discovery; Codebase Reference Tracing.
NEW QUESTION # 14
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 pipeline uses a tool called extract_metadata with a JSON schema for paper details. You've also defined lookup_citations and verify_doi tools for enrichment. During testing, you notice that when users include requests like "extract the metadata and tell me how cited it is," Claude sometimes calls lookup_citations first, which fails because it needs the DOI that extract_metadata would provide.
What's the most effective way to ensure structured metadata extraction happens first?
- A. Set tool_choice to {"type": "tool", "name": "extract_metadata"} for every API call in the pipeline, ensuring Claude always extracts metadata before any enrichment can occur.
- B. Set tool_choice to "any" so Claude must use a tool, combined with system prompt instructions prioritizing extract_metadata .
- C. Set tool_choice to {"type": "tool", "name": "extract_metadata"} and process the enrichment requests in subsequent turns after receiving the extracted metadata.
- D. Set tool_choice to "auto" and reorder the tool definitions so extract_metadata appears first in the tools array, since Claude prioritizes earlier-listed tools.
Answer: C
Explanation:
The dependency must be enforced by orchestration rather than left to probabilistic tool selection. Anthropic documents that tool_choice: {"type": "tool", "name": "..."} forces Claude to invoke the specified tool. By contrast, auto allows Claude to decide whether and which tool to call, while any requires some tool but does not force a particular one. ( https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools ) Option A therefore establishes a deterministic two-stage workflow. The first API turn forces extract_metadata
, producing the DOI and other structured paper details. The application validates and stores that result. A subsequent turn then exposes or permits verify_doi and lookup_citations , passing the extracted DOI as explicit state. This design converts an implicit tool dependency into an application-controlled execution graph.
Option B is incorrect because array order is not a documented precedence mechanism and cannot guarantee selection. Option C forces extract_metadata on every call, including turns where enrichment should occur, potentially creating an infinite or non-progressing workflow. Option D guarantees only that one available tool is called; Claude could still select lookup_citations before the DOI exists.
For stronger input integrity, the tools can also use strict schemas so their arguments conform to the declared JSON Schema. The sequencing requirement, however, remains the responsibility of the orchestration layer.
Official references/topics: Tool Choice; Forced Tool Invocation; Multi-Turn Tool Orchestration; Tool Dependency Management.
NEW QUESTION # 15
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?
- A. 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.
- B. 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.
- C. You manually set the tool_choice parameter to "none" after the final expected tool call to force Claude to stop requesting tools.
- D. You track the number of tool calls made and exit the loop once a preconfigured maximum is reached.
Answer: B
NEW 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?
- A. Compile a structured handoff with customer details, order info, and the identified issue before calling escalate_to_human .
- B. Call escalate_to_human , passing only the customer's original message.
- C. Persist the complete conversation and tool response history to a database, then call escalate_to_human with a reference ID.
- D. Attempt the refund with process_refund anyway, escalating only if the system rejects the transaction.
Answer: A
Explanation:
A mid-process escalation should transfer the decision-ready state accumulated by the agent. The human reviewer needs the verified customer identity, relevant order information, the promotional-pricing discrepancy, the reason approval is required, and any actions already attempted. Option B preserves this information in a concise, structured handoff while avoiding unnecessary repetition of the complete raw transcript.
Anthropic's tool-design guidance recommends returning high-signal information and stable identifiers containing only what Claude or the next workflow participant needs to determine the next action. Anthropic's context-engineering guidance similarly advocates structured notes that preserve critical state and dependencies without retaining every redundant tool result. A structured escalation payload applies both principles and reduces handling time for the manager. ( https://platform.claude.com/docs/en/agents-and-tools
/tool-use/define-tools )
Option A discards the investigation already completed. Option C violates the agent's authorization boundary and risks an impermissible financial action. Option D provides auditability, but a reference ID alone forces the human to reconstruct the case from an excessively broad transcript. Human control must remain meaningful when an agent encounters a decision outside its authority; the agent should pause and hand the decision back with sufficient supporting context. ( https://www.anthropic.com/research/trustworthy-agents ) Official references/topics: Structured agent handoffs, high-signal tool results, human-control boundaries, persistent structured state.
NEW 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.
Compliance requires that refunds exceeding $500 must automatically escalate to a human agent-this rule cannot be left to model discretion. Despite clear system prompt instructions, production logs show the agent occasionally processes high-value refunds directly (3% failure rate).
How should you achieve guaranteed compliance?
- A. Implement a hook to intercept tool calls, when the refund process amount exceeds $500, block it and invoke human escalation.
- B. Strengthen the system prompt with emphatic language: "CRITICAL POLICY: Refunds over $500 MUST trigger human escalation. NEVER process these directly."
- C. Add few-shot examples to the prompt showing correct escalation behavior at various refund amounts ($400, $500, $600).
- D. Modify the refund tool to return an error with message "Amount exceeds policy limit-please escalate" when the threshold is exceeded.
Answer: A
Explanation:
A mandatory compliance threshold must be enforced outside probabilistic model reasoning. A PreToolUse hook can inspect every attempted process_refund call before execution, compare its amount with the $500 threshold, and deny the call when the limit is exceeded. The host application can then create the human- escalation case using the validated customer and order context.
Anthropic describes hooks as deterministic controls that ensure required actions occur instead of relying on the model to choose them. Agent SDK documentation confirms that a single denying PreToolUse hook blocks the tool call, including MCP tools matched through their qualified tool names. ( https://docs.anthropic.com/en
/docs/claude-code/hooks-guide )
Options A and B improve expected behavior but cannot guarantee compliance. The stated production failure rate demonstrates that prompting alone is insufficient. Option C prevents the refund from completing, but the subsequent escalation still depends on Claude correctly interpreting the returned error and invoking the human tool. It therefore enforces the financial block but not the complete escalation requirement.
Option D enforces both sides of the policy at the orchestration boundary: deny the unauthorized action and route the case to an approved human process. The escalation action should be idempotent and auditable.
Official references/topics: PreToolUse hooks, deterministic policy enforcement, MCP tool interception, human-approval controls.
NEW QUESTION # 18
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?
- A. Implement post-extraction validation using pattern matching to detect amendments and flag those extractions for manual review.
- B. Preprocess documents with a classifier that identifies and removes superseded sections before the main extraction step.
- C. Redesign the schema so amended fields capture multiple values, each with source location and effective date.
- D. Add prompt instructions to always extract the most recent amendment value and ignore superseded original terms.
Answer: C
Explanation:
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.
NEW 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.
Your process_refund tool returns two types of errors: technical errors ("503 Service Unavailable",
"Connection timeout") that are transient (~5% of calls), and business errors ("Order exceeds 30-day return window", "Item already refunded") that are permanent (~12% of calls). Monitoring shows the agent wastes 3-
4 turns retrying business errors that can never succeed. Currently, both error types return only a plain text message to Claude.
What's the most effective way to reduce wasted retries while improving customer-facing response quality?
- A. Implement automatic retry logic at the tool layer for technical errors only, passing business errors to Claude without retries.
- B. Add a check_refund_eligibility tool that must be called before process_refund to prevent business rule violations.
- C. Add few-shot examples showing how to distinguish retriable from non-retriable errors by parsing error message text.
- D. Return structured error responses with "retriable": false for business errors and a customer-friendly explanation for Claude to use.
Answer: D
Explanation:
The error response must explicitly communicate both control semantics and user-facing meaning. Setting
"retriable": false tells the agent that repeating the same operation cannot change the outcome. Providing a customer-friendly explanation allows Claude to respond accurately without exposing internal implementation details or inventing its own interpretation of the business rule.
Anthropic recommends returning failed tool operations with an error indicator and sufficiently informative content so Claude can decide whether to retry, request another input, or explain the limitation. Tool interfaces should provide detailed descriptions and structured parameters rather than forcing Claude to infer operational behavior from ambiguous text. ( https://platform.claude.com/docs/en/agents-and-tools/tool-use/build-a-tool- using-agent?utm_source=chatgpt.com ) Option A appropriately limits automatic retries to technical failures, but it does not solve the stated customer- response problem unless business failures also carry clear semantics. Option B relies on fragile parsing of human-readable messages. Option C adds latency and another tool dependency, and eligibility may still change or fail for reasons not covered by the preliminary check.
A complete schema should identify the error code, category, retryability, customer-safe explanation, and permitted next actions. Technical errors can similarly return "retriable": true with retry guidance and a maximum-attempt policy.
Official references/topics: Structured tool errors, retryability classification, customer-safe explanations, resilient MCP contracts.
NEW QUESTION # 20
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 running for 3 weeks and human reviewers have corrected 847 extractions. Analysis reveals a recurring pattern: when recipes use informal measurements like "a handful" or "a splash," the model either invents specific amounts or leaves fields empty-accounting for 23% of all corrections.
How should you use this feedback to improve extraction accuracy?
- A. Update your JSON schema to add a "measurement_type" enum field (precise/informal).
- B. Implement a post-processing layer that uses pattern matching to detect informal measurement phrases in source text and automatically populate values when the extraction is empty.
- C. Add few-shot examples to your prompt demonstrating correct handling of informal measurements- extracting them verbatim rather than converting or omitting them.
- D. Fine-tune the model on the 847 corrected extractions.
Answer: C
Explanation:
The reviewer corrections have exposed a narrow and repeatable interpretation failure. The desired policy is clear: informal measurements are valid source values and must be preserved verbatim rather than normalized into invented quantities or treated as missing. This behavior can be communicated efficiently through targeted few-shot examples.
Anthropic recommends examples for demonstrating expected behavior and improving consistency. Examples can pair source phrases such as "a handful of spinach," "a splash of vinegar," and "a pinch of salt" with outputs that retain handful , splash , and pinch exactly. Additional counterexamples can show that Claude must not convert these phrases into grams, millilitres, or estimated serving quantities. ( https://docs.anthropic.
com/en/docs/about-claude/use-case-guides/ticket-routing )
Option A introduces a substantially heavier training workflow for a problem that can be addressed directly through the prompt. Option C creates a parallel extraction mechanism based on pattern matching; it will be brittle across linguistic variations and may populate a value without understanding its relationship to the correct ingredient. Option D adds useful classification metadata, but it does not instruct Claude to preserve the original measurement instead of inventing or omitting it.
The revised prompt should combine an explicit verbatim-extraction rule with several varied examples derived from the corrected cases, followed by regression evaluation against the identified failure set.
Official references/topics: Few-Shot Examples, Feedback-Driven Prompt Improvement, Verbatim Extraction, Regression Evaluation.
NEW QUESTION # 21
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.
The agent verifies customer identity through a multi-step process before resetting passwords. During testing, you notice that after the customer answers the third verification question, the agent asks them to provide their name again, as if the earlier exchange never happened.
What's the most likely cause of this behavior?
- A. Claude's memory retention is limited to two conversational turns by default, requiring explicit configuration to extend it.
- B. The prompt lacks instructions telling Claude to remember information across multiple exchanges.
- C. The conversation history isn't being passed in subsequent API requests.
- D. The verification tool is clearing the agent's internal state after each successful validation step.
Answer: C
Explanation:
The Claude Messages API is stateless. Each API request must include the conversation history that Claude requires for the current response. If the application sends only the customer's third verification answer, Claude does not automatically retrieve the earlier turns containing the customer's name and previous answers.
From the model's perspective, that information is absent.
Anthropic's Messages API documentation states that applications must send the full conversational history to build a multi-turn interaction. The correct implementation appends each user message and assistant response to the messages array and resends the accumulated sequence on every subsequent request. ( https://platform.
claude.com/docs/en/build-with-claude/working-with-messages )
Option A cannot restore information that was omitted from the request. Instructions to "remember" do not create server-side conversational state. Option C describes application-specific behavior for which the scenario provides no evidence. Option D is factually incorrect: Claude does not have a default two-turn retention limit. Its effective conversational awareness depends on the messages provided and the model's context window.
For a verification workflow, the application should also persist structured verification state separately from prose history. That state may include completed checks, pending checks, attempt counts, and a verified customer identifier. This improves reliability while the conversational transcript preserves the natural interaction.
Official references/topics: Stateless Messages API, multi-turn history construction, structured workflow state, conversational continuity.
NEW QUESTION # 22
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?
- A. Implement automatic retries with exponential backoff for process_refund , keeping the conversation open until the refund is successfully processed.
- B. Explain the billing, confirm refund eligibility, acknowledge the system issue preventing immediate processing, and offer escalation or retry later.
- C. Confirm the refund will be processed and close the conversation, since the system has all necessary information to complete it automatically.
- D. Escalate immediately to a human agent since the refund action cannot be completed.
Answer: B
Explanation:
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.
NEW QUESTION # 23
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.
A security audit requires updating your authentication library from v2 to v3. The migration guide documents breaking changes: authenticate() now returns a Promise instead of accepting a callback, the User type has restructured fields, and three deprecated methods were removed. Grep shows the library is imported in 45 files across several modules.
What's the most effective approach?
- A. Paste the migration guide's breaking changes into your prompt and use direct execution to update all usages across the 45 files.
- B. Create a custom slash command encapsulating the migration transformations, then execute it against each file without prior codebase exploration.
- C. Update the dependency version, run the test suite, and use Claude Code to fix each failure as it appears.
- D. Enter plan mode to explore library usage across modules, map affected code paths, then create a migration strategy before implementing.
Answer: D
Explanation:
This migration is a high-impact, cross-module change with several independent breaking changes. Before editing, Claude must determine how the callback-based API is currently used, where the restructured User fields propagate, whether deprecated methods are wrapped or re-exported, and which downstream modules depend on the affected behavior. Plan mode is therefore the correct starting point because it allows Claude to inspect the repository, identify affected code paths, and produce an implementation strategy without modifying source files.
Anthropic recommends separating exploration and planning from implementation when the approach is uncertain, the change affects multiple files, or the developer is unfamiliar with the impacted code. Direct execution is better reserved for small, clearly scoped changes that can be described as a simple diff. (
https://code.claude.com/docs/en/best-practices )
Option A applies transformations before establishing whether every usage follows the same pattern. Option B turns the test suite into a reactive discovery mechanism and may miss untested behavior. Option D provides useful migration documentation but assumes all 45 files can be changed uniformly. The reliable sequence is exploration, impact mapping, migration planning, implementation, and verification against tests and type checks.
Official references/topics: Plan Mode; Explore-Plan-Implement Workflow; Multi-File Migration Planning; Verification.
NEW QUESTION # 24
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?
- A. Use plan mode to analyze the current /products endpoint implementation, then provide your caching requirements once Claude explains how the existing code is structured.
- B. Start with a minimal request: "Add Redis caching to /products with 5-minute TTL." Add features and fix issues through follow-up prompts as problems surface during testing.
- C. Ask Claude to interview you about the caching requirements before implementing, surfacing considerations like invalidation strategies, cache layers, consistency guarantees, and failure modes.
- D. Write a specification with your known requirements and "TBD" markers for uncertain areas, having Claude propose solutions for each TBD as it implements.
Answer: C
Explanation:
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.
NEW QUESTION # 25
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.
You've configured your Claude agent with three MCP servers: one for git operations, one for Jira ticket management, and one for documentation search.
When a user asks the agent to "create a branch for JIRA-123 and add documentation links to the ticket," how does the agent access tools across these servers?
- A. The agent automatically selects the most relevant server based on the request and loads only that server' s tools.
- B. The agent queries each server sequentially to determine which handles each tool, routing calls based on tool name prefixes.
- C. Tools from all configured MCP servers are discovered at connection time and available simultaneously to the agent.
- D. You must specify which MCP server to use for each turn, and the agent can only access one server's tools at a time.
Answer: C
Explanation:
MCP allows a Claude application to connect to multiple servers and expose their enabled tools within the same agentic interaction. Anthropic's MCP connector documentation explicitly supports connecting to multiple MCP servers in one request. Once connected, Claude can invoke a server's tool when the user's request corresponds to the capability described by that tool. ( https://docs.anthropic.com/en/docs/agents-and- tools/mcp-connector ) In this scenario, the git server can provide the branch-creation operation, the documentation server can locate the relevant links, and the Jira server can update ticket JIRA-123. The agent can coordinate these capabilities without requiring a separate conversational turn that restricts it to only one server. Tool descriptions and schemas tell Claude what each operation does and what inputs it requires.
Option B incorrectly describes sequential capability discovery. Server identity and tool definitions are established through the MCP configuration rather than discovered by querying every server for each operation. Option C is incorrect because connecting several servers does not inherently restrict the agent to a single selected server. Option D imposes a one-server-per-turn limitation that MCP does not require.
Access can still be controlled through allowlists, denylists, permissions, and per-tool configuration. Those controls restrict which tools are enabled; they do not change the fundamental ability to make tools from multiple configured servers available together.
Official references/topics: MCP Server Configuration, Multi-Server Tool Access, Tool Discovery, MCP Tool Permissions.
NEW QUESTION # 26
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.
Your team has connected a custom MCP server that provides DevOps workflow templates. The server exposes several MCP prompts (such as deploy_checklist and incident_response ) in addition to tools.
How do these MCP prompts become accessible within Claude Code?
- A. They appear as slash commands (e.g., /mcp__servername__deploy_checklist ) that you can invoke, with arguments passed after the command name.
- B. They are automatically prepended to every conversation as additional system-level context, influencing Claude's behavior throughout the session.
- C. They are surfaced as @ -mentionable resources alongside files, fetched and attached to your message when referenced.
- D. They are added to Claude Code's tool registry alongside the server's tools, invoked automatically by the model when relevant to the task.
Answer: A
Explanation:
MCP prompts are exposed as user-invoked commands rather than autonomous tools or permanently loaded system instructions. Claude Code dynamically discovers prompts from connected MCP servers and displays them in the command list using the naming convention /mcp__servername__promptname .
Arguments are supplied as space-separated values after the command. When executed, the MCP server resolves the prompt and its returned content is injected into the active conversation. Anthropic's official documentation provides examples such as /mcp__github__list_prs and /mcp__jira__create_issue "Bug in login flow" high . ( https://code.claude.com/docs/en/mcp ) Option A would consume context continuously and incorrectly treat optional workflow templates as mandatory system instructions. Option B confuses MCP prompts with MCP tools: tools are model-callable operations, while prompts are reusable prompt templates invoked as commands. Option C describes MCP resources, which can be referenced and attached but are a distinct MCP capability.
For the stated server, the team could invoke commands such as /mcp__devops__deploy_checklist or
/mcp__devops__incident_response service-name . The exact server segment is derived from the configured server name, with normalization applied where necessary.
Official references/topics: MCP Prompts; Dynamic Prompt Discovery; MCP Slash-Command Naming; Prompt Arguments.
NEW QUESTION # 27
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 new payment processing module that must follow your project's established patterns for database transactions, error handling, and audit logging. You've identified three existing modules that exemplify these patterns: db_utils.py , error_handlers.py , and audit_logger.py . This is a one-off integration task-these patterns are well-documented in your team wiki and don't need additional project-level documentation.
What's the most effective approach?
- A. Describe the patterns from the three modules in natural language in your prompt, explaining the transaction handling approach, error format, and logging conventions Claude should follow.
- B. Add documentation of each pattern to your CLAUDE.md file, establishing them as project conventions that Claude will apply automatically.
- C. Use @ references to include the three modules directly in your prompt, giving Claude concrete code examples of the patterns to follow.
- D. Ask Claude to explore your codebase to find and understand the transaction, error handling, and logging patterns before generating the new module.
Answer: C
Explanation:
Direct @ references provide Claude with the exact implementations it must imitate. Anthropic documents that referencing a file with @ includes the full file content in the conversation, and multiple files can be referenced in one message. This gives Claude immediate access to the real transaction boundaries, exception structures, audit fields, naming conventions, and helper APIs used by the project. ( https://code.claude.com/docs/en
/common-workflows )
Option B is inappropriate because the task is explicitly one-off and the conventions are already documented elsewhere. CLAUDE.md is loaded into every session and should contain concise information that broadly applies to the project. Adding detailed implementation material for a single integration would consume context unnecessarily. Anthropic recommends moving occasional procedures to skills and keeping CLAUDE.
md limited to persistent, widely applicable guidance. ( https://code.claude.com/docs/en/memory ) Option C loses precision because a natural-language summary may omit subtle but important code behavior.
Option D asks Claude to rediscover files that have already been identified, increasing exploration time and context usage.
The most effective prompt should reference all three modules, identify which pattern each demonstrates, specify the new module's required behavior, and request focused tests proving that the established conventions were followed.
Official references/topics: @ file references, rich prompt context, CLAUDE.md scope, pattern-based implementation.
NEW QUESTION # 28
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.
Testing reveals that when source documents are missing certain specifications, the model fabricates plausible- sounding values to satisfy your schema's required fields. For example, a document mentioning only dimensions receives a fabricated "weight: 2.3 kg" in the extraction output.
What schema design change most effectively addresses this hallucination behavior?
- A. Change fields that may not exist in source documents from required to optional, allowing the model to omit them.
- B. Implement semantic validation that verifies each extracted value appears in or can be inferred from the source document text.
- C. Add a "confidence" field alongside each specification where the model self-reports its certainty, then filter out low-confidence extractions.
- D. Add explicit instructions to the prompt stating "only extract information explicitly stated in the document; use placeholder text for missing values."
Answer: A
Explanation:
The schema is creating a structural incentive for fabrication. When a field is declared required, the output must contain a value even when the source document contains no corresponding evidence. Structured Outputs can guarantee that Claude's response conforms to a JSON Schema, but schema conformance does not establish that every generated value is factually supported. Anthropic's documentation shows that the required array determines which properties must be present; therefore, source-dependent properties that may legitimately be absent should not be included as required fields. ( https://platform.claude.com/docs/en/build- with-claude/structured-outputs ) Option B corrects the problem at the contract level. Claude can omit the unavailable property rather than inventing content merely to produce valid JSON. A nullable representation could also be used when downstream systems require a stable key set, but forcing an unsupported non-null value is architecturally unsound.
Option A still requires placeholder generation and does not resolve the mismatch between the schema and available evidence. Option C relies on model-generated confidence, which is not a substitute for grounding.
Option D is a useful secondary control, but it does not constitute the requested schema-design change.
Anthropic recommends allowing uncertainty and requiring factual claims to be grounded in the provided material. ( https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations ) Official references/topics: Structured Outputs-JSON Schema design; Reduce Hallucinations-allowing uncertainty and grounding claims.
NEW QUESTION # 29
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 returns 4 hours after their initial session about the same billing dispute. The previous 32-turn session contains lookup_order results showing "Status: PENDING, Expected resolution: 24-48 hours." In testing, you observe that when resuming sessions with stale tool results, the agent often references the outdated data in responses (e.g., "I see your refund is still being processed") even after subsequent fresh tool calls return different information.
What approach most reliably handles returning customers?
- A. Resume with full history and configure the agent to automatically re-call all previously used tools at session start to ensure data freshness.
- B. Start a new session, inject a structured summary of the previous interaction (issue type, actions taken, resolution status), then make fresh tool calls before engaging.
- C. Resume with full history but filter out previous tool_result messages before resuming, keeping only the human/assistant turns so the agent must re-fetch needed data.
- D. Resume with full history and add a system prompt instruction telling the agent to always prefer the most recent tool results when multiple calls to the same tool exist in context.
Answer: B
Explanation:
Option D separates durable case history from volatile operational data. The new session receives a compact, structured summary describing the billing dispute, the customer's objective, actions previously taken, and the unresolved status. It does not inherit outdated backend observations as though they were still authoritative.
Fresh tool calls then retrieve the current refund or order state before the agent responds.
Agent SDK sessions preserve conversation history, including earlier tool calls and tool results. Resuming the complete transcript therefore reintroduces stale system data into the active context, even though the external backend may have changed substantially during the four-hour gap. Conversation persistence must not be confused with persistence of external-system truth.
Option A performs unnecessary calls to every previously used tool, including tools unrelated to the returning customer's current question. Option B relies on prompt compliance while retaining contradictory historical evidence in context. Option C manually removes tool results from an existing transcript and may damage the logical relationship between prior tool_use and tool_result blocks while still retaining a long, unstructured conversation.
A structured summary should preserve stable identifiers, previous actions, customer commitments, and unresolved issues. Time-sensitive fields such as refund status, delivery state, account balance, or expected resolution should always be refreshed through authoritative tools.
Official references/topics: Session persistence, stale tool-result management, context compaction, fresh-data retrieval.
NEW QUESTION # 30
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 complex graph traversal algorithm with specific performance requirements and edge cases to handle (disconnected nodes, cycles, weighted edges). You want to structure your workflow for efficient iterative refinement with Claude.
What approach will most effectively enable progressive improvement across multiple iterations?
- A. Provide Claude with a detailed natural language specification of the algorithm, including all requirements and edge cases. Review each output manually and provide descriptive feedback on what behavior needs to change.
- B. Write a test suite covering expected behavior, edge cases, and performance requirements before implementation. Ask Claude to write code that passes the tests, then iterate by sharing test failures with each refinement request.
- C. Have Claude extensively research the algorithm and create a detailed implementation plan using extended thinking, then implement the complete solution based on that plan.
- D. Provide Claude with a reference implementation from documentation, then ask it to rewrite the code to match your codebase style and add the required edge case handling, comparing outputs against the reference.
Answer: B
Explanation:
Option C creates an objective verification loop. The tests encode expected traversal behavior for disconnected graphs, cycle handling, weighted edges, invalid inputs, and performance constraints. Claude can implement the algorithm, execute the suite, inspect concrete failures, and refine the implementation until the measurable conditions pass.
Anthropic emphasizes giving Claude a verification mechanism such as tests, builds, linters, or fixture comparisons. Without an executable pass-or-fail check, Claude can only determine that an implementation appears complete. With tests, it can perform work, evaluate the result, and iterate using evidence rather than subjective judgment. Anthropic also recommends reproducing defects with failing tests before applying corrections. ( https://code.claude.com/docs/en/best-practices ) Option A may produce a thoughtful initial design but does not guarantee progressive improvement after implementation. Option B risks inheriting assumptions or deficiencies from a reference that may not match the project's constraints. Option D depends on manual review and converts the developer into the primary verification system.
The test suite should include correctness fixtures, boundary cases, complexity-sensitive workloads, and regression tests added whenever a new failure is discovered. This makes every iteration cumulative: a correction must satisfy the new case without breaking previously validated behavior.
Official references/topics: Executable Verification; Test-Driven Iteration; Feedback Loops; Regression Testing.
NEW QUESTION # 31
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?
- A. Compare accuracy at different confidence thresholds (85%, 90%, 95%) to find the optimal cutoff that maximizes automation while minimizing errors.
- B. Verify that 97% accuracy meets requirements for all downstream systems that consume the extracted data.
- C. Analyze accuracy by document type and field to verify high-confidence extractions perform consistently across all segments, not just in aggregate.
- D. Run a two-week pilot routing 25% of high-confidence extractions directly to downstream systems and monitor error reports.
Answer: C
Explanation:
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.
NEW QUESTION # 32
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 need to add a date validation check ensuring event dates are in the future. This requires adding a conditional statement to one existing function in a single file.
What is the most appropriate approach?
- A. Start with extended thinking mode enabled to ensure thorough reasoning about the validation logic.
- B. Enter plan mode to analyze how the validation might impact other parts of the reservation flow.
- C. Use direct execution to make the change.
- D. Enter plan mode first to create a detailed implementation strategy before making the change.
Answer: C
Explanation:
This change is narrow, localized, and already defined: add one conditional validation check to an existing function in a single file. A separate planning phase would introduce process overhead without resolving meaningful architectural uncertainty. Direct execution allows Claude to read the function, implement the condition, and run the relevant focused tests.
Anthropic explicitly states that plan mode adds overhead and should generally be skipped when the scope is clear and the fix is small. Planning is most valuable when the approach is uncertain, multiple files are affected, or the code is unfamiliar. Anthropic's practical rule is that when the required diff can be described in one sentence, direct implementation is appropriate. ( https://code.claude.com/docs/en/best-practices ) Option B allocates unnecessary reasoning effort to straightforward validation logic. Options C and D exaggerate the complexity of a single-function change. Broader impact analysis would be justified only if the requirement altered reservation semantics, time-zone rules, persistence behavior, or public interfaces-none of which is stated.
The implementation should still include verification. Claude should add or update tests for a future date, the current date, and a past date, then run the narrowest relevant test command. Direct execution does not mean unverified execution.
Official references/topics: Direct Execution; Plan-Mode Selection; Small Scoped Changes; Focused Verification.
NEW QUESTION # 33
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?
- A. Single comprehensive prompt-include all three instructions in one prompt and let the model handle all three aspects simultaneously.
- B. 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.
- C. Routing-classify each PR by type (feature, bugfix, refactor) first, then route to different review prompts optimized for that category.
- D. 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.
Answer: B
Explanation:
Prompt chaining is appropriate because the workflow consists of predictable, fixed subtasks that apply to every pull request. The system can run a focused style-compliance analysis, then a security analysis, then a documentation review, and finally synthesize the three results into a consistent report.
Anthropic defines prompt chaining as decomposing a task into a sequence of steps in which each call handles a smaller component. It is recommended when a task can be cleanly divided into fixed subtasks, trading additional latency for better focus and accuracy. Intermediate checks can also be inserted between stages to confirm that each report section meets its requirements. ( https://www.anthropic.com/engineering/building- effective-agents ) Option A concentrates all considerations into one call, making it easier for one aspect to receive inadequate attention. Option B is unnecessary because orchestrator-workers is intended for complex work where the required subtasks cannot be predicted in advance. Here, the three review dimensions are already known and remain constant. Option D solves a different problem: routing is appropriate when inputs belong to distinct categories that require different downstream processes.
Although the three analyses could potentially be parallelized for lower latency, the option that accurately represents the stated repeatable decomposition is prompt chaining with final synthesis.
Official references/topics: Prompt Chaining, Fixed Subtasks, Intermediate Validation, Workflow Selection.
NEW QUESTION # 34
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.
Your team wants Claude to follow a detailed code review checklist (8 items covering API changes, test coverage, documentation, security, etc.) when reviewing pull requests. The team also uses Claude extensively for other tasks: writing new features, debugging production issues, and generating documentation. Currently, developers paste the checklist at the start of each review session.
Which approach best addresses this workflow need?
- A. Add the checklist to the project's CLAUDE.md file under a "Code Review" section.
- B. Create a dedicated review subagent with the checklist embedded in its configuration.
- C. Create a /review slash command containing the checklist, invoked when starting reviews.
- D. Configure plan mode as the default for code review sessions.
Answer: C
Explanation:
The checklist is a reusable, task-specific procedure that should load only when a pull-request review is being performed. A /review command provides an explicit invocation mechanism, prevents repeated copy-and- paste, and keeps the checklist out of unrelated coding, debugging, and documentation sessions.
In current Claude Code terminology, custom commands have been consolidated into skills. A .claude/skills
/review/SKILL.md file creates a /review command, while the legacy .claude/commands/review.md format remains supported. Anthropic recommends skills when users repeatedly supply the same checklist or multi- step procedure; unlike CLAUDE.md content, the skill body is loaded only when invoked or determined relevant. ( https://code.claude.com/docs/en/skills ) Option B introduces an isolated agent context when the requirement is primarily to inject a repeatable review procedure. A subagent could be useful for independent verification, but it is not necessary merely to avoid repasting the checklist. Option C bloats every session with instructions that apply only to code review. Option D controls editing permissions and planning behavior; it does not encode review criteria.
The review skill can also pre-authorize read-only tools and accept a pull-request identifier or branch as an argument.
Official references/topics: Claude Code Skills; Custom Slash Commands; On-Demand Instructions; Reusable Review Workflows.
NEW QUESTION # 35
......
CCAR-F Dumps To Pass Anthropic Exam in 24 Hours - ITExamDownload: https://testking.itexamdownload.com/CCAR-F-valid-questions.html