Prepare for your exam certification with our CCAR-F Certified Anthropic [Q34-Q51]

Share

Prepare for your exam certification with our CCAR-F Certified Anthropic

Free Anthropic CCAR-F Exam 2026 Practice Materials Collection

NEW QUESTION # 34
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 must extract event details from calendar invitations and output JSON that strictly conforms to a schema with fields for title, date, time, location, and attendees. Downstream systems reject any malformed or non-conformant JSON.
What approach provides the most reliable schema compliance?

  • A. Append instructions like "Output only valid JSON matching the schema exactly" and implement retry logic to re-prompt when JSON parsing fails.
  • B. Include detailed JSON formatting instructions and the target schema in your prompt, then parse Claude' s text response as JSON.
  • C. Define a tool with your target schema as input parameters and have Claude call it with the extracted data.
  • D. Pre-fill Claude's response with an opening brace to force JSON output, then complete and parse the response.

Answer: C

Explanation:
A tool definition converts the desired extraction structure into an explicit machine-readable contract. Claude returns the event information inside a tool_use block, with the tool arguments corresponding to the properties defined by the tool's input_schema . Anthropic specifies that custom tool parameters are described using JSON Schema, allowing the application to extract the structured arguments directly rather than attempting to recover JSON from ordinary prose. For current implementations, adding strict: true to the tool definition provides guaranteed conformance of tool-call inputs to the declared schema. ( https://docs.anthropic.com/en
/docs/agents-and-tools/tool-use/implement-tool-use )
Options A, B, and D remain prompt-based formatting techniques. They may improve the probability of valid JSON, but none creates the same schema-enforced interface. Prefilling an opening brace constrains the beginning of the response without guaranteeing valid field names, required properties, or data types. Retry logic detects failures only after generation and adds latency. Detailed formatting instructions can still produce malformed or structurally incorrect output.
Anthropic now also provides Structured Outputs for direct, schema-validated JSON responses. Within the options presented, however, a schema-defined tool is the only approach that establishes an explicit structured- output boundary rather than relying primarily on text-generation compliance. ( https://docs.anthropic.com/en
/docs/test-and-evaluate/strengthen-guardrails/increase-consistency )
Official references/topics: Tool Definitions, JSON Schema Input Contracts, Strict Tool Use, Structured Outputs.


NEW QUESTION # 35
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. The conversation history isn't being passed in subsequent API requests.
  • B. The prompt lacks instructions telling Claude to remember information across multiple exchanges.
  • C. The verification tool is clearing the agent's internal state after each successful validation step.
  • D. Claude's memory retention is limited to two conversational turns by default, requiring explicit configuration to extend it.

Answer: A

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 # 36
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. Update the dependency version, run the test suite, and use Claude Code to fix each failure as it appears.
  • B. Create a custom slash command encapsulating the migration transformations, then execute it against each file without prior codebase exploration.
  • C. Enter plan mode to explore library usage across modules, map affected code paths, then create a migration strategy before implementing.
  • D. Paste the migration guide's breaking changes into your prompt and use direct execution to update all usages across the 45 files.

Answer: C

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 # 37
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.
The system needs to extract candidate information (name, contact details, skills, work experience, education) from uploaded resumes. The extracted data must strictly conform to a predefined JSON schema, as missing required fields or incorrect data types will cause downstream validation failures.
What is the most reliable approach to ensure Claude's output consistently matches the schema?

  • A. Include detailed JSON formatting instructions and a template example in the system prompt, asking Claude to output only valid JSON.
  • B. Parse Claude's text response with regex patterns to extract JSON objects, using retry logic for malformed responses.
  • C. Make two separate API calls-first extracting information as text, then asking Claude to format that text as JSON.
  • D. Define a tool with an input schema matching your required JSON structure and extract the data from Claude's tool_use response.

Answer: D

