[Jul-2026] CCAR-F Dumps PDF - CCAR-F Real Exam Questions Answers [Q36-Q52]

Share

[Jul-2026] CCAR-F Dumps PDF - CCAR-F Real Exam Questions Answers

CCAR-F Dumps 100% Pass Guarantee With Latest Demo

NEW QUESTION # 36
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 codebase exploration tool stores session IDs to allow engineers to continue investigations across work sessions. An engineer spent an hour yesterday analyzing a legacy authentication module, building context about its architecture and dependencies. They want to continue today. The session ID is valid, but version control shows 3 of the 12 files the agent previously read were modified overnight by a teammate's merge.
What approach best balances efficiency and accuracy?

  • A. Resume the session without informing the agent about the changed files
  • B. Resume the session and immediately have the agent re-read all 12 previously analyzed files
  • C. Resume the session and inform the agent which specific files changed for targeted re-analysis
  • D. Start a fresh session to ensure the agent works with current codebase state without stale assumptions

Answer: C

Explanation:
Resuming preserves the prior architectural analysis, dependency mapping, and conversation history, avoiding the cost of repeating an hour of valid work. Anthropic states that resuming by session ID restores the agent's full prior context, including files read, analysis performed, and decisions made. ( https://code.claude.com/docs
/en/agent-sdk/sessions )
However, the session represents historical knowledge rather than a repository snapshot. Because three files changed externally, the agent must be told which files are affected and directed to re-read them before relying on earlier conclusions. Anthropic clarifies that sessions persist the conversation, not the filesystem. (
https://code.claude.com/docs/en/agent-sdk/sessions ) Targeted re-analysis updates the stale portion of the agent's model while retaining the nine unchanged files' established context.
Option A discards valuable work even though most of the analyzed code remains unchanged. Option C is accurate but inefficient because it reprocesses all twelve files regardless of whether they changed. Option D is unsafe: the agent may continue reasoning from obsolete function signatures, dependencies, or control flows.
The continuation prompt should identify the changed files, summarize the merge's purpose where known, and request a focused comparison against the earlier understanding. Any architectural conclusions affected by those changes should then be revised explicitly.
Official references/topics: Session Resume; Filesystem Versus Conversation State; Targeted Re-Analysis; Repository Change Awareness.


NEW QUESTION # 37
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.
Anthropic's tool use documentation states: "Write instructive error messages. Instead of generic errors like
'failed', include what went wrong and what Claude should try next." A billing dispute agent uses lookup_order , which catches all exceptions and returns a tool_result with is_error: true and the message
"Tool execution failed". Monitoring shows two failure modes: the agent retries the identical call until hitting the turn limit, or it immediately calls escalate_to_human without trying alternative tools.
Which change follows the documented recommendation and gives Claude the information it needs to select the correct recovery action for each error type?

  • A. Implement retry logic with exponential backoff inside each tool implementation so transient errors are resolved transparently within the tool before any failure result is surfaced to Claude in the agentic loop.
  • B. Remove is_error: true and return the error details as normal tool content, so Claude reasons about the response as data rather than treating it as a flagged failure condition that biases retry behavior.
  • C. Add an error classification step in the agentic loop that intercepts tool errors before Claude sees them, then routes to hardcoded retry or escalation logic.
  • D. Return error-type-specific messages with is_error: true , e.g., "Order not found-try get_customer to search by phone" for data errors and "Database timeout (transient)-retry should succeed" for infrastructure errors.

Answer: D

Explanation:
Option B preserves the formal failure indicator while making the returned content operationally useful.
Anthropic's tool-use guidance states that when a tool fails, the application should return the error through tool_result content and mark it with is_error: true . Claude can then use that information to retry with corrected input, seek clarification, or explain the limitation. ( https://docs.anthropic.com/en/docs/agents-and- tools/tool-use/bash-tool ) The two example messages identify both the cause and the appropriate recovery path. "Order not found" indicates that repeating the same identifier will not help and proposes an alternative lookup method.
"Database timeout" identifies a transient infrastructure condition for which a retry is reasonable. This eliminates blind repetition without removing Claude's ability to adapt.
Option A can be useful for tightly bounded low-level retries, but it does not solve permanent errors or tell the agent what happened after retries fail. Option C incorrectly disguises a failed operation as successful tool content. Option D moves semantic knowledge into hardcoded orchestration logic, making the system more rigid and duplicating information already known by the tool.
The most reliable tool interface combines the error flag, a stable error type, a retryability indicator, a concise causal explanation, and a recommended recovery action.
Official references/topics: is_error handling, instructive tool results, recovery guidance, resilient MCP tool design.


NEW QUESTION # 38
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 # 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.
An engineer asks your agent to identify untested code paths in a legacy payment processing module spanning
45 files. After reading the first 8 source files, the agent's responses are becoming noticeably less accurate-it' s forgetting previously discussed code patterns and hasn't yet located all test files or traced critical payment flows.
What's the most effective approach to complete this investigation?

  • A. Document all current findings in a summary report, clear context completely, then use that report as the sole reference for continuing the investigation.
  • B. Switch to using Grep to search for specific function names instead of reading full files, reducing the content loaded into context for remaining exploration.
  • C. Spawn subagents to investigate specific questions (e.g., "find all test files for payment processing,"
    "trace refund flow dependencies") while the main agent coordinates findings and preserves high-level understanding.
  • D. Clear context with /clear , then selectively re-read only the most critical files discovered so far, writing key findings to a scratchpad file that persists between context resets.

Answer: C

Explanation:
The investigation contains several bounded research questions that can be delegated independently: locating the complete test suite, tracing payment and refund flows, identifying conditional branches, and mapping external dependencies. Each subagent can read the relevant files in its own context and return a focused summary to the coordinating agent.
Anthropic recommends subagents for codebase exploration because extensive file reading rapidly consumes the main context window. Subagents isolate that volume and return only their conclusions, preserving the main conversation for synthesis and implementation. ( https://docs.anthropic.com/en/docs/claude-code
/common-workflows ) Anthropic also describes parallel research as appropriate when separate investigation paths can proceed independently and the main agent can synthesize the results afterward. ( https://docs.
anthropic.com/en/docs/claude-code/sub-agents )
Option B sacrifices the current conversational state and requires reconstruction after /clear . Option C may reduce token usage, but isolated text matches cannot reliably reveal full execution paths, indirect calls, or test coverage relationships. Option D converts the current analysis into a single lossy summary and risks omitting details needed later.
Option A directly addresses the demonstrated context degradation while retaining a high-level coordinating thread. The subagent prompts should be narrowly scoped and require concrete outputs such as file paths, uncovered branches, call-chain evidence, and existing tests associated with each flow.
Official references/topics: Subagent Context Isolation; Parallel Research; Context Preservation; Coordinated Codebase Analysis.


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

Answer: A


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.
A developer asks the agent to investigate why a specific API endpoint intermittently returns 500 errors. The codebase has 200+ files and the developer doesn't know which components are involved. The agent must trace the error through routing, middleware, business logic, and database layers.
What task decomposition approach would be most effective?

  • A. Define a fixed sequence of investigation steps upfront-grep for error patterns, then read error handlers, then check database queries, then examine middleware-executing each step regardless of intermediate findings.
  • B. Have the agent first create a comprehensive plan mapping all code paths through the endpoint before beginning any file exploration or code reading.
  • C. Run parallel worker agents that simultaneously investigate all four layers, then synthesize their findings to identify where the error originates.
  • D. Have the agent dynamically generate investigation subtasks based on what it discovers at each step, adapting its exploration plan as new information about the error path emerges.

Answer: D

Explanation:
The investigation path cannot be reliably predetermined because the responsible files, components, and execution sequence are unknown. The agent should begin with available evidence-such as route definitions, stack traces, logs, or endpoint references-and use each discovery to decide the next search, file read, or diagnostic action.
Anthropic distinguishes predefined workflows from agents that dynamically direct their own processes and tool usage. Agents are appropriate for open-ended problems where the required number and nature of the steps cannot be predicted or encoded as a fixed path. During execution, the agent should obtain ground truth from tool results and adapt its plan based on that environmental feedback. ( https://www.anthropic.com
/engineering/building-effective-agents )
Option A requires a comprehensive plan before the agent has inspected the code, so the plan would rest on unsupported assumptions. Option B forces every investigation through the same sequence even when an early discovery makes later steps irrelevant or identifies a different dependency path. Option C assumes the four layers can be investigated independently; tracing an intermittent request failure usually involves dependencies revealed sequentially across layers.
Option D implements an adaptive agent loop: inspect, form a hypothesis, use tools, evaluate the evidence, and generate the next subtask. The workflow should still include stopping conditions, testable hypotheses, and escalation when evidence remains inconclusive.
Official references/topics: Adaptive Agent Loops, Dynamic Task Decomposition, Tool Feedback, Open- Ended Coding Investigations.


NEW QUESTION # 42
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. Confirm the refund will be processed and close the conversation, since the system has all necessary information to complete it automatically.
  • B. Explain the billing, confirm refund eligibility, acknowledge the system issue preventing immediate processing, and offer escalation or retry later.
  • C. Implement automatic retries with exponential backoff for process_refund , keeping the conversation open until the refund is successfully processed.
  • 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 # 43
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. Configure plan mode as the default for code review sessions.
  • C. Create a /review slash command containing the checklist, invoked when starting reviews.
  • D. Create a dedicated review subagent with the checklist embedded in its configuration.

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 # 44
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 is configuring MCP servers in Claude Code. You want to add a shared venue lookup server that all team members should have access to, and you personally want to add an experimental music playlist server that only you are testing.
Which configuration approach correctly applies MCP server scopes?

  • A. Add the venue server to ~/.claude.json and the playlist server to .mcp.json .
  • B. Add both servers to your local ~/.claude.json .
  • C. Add both servers to the project-level .mcp.json file.
  • D. Add the venue server to .mcp.json and the playlist server to ~/.claude.json .

Answer: D

Explanation:
The venue server must be available to every project contributor, so it belongs at project scope. Claude Code stores project-scoped MCP configurations in the repository-root .mcp.json file, which can be committed to version control and shared with the team.
The experimental playlist server should remain private. Local-scoped MCP servers are stored under the current project's entry in ~/.claude.json , while user-scoped servers are also stored in ~/.claude.json but load across all projects. Because this server is described as a personal experiment, either private scope is conceptually appropriate; among the listed choices, option B correctly separates shared project configuration from private personal configuration. ( https://code.claude.com/docs/en/mcp ) Option A prevents the team from receiving the venue configuration. Option C reverses the intended visibility.
Option D exposes the experimental server configuration to other contributors and may commit machine- specific commands or credentials.
The preferred commands would specify --scope project for the shared venue server and --scope local for an experiment limited to the current repository. Project-scoped servers also require user approval before Claude Code activates configurations received through .mcp.json .
Official references/topics: MCP Installation Scopes; Project Scope; Local Scope; .mcp.json ; ~/.claude.json .


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

Answer: D

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 # 46
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. Ask Claude to interview you about the caching requirements before implementing, surfacing considerations like invalidation strategies, cache layers, consistency guarantees, and failure modes.
  • C. Write a specification with your known requirements and "TBD" markers for uncertain areas, having Claude propose solutions for each TBD as it implements.
  • D. 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.

Answer: B

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 # 47
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 used the agent yesterday to analyze a legacy authentication module, identifying two distinct refactoring approaches: extracting a microservice versus refactoring in-place. Today, they want to explore both approaches in depth-having the agent propose specific code changes for each-before deciding which to implement.
What's the most effective way to structure this exploration?

  • A. Resume yesterday's session to explore the first approach, then start a new session for the second, manually recreating the original context.
  • B. Start two fresh sessions, manually providing a summary of yesterday's analysis findings to establish context.
  • C. Resume yesterday's session and explore both approaches sequentially within the same conversation thread.
  • D. Use fork_session to create two branches from yesterday's analysis, exploring one approach in each fork.

Answer: D

Explanation:
Forking is specifically designed for exploring alternative directions from a shared body of prior analysis. Each fork starts with a copy of yesterday's conversation history, including the files read, architectural observations, dependency findings, and decisions already recorded. The microservice approach and the in-place refactoring approach can then develop independently under separate session IDs.
Anthropic's Agent SDK documentation states that a fork creates a new session from a copy of the original history while leaving the original session unchanged. Each resulting session can subsequently be resumed independently. The documented implementation combines resume with fork_session=True in Python or forkSession: true in TypeScript. ( https://code.claude.com/docs/en/agent-sdk/sessions ) Option B allows conclusions, assumptions, and proposed edits from the first approach to contaminate the evaluation of the second. Option C preserves context for only one branch and forces the engineer to reconstruct context manually for the other. Option D discards the detailed analysis already captured in the session and depends on potentially incomplete summaries.
Two forks provide equivalent starting conditions, preserve the parent investigation, and support a fair comparison of scope, migration risk, operational complexity, and required code changes. Filesystem edits should still be isolated through worktrees or checkpointing because session forking branches conversation history, not the working directory.
Official references/topics: Agent SDK Sessions; Session Forking; Alternative-Approach Exploration; Context Preservation.


NEW QUESTION # 48
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 infrastructure-as-code repository includes Terraform modules ( /terraform/ ), Kubernetes manifests (
/kubernetes/ ), and CI/CD pipeline scripts ( /pipelines/ ). Each requires different conventions, but your single root CLAUDE.md has grown to 500+ lines. When developers work on Kubernetes files, Terraform-specific rules load into context unnecessarily, consuming tokens.
What is the best approach to reorganize so only relevant guidance loads when editing specific file types?

  • A. Create files in .claude/rules/ with YAML frontmatter path-scoping (e.g., paths: ["terraform/**/*.tf"] ), loading rules only when editing matching files.
  • B. Split content into subdirectory CLAUDE.md files ( /terraform/CLAUDE.md , /kubernetes/CLAUDE.
    md ), so Claude loads directory-specific guidance.
  • C. Keep the root CLAUDE.md and use @path/to/import syntax to modularly include tool-specific guidance files from separate documents.
  • D. Restructure the root CLAUDE.md into clearly labeled sections with headers (e.g., "## Terraform Conventions"), improving organization and readability.

Answer: A

Explanation:
Path-scoped rules directly satisfy the requirement that instructions load only when Claude works with matching files. Each infrastructure domain can have a separate Markdown file under .claude/rules/ , with YAML paths frontmatter targeting Terraform files, Kubernetes manifests, or pipeline configuration.
Anthropic documents that .claude/rules/ keeps project guidance modular and supports conditional loading based on glob patterns. Rules with a paths field apply only when Claude works with matching files, reducing irrelevant context and token consumption. Rules without path frontmatter load unconditionally. ( https://code.
claude.com/docs/en/memory )
Option B improves readability but leaves all 500-plus lines in every session. Option C can provide directory- specific CLAUDE.md guidance, but path-scoped rules are more precise when conventions depend on extensions or patterns spanning multiple directories. Option D still requires manual imports and does not provide the documented conditional rule-loading mechanism.
A suitable design would use rules such as terraform.md scoped to terraform/**/*.tf , kubernetes.md scoped to kubernetes/**/*.{yaml,yml} , and pipelines.md scoped to the pipeline directory. Broad project-wide commands and repository etiquette can remain in the root CLAUDE.md.
Official references/topics: .claude/rules/ ; Path-Specific Rules; YAML Frontmatter; Context-Efficient Instruction Loading.


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.
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. Add few-shot examples to the prompt showing correct escalation behavior at various refund amounts ($400, $500, $600).
  • B. Modify the refund tool to return an error with message "Amount exceeds policy limit-please escalate" when the threshold is exceeded.
  • C. Strengthen the system prompt with emphatic language: "CRITICAL POLICY: Refunds over $500 MUST trigger human escalation. NEVER process these directly."
  • D. Implement a hook to intercept tool calls, when the refund process amount exceeds $500, block it and invoke human escalation.

Answer: D

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 # 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.
Your system extracts event metadata (date, location, organizer, attendee_count) from news articles using a JSON schema with all nullable fields. During evaluation, you observe the model frequently generates plausible but incorrect values for fields not mentioned in the article-for example, outputting "500" for attendee_count when the source contains no attendance information.
What's the most effective way to reduce these false extractions?

  • A. Make all schema fields required (non-nullable) with strict validation rules to ensure the model only outputs verifiable data.
  • B. Add a post-processing step using a second LLM call to verify each extracted value exists in the source document.
  • C. Upgrade to a more capable model tier with improved instruction-following to reduce hallucination tendencies.
  • D. Add prompt instructions to return null for any field where information is not directly stated in the source.

Answer: D

Explanation:
The schema already supports the correct representation of missing evidence: null . The remaining defect is behavioral. Claude must be explicitly instructed that absence of information is a valid outcome and that values may be populated only when directly supported by the supplied article.
Anthropic's hallucination-reduction guidance recommends explicitly permitting Claude to express uncertainty, grounding outputs in the source, and retracting claims that lack supporting evidence. It also recommends restricting the model to the provided documents rather than allowing unsupported external knowledge. ( https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations ) Option C translates those controls directly into the extraction contract: when no source evidence exists, the model returns null .
Option A may improve baseline performance but does not remove the architectural ambiguity that encourages completion of missing fields. Option B is counterproductive because non-nullable required fields force the model to provide values even when the article contains none. Structured validation would confirm that the response is syntactically valid while accepting fabricated content. Option D adds cost, latency, and another probabilistic model decision; a second model can repeat or endorse the original hallucination.
A robust implementation should supplement the instruction with source spans or quotations for populated fields and automated checks where feasible. Nevertheless, among the options, explicit null behavior is the direct and most effective correction.
Official references/topics: Reduce Hallucinations; External-Knowledge Restriction; Nullable JSON Schema Fields; Grounded Extraction.


NEW QUESTION # 51
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 track the number of tool calls made and exit the loop once a preconfigured maximum is reached.
  • B. 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.
  • C. 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.
  • D. You manually set the tool_choice parameter to "none" after the final expected tool call to force Claude to stop requesting tools.

Answer: C

Explanation:
The Messages API exposes stop_reason specifically so the application can determine why Claude stopped generating and what action is required next. A value of tool_use means Claude is requesting one or more tools and expects the application to execute them and return corresponding tool_result blocks. A value of end_turn means Claude has naturally completed the response. ( https://platform.claude.com/docs/en/build-with-claude
/handling-stop-reasons )
Anthropic's agent-loop tutorial implements this as a loop that continues executing tools and returning results while stop_reason remains tool_use . Once the value changes, the response is treated according to the new terminal or continuation condition. ( https://platform.claude.com/docs/en/agents-and-tools/tool-use/build-a- tool-using-agent ) Option A is unreliable because an assistant response can contain both text and tool-use blocks. Text alone does not prove that the workflow is complete. Option B requires the application to predict that no further tool call is needed, defeating Claude's ability to adapt from tool results. Option D is an important safety limit but is not the primary completion signal; an arbitrary maximum may terminate a valid workflow prematurely.
The harness should check stop_reason , process every requested tool call, append results to the conversation, and maintain a separate maximum-turn safeguard against runaway loops.
Official references/topics: Messages API stop reasons, tool-use loops, tool-result continuation, bounded orchestration.


NEW QUESTION # 52
......

Dumps Real Anthropic CCAR-F Exam Questions [Updated 2026]: https://pass4sure.passtorrent.com/CCAR-F-latest-torrent.html