Your automated code review is missing genuine bugs in pull requests. Investigation reveals that the review prompt includes this instruction: "Only flag critical issues that would definitely cause production failures. Ignore minor concerns and anything you are uncertain about." Developers confirm that some missed findings are genuine logic errors that the model investigated but chose not to report. The team requires the review output to remain structured, with every finding tagged with metadata, and actionable. Which prompt change both removes the cause of the suppressed findings and preserves structured, tagged output for downstream filtering?
Correct Answer: B
The prompt explicitly instructs Claude to suppress uncertain and lower-severity findings. Increasing reasoning depth cannot override that reporting policy: Claude may identify a real defect during analysis and still omit it from the final response. Option B separates comprehensive detection from acceptance filtering, removing the source of the false negatives while retaining metadata needed for automated decisions. Anthropic's current code-review prompting guidance recommends reporting every issue, including uncertain or lower-severity candidates, and attaching confidence and estimated severity so a separate verification or filtering stage can rank them. A structured schema can additionally require fields such as file path, line number, category, confidence, severity, evidence, and recommended action. Option A may improve investigation quality but leaves the suppression instruction intact. Option C removes the problematic threshold but also discards the explicit structured classification needed by downstream processing. Option D repeats the same review policy, so the second pass can suppress the same findings as the first. Option B preserves recall and machine-readable output while allowing deterministic, adjustable downstream thresholds. This is more reliable than embedding an overly restrictive acceptance decision inside the model's initial detection task.
Question 27
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 analyzed a complex service module-reading 23 source files, tracing request flows, and identifying error handling patterns. A developer wants to compare two testing strategies before committing to one: end-to-end tests with mocked external services vs. snapshot tests capturing expected outputs. They need to independently develop both approaches to evaluate trade-offs. How should you manage the sessions?
Correct Answer: A
Forking the existing analysis session creates independent continuations that inherit the accumulated conversation context. Each branch begins with the same understanding of the service module, request flow, source files, and error-handling patterns, but subsequent work on one testing strategy does not alter the other branch or the original session. Anthropic's Agent SDK documentation states that sessions can be resumed with their full context and forked to explore different approaches. In the SDK, enabling fork_session while resuming causes the continuation to receive a new session identifier rather than modifying the original session. ( https://docs.anthropic.com/en /docs/claude-code/sdk?utm_source=chatgpt.com ) Option B wastes time, tokens, and tool calls by requiring both new sessions to rebuild the same 23-file analysis. Option C mixes two experimental implementations into one conversation, increasing the risk that assumptions, edits, or conclusions from the first strategy influence the second. Option D preserves only a manually selected summary, which may omit details contained in the full session history. The appropriate design is to create one fork for the end-to-end strategy and another fork for the snapshot strategy. The original analysis remains a stable parent, while each child session develops and evaluates its approach independently. Official references/topics: Agent SDK Sessions, Session Forking, Context Preservation, Alternative- Approach Evaluation.
Question 28
After investigating a billing dispute for more than 25 turns, you determine that duplicate charges resulted from a payment-gateway timeout triggering retry logic. The required refund of $847 exceeds your $500 authorization limit, so you must invoke escalate_to_human. The human agent will not have access to the conversation transcript. What context should you pass to enable effective resolution?
Correct Answer: C
Option C gives the human agent the operational state required to continue without replaying a long conversation. The handoff should include verified identifiers, the duplicate transaction evidence, the diagnosed timeout-and-retry mechanism, the $847 refund requirement, the agent's $500 authorization constraint, completed verification steps, prior actions, and the recommended resolution. Any unresolved uncertainty should be labeled explicitly. Anthropic's effective context-engineering guidance recommends preserving high-value state in structured notes while removing redundant conversational and tool-call history. Its long-running-agent guidance likewise describes structured handoffs as the mechanism for maintaining continuity across context resets or agent boundaries. Option A maximizes raw information but forces the human to locate the relevant facts among more than 25 turns, increasing delay and error risk. Option B preserves evidence but omits the authorization constraint, completed verification, and explicit recommended action. Option D is too sparse to support validation or execution. A structured handoff balances fidelity and efficiency: it contains everything needed for the next actor to make the refund decision while excluding greetings, repeated explanations, and irrelevant intermediate tool output.
Question 29
You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JSON schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems. Your extraction system processes two document types: standard monthly reports, which are archived after processing, and urgent exception reports, which must trigger business alerts within 30 minutes of receipt. Both use the same JSON schema. You want to minimize API costs while meeting the latency requirements. How should you architect the processing pipeline?
Correct Answer: B
Option B correctly separates asynchronous bulk work from latency-sensitive operational work. Anthropic describes the Message Batches API as a cost-effective asynchronous service for high-volume requests that do not require immediate responses. Batch requests are processed independently, normally finish within an hour, may remain pending for up to 24 hours, and are billed at 50 percent of standard API prices. Those characteristics fit standard monthly reports because they are archived after processing and have no immediate business deadline. Urgent exception reports, however, must trigger an alert within 30 minutes. The batch service cannot guarantee that deadline, even if many batches finish quickly; a workload should not use typical completion time as a service-level guarantee. Routing exceptions through the synchronous Messages API provides the real-time response path needed for alerting, while the shared JSON schema keeps downstream records consistent across both routes. Option A knowingly permits delayed alerts. Option C introduces an hourly submission delay before processing even begins. Option D meets latency requirements but wastes the batch discount on non-urgent reports. A routing layer based on document priority therefore satisfies both the cost objective and the business deadline without changing the extraction contract.
Question 30
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?
Correct Answer: D
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.