Explanation:
A schema-defined tool provides a structured interface between Claude and the application. The tool's input_schema can declare required properties, nested work-experience and education objects, arrays of skills, and exact data types. Claude then supplies the extracted resume information as tool-call arguments, which the application can read directly from the tool_use response.
Anthropic's tool documentation specifies that a custom tool definition includes a JSON Schema object describing its expected parameters. Current strict tool use can additionally enforce that generated tool arguments match the declared schema exactly. This removes the need to locate JSON inside free-form text or depend on post-generation repair. ( https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/implement- tool-use ) Option A is fragile because regular expressions do not provide a robust parser for arbitrary nested JSON and cannot correct missing properties or incorrect types. Option B improves formatting behavior but remains probabilistic. Option C doubles latency and creates two opportunities for information loss: first during extraction and again during reformatting.
In a production design, fields that may genuinely be absent from a resume should be optional or nullable rather than forcing invented values. The tool schema should also use strict: true where supported. Among the available choices, D provides the strongest structural guarantee and the cleanest downstream integration.
Official references/topics: Tool Use Responses, Input Schemas, Strict Tool Use, Nested Structured Extraction.


NEW QUESTION # 38
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 tasked with adding real-time updates to the application. This could be implemented using WebSockets, Server-Sent Events, or polling, each with different complexity, browser support, and infrastructure requirements.
What's the most effective way to begin this task?

  • A. Use direct execution with a prompt asking Claude to analyze all approaches and implement the one it determines is best.
  • B. Start direct execution with WebSockets, then refactor if infrastructure issues arise.
  • C. Use direct execution to implement polling first, then evaluate whether to upgrade to WebSockets later.
  • D. Enter plan mode to explore the architecture, evaluate trade-offs, and present options for team approval before implementing.

Answer: D

