After deploying the automated review, you notice high precision but low recall---real bugs are slipping through undetected. Investigation reveals that your review prompt instructs Claude to ''only report high-confidence issues you are certain about'' and ''err on the side of not commenting.'' Developers appreciate the low noise, but a race condition that caused a production outage was visible in a reviewed pull request and went unreported. You need to substantially improve bug detection while keeping false-positive rates manageable. What is the most effective approach?
Answer : C
The prompt's conservative reporting policy is directly causing the low recall. Claude may discover a legitimate race condition during analysis but suppress it because it cannot satisfy the instruction to report only issues about which it is certain. Option C separates two objectives that should not be conflated: broad defect discovery and strict acceptance filtering.
Anthropic's current code-review prompting guidance explicitly recommends reporting every issue, including uncertain or lower-severity findings, assigning confidence and severity metadata, and allowing a separate verification stage to filter them. This maximizes recall while retaining control over developer-facing noise.
Option A leaves the suppression policy intact, so additional examples cannot guarantee that discovered problems will be reported. Option B improves recall but relies on historical category-level suppression, which can discard genuine findings that happen to belong to noisy categories. Option D can improve analysis quality but does not remove the instruction responsible for withholding findings. A dedicated finding stage followed by an independently configurable verification or thresholding stage produces measurable recall and precision controls without forcing one model call to optimize competing objectives.
================
You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JavaScript Object Notation (JSON) schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems.
Your extraction pipeline validates outputs against JSON schemas, but you need to implement human review given limited reviewer capacity (they can handle approximately 5% of total extraction volume).
What's the most effective basis for selecting which extractions to route for human review?
Answer : A
Limited review capacity should be concentrated on records with the highest probability of semantic error. Schema validation confirms that the response has the correct structure and data types; it does not establish that the extracted values are accurate. Ambiguous wording, contradictory passages, missing evidence, and model-reported uncertainty are direct indicators that an extraction requires human judgment.
Anthropic's reliability guidance recommends permitting Claude to express uncertainty, grounding factual outputs in source material, and validating critical information because hallucination-reduction methods do not eliminate errors completely. These principles support routing uncertain or evidentially conflicted records to reviewers rather than treating syntactically valid output as automatically trustworthy. (https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations)
Option B may waste reviewer capacity on clear, well-supported values while overlooking ambiguous errors in other fields. Option C is reactive: downstream acceptance does not guarantee semantic correctness, and silent errors may never produce processing failures. Option D provides an unbiased estimate of overall quality and should be retained as a secondary audit mechanism, but random selection is not the most efficient way to intercept risky records when only 5% can be reviewed.
In production, model confidence should not be treated as a calibrated probability by itself. It should be combined with objective signals such as contradictory source spans, missing citations, OCR quality, validation warnings, document type, and business impact.
Official references/topics: Human-in-the-Loop Review, Uncertainty Handling, Source Grounding, Risk-Based Escalation.
Your pipeline reviews approximately 200 database-migration scripts daily using the Message Batches API. Each request includes a shared 8,000-token system prompt containing migration-review guidelines and schema documentation, followed by an individual migration script. You added cache_control breakpoints to the shared system prompt in every request, but monitoring shows cache-hit rates of only 32%, with misses concentrated among requests processed later in the batch window. Which change addresses the root cause without adding sequential-processing latency?
Answer : D
Option D directly addresses cache entries expiring before later batch requests are processed. Anthropic's batch-processing documentation specifically notes that Message Batches can take longer than five minutes and recommends the one-hour prompt-cache duration for batches containing shared context. The prompt-caching documentation confirms that the default TTL is five minutes and that 'ttl': '1h' creates an extended entry.
Option A may improve cache locality, but it introduces the sequential-processing latency explicitly prohibited by the requirement. Option B seeds the cache initially, but the prewarmed entry still expires after five minutes unless the TTL is extended; it therefore does not solve misses among requests scheduled later. Option C places the breakpoint on request-specific content, defeating reuse of the stable 8,000-token prefix and attempting to cache scripts that are not byte-for-byte identical.
The system should retain the breakpoint at the end of the shared system content and apply the one-hour TTL there. Cache-usage fields should then be monitored to confirm that cache_read_input_tokens rises and later batch requests reuse the intended prefix.
================
You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JavaScript Object Notation (JSON) schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems.
Your extraction pipeline processes contracts that frequently include amendments. When a contract contains both original terms and later amendments (e.g., original clause specifies ''30-day payment terms'' while Amendment 1 changes this to ''45 days''), the model inconsistently extracts one value or the other with no indication of which applies.
What's the most effective approach to improve extraction accuracy for documents with amendments?
Answer : B
The document contains multiple factually valid values whose applicability depends on chronology and legal context. Collapsing those values into a single scalar field discards essential provenance. Option B corrects the data model by representing each term as a structured record containing the extracted value, source location, document or amendment identifier, and effective date.
Anthropic's Structured Outputs feature is designed for data-extraction use cases in which nested objects and arrays must conform to a defined JSON Schema. (https://platform.claude.com/docs/en/build-with-claude/structured-outputs) Anthropic also recommends grounding factual outputs in direct source material and making claims auditable through supporting evidence. (https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations) A provenance-aware schema applies both principles: it retains the original clause and the amendment instead of forcing Claude to resolve a potentially complex legal precedence question during extraction.
Option A is destructive because removing superseded text prevents auditing and may eliminate terms still relevant to earlier periods. Option C oversimplifies amendment logic; the newest document is not automatically controlling for every date, jurisdiction, or clause. Option D identifies risk but does not improve the extracted representation and unnecessarily sends all amendment cases to manual review.
After extraction, deterministic business logic can select the value effective on a requested date while retaining the complete contractual history.
Official references/topics: Structured Outputs; Nested Schema Design; Provenance and Source Grounding; Temporal Data Modeling.
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, and Glob---and integrates with Model Context Protocol (MCP) servers.
Your agent needs to insert a new helper function into the middle of a 150-line utility module, between two existing functions. The Edit tool fails because its old_string parameter cannot find unique text to match---the file has repetitive docstrings, variable names, and structural patterns.
What is the most reliable way to complete this insertion?
Answer : D
Option D is the closest match to Claude Code's documented editing procedure. The Claude Code tools reference explains that Edit performs exact string replacement and requires old_string to appear exactly once. When the text occurs multiple times, the prescribed response is to include sufficient surrounding context to identify one occurrence uniquely. For this insertion, the match should span a distinctive boundary between the preceding function and the following function. It does not literally need 30 lines; it needs the smallest exact block that is demonstrably unique, but option D is the only answer expressing that method.
Option A would modify every occurrence of a repeated pattern and could insert the helper function multiple times. Option B places the function at the end rather than at the required architectural location. Option C can technically work, but Write replaces the complete file and increases the change surface. Anthropic explicitly states that Write creates or overwrites full files, while partial modifications should use Edit. A targeted, uniquely anchored Edit preserves all unrelated content and produces a smaller, safer diff.
================
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?
Answer : D
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.
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?
Answer : D
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.