Explanation:
The implementation approach is unresolved and carries architectural consequences. WebSockets, Server-Sent Events, and polling differ in connection lifecycle, bidirectional communication, proxy compatibility, scaling requirements, deployment topology, reconnection behavior, and operational complexity. Claude should therefore inspect the existing application and infrastructure before modifying code.
Anthropic recommends separating exploration and planning from implementation when the approach is uncertain, the work affects multiple files, or the developer is unfamiliar with the relevant architecture. In plan mode, Claude can read files and analyze the system without making changes, produce a detailed proposal, and allow the developer or team to review the plan before execution. ( https://code.claude.com/docs/en/best- practices ) Option A commits to polling before determining whether its latency and load characteristics meet the requirement. Option B delegates a consequential architectural decision and immediate implementation to a single execution step without a review checkpoint. Option D prematurely selects the most infrastructure- sensitive option and assumes later refactoring will be inexpensive.
Option C creates the correct sequence: examine the frontend and backend architecture, document requirements, compare alternatives, identify infrastructure constraints, obtain approval, and only then implement the selected design with appropriate tests and observability.
Official references/topics: Plan mode, explore-plan-implement workflow, architectural trade-off analysis, review checkpoints.


NEW QUESTION # 39
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.
1.5An engineer asks the agent to understand how the caching layer works before adding a new cache invalidation trigger. After initial Grep searches, the agent has identified that caching logic spans 15 files including decorators, middleware, and service classes (~6,000 lines total).
What's the most effective next step for building understanding while managing context constraints?

  • A. Use the Read tool to sequentially load all 15 files, building complete understanding across the full caching implementation.
  • B. Use Grep to search for "invalidate" and "expire" patterns across all files, then Read only those specific line ranges with minimal surrounding context.
  • C. Use Glob to find files matching common caching patterns ( cache*.py , caching/ ), prioritize the largest files by reading them first, then check smaller files for gaps.
  • D. Analyze imports and class hierarchies to identify the base cache class. Read that file to understand the interface, then trace specific invalidation implementations.

Answer: D

Explanation:
The correct objective is to construct an architectural map before consuming the full implementation.
Identifying the base cache abstraction, its interface, and the classes that implement or invoke it gives the agent a dependency-guided path through the code. It can then inspect only the invalidation implementations and integration points relevant to the proposed trigger.
This approach protects the context window. Anthropic states that every file read occupies context and that model performance can deteriorate as the window fills. Its Claude Code guidance warns against unbounded investigation that reads large numbers of files and recommends narrowing the exploration or delegating it. (
https://code.claude.com/docs/en/best-practices )
Option A is too lexical: searching only for invalidate or expire can miss event-driven invalidation, overridden methods, cache-key mutation, and generic interface calls. Option B loads approximately 6,000 lines without first establishing relevance. Option C assumes that filename patterns and file size correlate with architectural importance; the largest files may contain incidental code while a small interface defines the entire design.
Option D follows control and type relationships rather than arbitrary file order. After reading the base class, the agent can search for subclasses, imports, construction sites, middleware hooks, and calls to the invalidation contract, progressively expanding only where evidence requires it.
Official references/topics: Context-Efficient Exploration; Dependency-Guided Reading; Architectural Interfaces; Narrowly Scoped Investigation.


NEW QUESTION # 40
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.
After expanding the agent's MCP tools with delivery-specific capabilities (check_delivery_status, contact_driver, issue_credit, apply_promo_code, update_delivery_address, reschedule_delivery), the total tool count has grown from 4 to 10. Your evaluation suite shows tool selection accuracy has dropped from 88% to
71%. Log analysis reveals the majority of errors involve the agent selecting between semantically overlapping tools-calling issue_credit when process_refund was correct, and calling check_delivery_status when lookup_order already returns the needed data.
Which approach structurally eliminates the semantic overlap identified in the logs as the error source?

  • A. Enable the tool search tool with defer_loading on the six new tools, keeping the original four always loaded, so the agent dynamically discovers specialized tools only when needed.
  • B. Consolidate semantically overlapping tools-merge issue_credit and process_refund into a single resolve_compensation tool with an action parameter, and fold check_delivery_status into lookup_order with an optional include_tracking flag.
  • C. Add few-shot examples to the system prompt demonstrating correct selection for each ambiguous tool pair, such as showing when issue_credit applies versus when process_refund is appropriate.
  • D. Split the tools across two sub-agents-a "financial resolution" agent with process_refund, issue_credit, and apply_promo_code, and a "delivery operations" agent with the remaining delivery tools-with a coordinator routing between them.

Answer: B

Explanation:
Option B removes the ambiguity from the tool interface itself. The agent no longer needs to choose between separate functions that represent closely related business operations. Instead, a single compensation tool exposes an explicit action parameter, while the existing order lookup tool can optionally return delivery- tracking information through a clearly defined flag.
Anthropic's tool-design guidance recommends consolidating related operations into fewer, more capable tools when separate functions create unnecessary semantic overlap. Claude selects tools primarily from their names, descriptions, schemas, and the current task. When multiple tools appear capable of satisfying the same request, selection accuracy declines because the agent must infer distinctions that should have been made explicit in the interface design.
Option A adds routing complexity but leaves overlapping financial operations available within the same sub- agent. Option C reduces the number of tools loaded initially, but it does not eliminate the semantic duplication between compensation operations or overlapping lookup functions. Option D may improve behavior through examples, but it compensates for a poorly designed tool surface rather than correcting the root cause.
The consolidated schemas should use enums for supported actions, clearly define when each action applies, and document the returned fields. This creates a smaller and more deterministic agent-computer interface.
Official references/topics: Tool consolidation, semantic tool boundaries, action parameters, MCP tool- selection accuracy.


NEW QUESTION # 41
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 agent has spent 25 minutes exploring a game engine's rendering subsystem-reading shader code, buffer management, and frame synchronization logic. An engineer now asks it to understand how the physics engine integrates with rendering for collision debug overlays. You notice recent responses reference "typical rendering patterns" rather than the specific VulkanPipeline and FrameGraph classes it discovered earlier.
What's the most effective approach?

  • A. Use /clear to reset context completely, then start fresh with physics exploration using file paths from the project's CLAUDE.md.
  • B. Summarize key rendering findings, then spawn a sub-agent for physics exploration with that summary in its initial context.
  • C. Continue in the current context with more targeted prompts referencing the specific classes by name.
  • D. Spawn a sub-agent to explore physics independently, then manually synthesize its findings with the rendering knowledge accumulated in the main conversation.

Answer: B

Explanation:
The reference to generic rendering patterns indicates that the current context has become saturated or that important earlier details are no longer receiving sufficient attention. Anthropic documents that performance can degrade as a Claude Code context window fills with conversation history, file contents, and command output; symptoms include forgetting earlier instructions and making less precise responses. ( https://code.
claude.com/docs/en/best-practices )
Option C preserves the high-value rendering discoveries while isolating the physics investigation. The summary should identify the relevant rendering classes, synchronization boundaries, debug-overlay interfaces, and unresolved integration questions. A physics-focused subagent can then inspect collision and simulation code in its own context without adding dozens of additional files to the already crowded main conversation.
This explicit summary matters because an ordinary named subagent starts with a fresh, isolated context and does not automatically receive the parent's full conversation history or previously read files. Claude constructs a delegation message containing the task context, so the essential rendering findings must be supplied deliberately. ( https://docs.anthropic.com/en/docs/claude-code/sub-agents ) Option A omits the integration context needed to guide the physics search. Option B destroys useful prior analysis. Option D keeps expanding an already degraded context and treats the symptom rather than controlling context growth.
Official references/topics: Context-Window Management; Subagent Isolation; Delegation Summaries; Codebase Exploration.


NEW QUESTION # 42
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've asked Claude Code to build a PDF report generation feature. The initial implementation queries the database correctly, but the output has formatting issues: table columns are too narrow causing content truncation, dates display without proper formatting, and page break handling is incorrect. You've noticed these issues interact-changing column widths affects how dates render, and page breaks depend on content height.
What's the most effective approach for iterating toward a working solution?

  • A. Show Claude an example of a correctly formatted report and ask it to match that output, rather than listing the specific technical issues.
  • B. Address the column width issue first with specific measurements, verify it works, then fix date formatting within the corrected columns, then adjust page breaks-testing after each change.
  • C. Start fresh with a detailed prompt specifying all formatting requirements upfront.
  • D. Provide all three issues in a single detailed message with exact specifications for each, allowing Claude to address them together in one update.

Answer: B

Explanation:
The defects are coupled, so changing all three simultaneously would make it difficult to determine which modification caused an improvement or regression. Option C establishes a controlled sequence: correct the foundational column geometry, verify the resulting layout, format dates within the stabilized columns, and finally tune page breaks using the resulting content heights.
Anthropic recommends tight feedback loops and early course correction. It also advises supplying Claude with an executable or observable verification mechanism, such as a test, build result, generated fixture, or screenshot comparison. Claude can then make a focused change, inspect the output, and iterate until that specific condition is satisfied. ( https://code.claude.com/docs/en/best-practices ) Option A discards useful context from the functioning database implementation. Option B changes multiple interacting variables in one pass, making failures harder to isolate. Option D provides a useful visual target but does not replace precise technical constraints or incremental verification.
Each stage should have explicit acceptance criteria-for example, minimum column widths, expected date strings, and page-break fixtures using short and long content. Once a stage passes, its test becomes a regression guard for subsequent changes.
Official references/topics: Incremental Refinement; Tight Feedback Loops; Observable Verification; Regression Control.


NEW QUESTION # 43
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 # 44
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"} and process the enrichment requests in subsequent turns after receiving the extracted metadata.
  • 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 "auto" and reorder the tool definitions so extract_metadata appears first in the tools array, since Claude prioritizes earlier-listed tools.
  • D. 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.

Answer: A

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 # 45
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. 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.
  • B. 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.
  • C. 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.
  • D. Have Claude extensively research the algorithm and create a detailed implementation plan using extended thinking, then implement the complete solution based on that plan.

Answer: A

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 # 46
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 testing, you find that when a customer says "I need a refund for my recent purchase," the agent calls process_refund immediately-but populates the required order_id parameter with a plausible-looking but fabricated value instead of first calling lookup_order to retrieve the actual order ID. The refund call fails because the fabricated ID doesn't exist.
Which change directly addresses the root cause of the agent fabricating the order_id value?

  • A. Switch tool_choice from "auto" to "any" to force the agent to make a tool call on every turn.
  • B. Add server-side validation that checks whether the order_id exists in your database before executing the refund, returning an error to the agent if not found.
  • C. Pre-parse incoming customer messages to extract any order IDs mentioned, and inject them into the conversation context before passing to Claude.
  • D. Update the process_refund tool description to explicitly state that order_id must be obtained from a prior lookup_order call and must never be assumed or invented.

Answer: D

Explanation:
The root cause is an incomplete tool contract. Claude sees that process_refund requires an order_id , but the tool description does not explain the parameter's trusted source or the prerequisite lookup sequence. Option A makes the dependency explicit and prohibits fabricated values.
Anthropic states that tool descriptions should explain what a tool does, when it should be used, how it behaves, and any important limitations. Its prompting guidance also states that dependent tool calls must be executed sequentially and that Claude must never use placeholders or guess missing tool parameters. (
https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools ) Option B merely forces some tool use; it does not force the correct tool or prevent a fabricated identifier.
Option C is an essential defense-in-depth control, but it detects the invalid ID after the model has already made the faulty call. It does not correct the selection logic that caused the fabrication. Option D works only when the customer actually provides an identifier and introduces an unnecessary preprocessing dependency.
The process_refund schema should describe order_id as a verified identifier returned by lookup_order , and the tool description should state that the tool is unavailable until the corresponding order has been retrieved and eligibility established.
Official references/topics: Tool descriptions, prerequisite tool calls, parameter provenance, sequential tool orchestration.


NEW QUESTION # 47
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 added to Claude Code's tool registry alongside the server's tools, invoked automatically by the model when relevant to the task.
  • D. They are surfaced as @ -mentionable resources alongside files, fetched and attached to your message when referenced.

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 # 48
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. Read the library and wrapper modules to identify all exposed names for the function, then Grep for each name across the codebase.
  • C. Search for the function name in project documentation to understand intended usage patterns and navigate to documented integration points.
  • D. Use Grep to search for the function's original name across the codebase.

Answer: B

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 # 49
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. Return structured error responses with "retriable": false for business errors and a customer-friendly explanation for Claude to use.
  • D. Add few-shot examples showing how to distinguish retriable from non-retriable errors by parsing error message text.

Answer: C

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 # 50
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.
Monitoring shows 12% of extractions fail Pydantic validation with specific errors like "expected float for quantity, got '2 to 3'". Retrying these requests without modification produces identical failures.
What's the most effective approach to recover from these validation failures?

  • A. Pre-process source documents to standardize problematic formats before sending them for extraction.
  • B. Implement a secondary pipeline using a larger model tier to reprocess documents that fail validation.
  • C. Set temperature to 0 to eliminate output variability and ensure consistent formatting.
  • D. Send a follow-up request including the validation error, asking the model to correct its output.

Answer: D

Explanation:
An unchanged retry repeats the same task specification and therefore commonly reproduces the same invalid interpretation. The validator has generated precise corrective information- quantity requires a float, but the model returned the range string 2 to 3 . Supplying that error in a follow-up turn converts a generic retry into an iterative repair operation.
Anthropic identifies iterative refinement as a method for detecting and correcting inconsistencies by feeding an earlier output back into a subsequent request with targeted instructions. ( https://docs.anthropic.com/en/docs
/test-and-evaluate/strengthen-guardrails/reduce-hallucinations ) Option A applies that pattern directly. Claude receives the invalid output, the exact Pydantic error, and an instruction to return a schema-compliant correction. The application should cap retries, retain the original source, and escalate cases that cannot be represented without information loss.
Option B does not guarantee correct formatting; lower temperature may make the same wrong output more repeatable. Option C can be valuable for systematic OCR or source-format problems, but it is unnecessarily broad when the immediate failure is already described by the validator. Option D increases cost and complexity without first using the actionable feedback available from the existing validation layer.
For supported models, native Structured Outputs should also be considered because they guarantee schema- conformant JSON and can prevent many Pydantic shape failures before they occur. ( https://platform.claude.
com/docs/en/build-with-claude/structured-outputs )
Official references/topics: Iterative Refinement; Validation-Error Feedback; Bounded Retry Loops; Structured Outputs.


NEW QUESTION # 51
......

Pass Anthropic CCAR-F Actual Free Exam Q&As Updated Dump: https://www.dumpsvalid.com/CCAR-F-still-valid-exam.html