CCA Prep / Exam Results
0%
0 correct out of 60 questions
Not yet — keep studying

Passing threshold: 75%

Performance by Domain

Agentic Architecture & Orchestration 0/17 (0%)
Tool Design & MCP Integration 0/12 (0%)
Claude Code Configuration & Workflows 0/13 (0%)
Prompt Engineering & Structured Output 0/9 (0%)
Context Management & Reliability 0/9 (0%)

Review — 60 questions to revisit

— Your structured data extraction pipeline processes 10,000 contracts per day using a main Claude Code session. For... Show
  A. Forks share the parent's prompt cache, so the 8,000-token legal taxonomy would be re-encoded separately for each forked worker, eliminating any cost savings.
✓ B. Forks inherit the main session's model and cannot be configured to use a different model, so the cost-optimized model cannot be applied to forked workers.
  C. Forks load the full conversation history into each worker's context, which inflates token usage as the main session grows longer throughout the day.
  D. Forks run with the same tool permissions as the parent session, preventing the extraction workers from being restricted to read-only document access.
Why B is correct: A fork inherits the model field from the parent session — it cannot be overridden at spawn time. Named subagents, by contrast, specify the model in their definition file, allowing each worker to be routed to a cheaper model like Haiku. When the architectural goal requires a different model than the parent, forks cannot satisfy that requirement regardless of their caching advantage. This is the principle that the caching benefit of forks is only relevant when the fork's other inherited properties (model, system prompt, tools) are acceptable — if any inherited property conflicts with the task's requirements, a named subagent is the correct choice.
— Your structured data extraction pipeline uses an MCP tool named `mcp__crm__write_record` to persist extracted... Show
  A. Change the hook's matcher from mcp__crm__write_record to an unscoped pattern so it fires for all tool calls, giving the agent more opportunities to intercept invalid data before a write is attempted.
✓ B. Add a systemMessage field to the hook's deny response that explains why the contract_id format is invalid and what a valid format looks like, so the agent receives actionable context and stops retrying.
  C. Replace permissionDecision: 'deny' with a post-processing step that silently drops invalid writes after they execute, so the agent receives a success response and does not attempt retries on the same record.
  D. Move the contract_id format validation out of the hook and into the system prompt, instructing Claude to validate all extracted fields before calling mcp__crm__write_record on any contract record.
Why B is correct: When a hook denies a tool call without a systemMessage, the agent receives a bare rejection with no explanation of why the operation failed or what to do instead. This leaves the agent in an ambiguous state where retrying the same call is a plausible recovery strategy. Adding systemMessage injects structured context directly into the conversation — naming the violation and specifying the valid format — so the agent understands the constraint and can take corrective action rather than re-issuing the same blocked call. The permissionDecision and systemMessage fields are designed to work together: permissionDecision enforces the constraint deterministically, while systemMessage provides the guidance needed to avoid re-triggering it.
— Your multi-agent research system uses Claude Code agent teams, each spawning five subagents to parallelize... Show
  A. Switch from five subagents to two subagents per team to reduce the number of active context windows, then rely on those agents to cover more topic areas per session.
✓ B. Strip the methodology, glossary, and communication norms from the spawn prompts and let CLAUDE.md carry that shared context, since teammates load it automatically at spawn time.
  C. Upgrade subagents from Sonnet to the most capable model so each agent completes its work faster, reducing the total wall-clock time that context windows remain open.
  D. Add an explicit instruction in each spawn prompt telling subagents to summarize and discard context aggressively after completing each subtask to reduce token accumulation.
Why B is correct: CLAUDE.md is loaded automatically by every spawned teammate — content it contains does not need to appear in the spawn prompt. Including shared context (methodology, glossary, norms) in the spawn prompt duplicates that content into each subagent's context window at initialization, multiplying the overhead by the number of agents. Removing the duplicated content from spawn prompts and relying on CLAUDE.md to carry it addresses the root cause: unnecessary token consumption at spawn time, not during task execution.
— Your team has deployed a developer productivity agent using the Claude Agent SDK. The agent automates file... Show
  A. Replace the synchronous compliance API call inside the hook with an asynchronous fire-and-forget pattern, logging validation results without blocking the agent from proceeding to the write operation.
✓ B. Increase the timeout value in the HookMatcher configuration to match the compliance service's latency, and use the AbortSignal from the callback's third argument to handle cancellation cleanly.
  C. Move the compliance validation logic from the PreToolUse hook into the system prompt, instructing the agent to self-validate file paths against compliance rules before issuing any write or edit tool call.
  D. Register a second PostToolUse hook that calls the compliance service after each write completes, rolling back any non-compliant file changes detected after execution has already occurred.
Why B is correct: The symptoms match a hook timeout: the hook consistently fails during the compliance API call, which takes 2–3 seconds and evidently exceeds the default timeout value in HookMatcher. The correct fix addresses the root cause directly — raising timeout in the HookMatcher configuration to match the observed latency of the external service, and using AbortSignal from the callback's third argument to clean up gracefully if cancellation does occur. This is the structural mechanism the SDK provides for exactly this failure mode, and it preserves the blocking, pre-execution enforcement that compliance requires.
— Your CI pipeline uses Claude to moderate user-submitted changelogs and release notes for policy violations before... Show
✓ A. Replace the flat category list with a dictionary mapping each category name to a detailed definition, and include both the name and its definition in the prompt so Claude evaluates against precise policy criteria rather than an ambiguous label.
  B. Add a secondary Claude pass that re-evaluates only the Specialized Advice category for any comment that initially passes, using a stricter system prompt focused exclusively on financial statements for that second pass.
  C. Increase the max_tokens budget for each moderation call so Claude has more room to reason through borderline edge cases before returning a violation verdict on financial statements.
  D. Instruct Claude in the system prompt to "be more conservative when evaluating financial statements" and route any ambiguous cases flagged by that instruction to a human reviewer before publication.
Why A is correct: The root cause is that category names alone are ambiguous — "Specialized Advice" does not tell Claude which specific types of financial advice are prohibited. Replacing the flat list with a category-to-definition dictionary embeds precise policy criteria directly in the prompt, giving Claude deterministic classification signal for borderline cases. The false-negative pattern disappears because Claude now has explicit criteria to match against, not just a label to interpret.
— Your CI pipeline uses Claude Code to auto-implement utility functions flagged by failing tests. Over the past two... Show
  A. Add a system prompt instruction telling Claude to be more rigorous and to carefully double-check its implementations before marking them complete.
✓ B. Provide concrete test cases inline with each request — exact inputs paired with expected outputs — and instruct Claude to run them after implementing.
  C. Increase the token budget for each implementation task so Claude has additional room to reason through edge cases before producing its final output.
  D. Add a second Claude Code pass that reviews the first implementation and flags any logic it considers likely to fail in the test suite.
Why B is correct: Claude performs better when it can check its own work against concrete, verifiable criteria. Providing explicit test cases — exact inputs paired with expected outputs — gives Claude a deterministic feedback loop: it can run the tests, observe pass/fail signals, and iterate until the criteria are met. This converts an open-ended generation task into a constrained verification loop, addressing the root cause (no grounding signal) rather than hoping Claude self-corrects through more careful reasoning.
— Your structured data extraction pipeline uses background subagents to process contracts in parallel — each subagent... Show
  A. Add a system prompt instruction telling the extraction subagents to skip any contract that requires external classification lookups and flag it for manual review instead.
✓ B. Enumerate the classification API tool in the background subagent's pre-approved tool set before launch, so the permission is granted upfront and the subagent can call it without interruption.
  C. Switch all extraction subagents from background to foreground mode so they can surface interactive permission prompts when the classification API tool is needed mid-run.
  D. Catch the failed subagent runs at the orchestrator level and automatically retry them with a higher maxTurns value to give each subagent more attempts to resolve the permission issue.
Why B is correct: Background subagents require all tool permissions to be granted upfront before launch — once running, they auto-deny any tool call not in the pre-approved set. Because the classification API was not pre-approved, those tool calls fail silently and the subagent continues without the data it needs, producing no output. The fix is to include the classification API tool in the subagent's declared tool set so permissions are resolved at launch time, not mid-run. This is a structural configuration fix: the permission boundary is defined in the subagent definition, not inferred at runtime.
— Your Claude Code CI pipeline automatically runs tool-returned shell commands against a staging environment as part... Show
  A. The CI pipeline's context window is too small, causing Claude to hallucinate shell commands to fill gaps in its reasoning about the build state.
✓ B. Tool results from the external API are passed to the execution environment without validation, allowing executable content embedded in the returned strings to run as commands.
  C. Claude's system prompt lacks an explicit instruction prohibiting environment modifications, so Claude freely interprets tool output as authorized commands and acts on it.
  D. The external API is returning results in an unsupported format, causing Claude to switch to a fallback behavior that executes arbitrary commands to resolve the ambiguity.
Why B is correct: Tool results are returned as strings and can contain any content — including executable commands — that may be processed by the execution environment. When a pipeline passes tool output directly to an execution layer without validation, any shell commands embedded in that string can run with the pipeline's permissions. The fix is to validate and sanitize external tool results before they are interpreted or executed, breaking the injection path at the boundary where untrusted external data enters the trusted execution environment.
— Your team has been building a structured data extraction platform for six months. Three separate Skills have been... Show
✓ A. Run evaluations against the consolidated contract-processing Skill and confirm it achieves equivalent performance to each of the three individual Skills it replaces before deploying it to production.
  B. Audit the consolidated Skill's SKILL.md and all bundled scripts for adversarial instructions, hardcoded credentials, and unauthorized network calls before merging the three Skills.
  C. Increase the token budget for the consolidated Skill to ensure it has sufficient context to handle the combined logic of all three individual Skills in a single pass.
  D. Survey the extraction team to confirm that all three Skills are used together in every workflow before consolidating, so the merged Skill doesn't bundle unused capabilities.
Why A is correct: The principle of "consolidate later, when evals confirm equivalent performance" establishes that high individual evaluation scores do not guarantee a consolidated Skill will perform equivalently. Skills can interfere with each other when bundled — instructions may conflict, tool scope may broaden in unexpected ways, or the model's attention may be diluted across combined responsibilities. The merge decision must be gated on evaluation results for the consolidated Skill itself, not inferred from the components' individual scores. This is a structural quality gate, not a prompt or infrastructure change.
— Your structured data extraction pipeline processes batches of 500 legal contracts per week across multiple agent... Show
  A. Expand the system prompt to include a comprehensive summary of all known field patterns, validation rules, and schema refinements discovered to date, updating it manually before each new session starts.
✓ B. Bootstrap a structured memory file at session start that captures discovered field patterns, validation edge cases, and schema refinements, then instruct the agent to update this file at session end so each new session loads it as its first action.
  C. Increase the context window allocation so the agent can hold all prior session outputs in active context simultaneously, eliminating the need for a separate external persistence mechanism entirely.
  D. Require operators to paste a structured session summary into the first user turn of each new session so the agent can fully reconstruct the necessary extraction context before beginning work.
Why B is correct: The memory tool's just-in-time context retrieval pattern solves this problem structurally: by bootstrapping a memory file at session start and committing discoveries back to it at session end, each session begins with exactly the context it needs without operator intervention. This turns memory into a structured recovery mechanism — the core purpose of the multi-session software development pattern — keeping active context focused on what is currently relevant rather than bloated with accumulated history.
— Your CI pipeline uses a multi-agent Claude Code setup where a parent orchestrator spawns subagents to run parallel... Show
  A. Increase the subagents' token budget by setting a higher max_tokens limit so they have more room to process the inherited tool definitions alongside the analysis tasks.
  B. Run /compact on the parent session before spawning subagents so that the summarized conversation history passed to each subagent is shorter.
✓ C. Disable the 7 unused MCP servers in the parent session with /mcp disable <name> before spawning subagents, so their tool definitions are not inherited by each subagent.
  D. Move the orchestrator's CLAUDE.md instructions into path-scoped rules so that subagents load only the instructions relevant to their assigned service module.
Why C is correct: Subagents inherit every MCP tool definition from the parent session. With 9 MCP servers registered, each subagent's context window is pre-filled with tool definitions before any task input is added — and the error occurs on the first turn, confirming the problem is inherited overhead, not accumulated conversation. Disabling unused MCP servers removes that overhead at the source, which is where the context pressure originates.
— Your team has deployed Claude Code to automate a nightly CI job that generates implementations for a suite of... Show
  A. Add a post-generation review step where a second Claude instance inspects each solution for hardcoded values and literal test-input matches, flagging violations before the code is merged into the main branch.
  B. Increase the token budget for the generation step so Claude has significantly more reasoning space to work through general algorithms and explore alternative implementation strategies before committing to a final solution.
✓ C. Embed explicit orchestration instructions — evaluated before code executes — that require general-purpose logic, mandate use of standard tools, prohibit hardcoded values and helper scripts, and direct Claude to report infeasible tasks rather than work around them.
  D. Route the 30% of solutions that fail production validation to a dedicated human reviewer who can identify and rewrite the hardcoded sections, while allowing the passing solutions to continue through the pipeline automatically.
Why C is correct: The root cause is that the agent's default optimization target — passing tests — is misaligned with the actual goal of producing generalized solutions. The fix is to redirect the agent's behavior at the source, before generation, by providing explicit orchestration criteria: implement general logic, use standard tools directly, prohibit workarounds, and escalate rather than circumvent infeasible tasks. This is a structural intervention at the orchestration layer that shapes every generation pass, not a downstream review that reacts to problems after they occur. Explicit behavioral criteria applied prospectively are more reliable than probabilistic post-hoc review.
— Your team uses Claude Code in developer scripts to automate one-off tasks like summarizing changelogs and generating... Show
  A. Add an explicit system prompt instruction to the claude -p call telling Claude to ignore any locally configured hooks or plugins during script execution.
  B. Require each developer to clear their ~/.claude directory before running shared scripts so no personal configuration interferes.
✓ C. Switch the scripts to use claude --bare -p so that auto-discovery of hooks, MCP servers, CLAUDE.md, and plugins is skipped, and only explicitly passed flags take effect.
  D. Move all shared MCP server and hook configuration into the project's .mcp.json so every developer loads the same set of servers from the project root.
Why C is correct: --bare disables auto-discovery of all environment-specific configuration — hooks, MCP servers, plugins, CLAUDE.md, and auto memory — meaning the script's behavior is determined solely by the flags explicitly passed at the call site. This eliminates the source of divergence: each developer's personal ~/.claude and project-level .mcp.json are never consulted. The fix addresses the root cause structurally rather than relying on developer discipline or instructions to Claude.
— Your CI pipeline uses the Claude Agent SDK to automatically fix failing tests. The integration invokes `query()`... Show
  A. Increase max_turns from 30 to 60 so the agent has sufficient headroom to complete the most complex debugging tasks it currently abandons before finishing.
✓ B. On receiving subtype: "error_max_turns", capture the session_id from the ResultMessage and resubmit as a resumption with an additional turn budget, preserving the agent's intermediate progress rather than discarding it.
  C. Add a post-run prompt instruction in CLAUDE.md directing the agent to prioritize applying fixes before exhausting its turn budget, so fewer pipeline runs reach the limit and get discarded.
  D. Switch effort from "high" to "low" so the agent uses fewer turns per reasoning step, reducing the probability of hitting the turn limit before completing the fix on complex debugging tasks.
Why B is correct: The ResultMessage on error_max_turns exposes the session_id precisely to support resumption — the agent loop preserves intermediate context (files read, edits made, test results observed) inside the session. Resuming with the captured ID continues from where the loop stopped rather than restarting cold, which is the mechanism designed for this failure mode. This preserves the safety value of the turn limit (preventing runaway sessions) while recovering from legitimate mid-task interruptions.
— Your structured data extraction pipeline processes 1,200 insurance claim documents per night using a... Show
  A. Increase max_tokens on the extraction request to ensure Claude has enough room to complete the full JSON parameter before the stream terminates, eliminating truncation at the source.
  B. Disable eager_input_streaming on the extract_claim_fields tool so the API buffers and validates the complete parameter before streaming, eliminating mid-stream truncation at the cost of higher latency.
✓ C. Add specific handling for the max_tokens stop reason: wrap the accumulated partial JSON in a structured error object (e.g., {"INVALID_JSON": "<partial>"}) and return it to Claude as an error tool result so Claude can recover with a corrective pass.
  D. Switch the accumulation logic to parse the JSON incrementally on each input_json_delta event rather than waiting for content_block_stop, so partial fields can be extracted before truncation occurs.
Why C is correct: Fine-grained streaming explicitly does not guarantee a valid JSON string when max_tokens is reached — the stream may end mid-parameter. The documented pattern for this failure mode is to detect the max_tokens stop reason, wrap the incomplete fragment in a structured error object ({"INVALID_JSON": "..."}) so Claude can reason about what went wrong, and feed it back as an error tool result for a recovery pass. This addresses the root cause at the point of failure rather than silently skipping documents or removing the capability responsible for latency improvements.
— Your structured data extraction pipeline processes a corpus of 50,000 legal contracts in long-running agent... Show
  A. The extraction schema's required fields create token overhead that compounds across documents, eventually exceeding the per-call output limit.
✓ B. Sessions lacking context awareness cause Claude to continue processing as if full capacity remains, leading to abrupt truncation when the context window is exhausted near its boundary.
  C. The legal documents in the final 20% are structurally more complex, requiring more tokens per extraction and causing the model to exceed its response budget.
  D. The pipeline's tool call loop accumulates system_warning messages in the conversation history, diluting attention on the extraction schema by the late-session documents.
Why B is correct: Context awareness — the mechanism by which Claude Sonnet 4.5+ models receive explicit <budget:token_budget> and <system_warning> updates on remaining capacity — solves exactly this failure mode. Without it, a model "competes without a clock": it has no signal that capacity is nearly exhausted and cannot adjust behavior (prioritizing, checkpointing, or surfacing a graceful handoff) before the window fills. The clustering of failures in late-session documents is the diagnostic signature of a model that doesn't know when it's running out of room. The fix is architectural: use a model with context awareness or design the agent harness to emit explicit token budget signals so the model can adapt before truncation occurs.
— Your structured data extraction pipeline uses a library of 120+ registered Skills. A post-deployment audit reveals... Show
  A. The PDF Contract Extraction Skill's SKILL.md implementation section is too detailed, causing Claude to deprioritize it during discovery in favor of simpler, more concise Skills.
✓ B. The PDF Contract Extraction Skill's description field omits specific trigger terms and use-case context, so Claude cannot reliably distinguish it from the general-purpose Skill when selecting among 120+ candidates.
  C. The general-purpose Skill is registered earlier in the Skill library, giving it positional priority during Skill selection when multiple descriptions overlap in scope.
  D. The system prompt lacks an explicit instruction to prefer specialized Skills, so Claude defaults to the most broadly applicable Skill rather than the purpose-built one for PDF contracts.
Why B is correct: Skill selection among a large catalog depends entirely on the description field — it is the sole mechanism Claude uses to identify which Skill to invoke. With 120+ Skills, an insufficiently specific description ("Processes data") makes the correct Skill indistinguishable from semantically adjacent Skills. The fix is to include concrete trigger terms and use-case context (e.g., "Extract text, signature blocks, and clause tables from PDF contracts. Use when processing contract PDFs, legal documents, or when the user mentions signatures or clause extraction") so Claude can unambiguously differentiate this Skill at selection time.
— Your team uses the Claude Code SDK to run long-running developer sessions that span dozens of tool calls — reading... Show
  A. Add a PreCompact hook that archives the full transcript before compaction occurs, then injects the archived transcript back into the next session's initial prompt.
✓ B. Add a section to the project's CLAUDE.md specifying that the compactor should always preserve the current task objective, acceptance criteria, and any architectural decisions made during the session.
  C. Move the acceptance criteria and refactoring constraints into the initial prompt of each session, making them the most prominent context for Claude at the start of each conversation.
  D. Trigger manual compaction via /compact before the context window fills, so that developers can time compaction to occur at a natural break point rather than mid-refactor.
Why B is correct: CLAUDE.md content is re-injected on every request, meaning it survives compaction — the compactor itself reads CLAUDE.md when generating the summary. Adding explicit summarization instructions to CLAUDE.md directly controls what the compactor preserves (acceptance criteria, decisions, file paths), addressing the root cause: important instructions placed only in early conversation history are not guaranteed to survive compaction.
— Your team has deployed a Claude-based developer productivity assistant that uses a memory tool to persist project... Show
  A. Increase the token budget allocated to the memory read call so Claude can process larger file contents without hitting truncation errors on any single invocation.
✓ B. Enforce a maximum return size on the memory read command and implement pagination, so Claude retrieves a bounded portion of memory per call and fetches additional pages only as needed.
  C. Add a system prompt instruction telling Claude to skip reading memory files that are unlikely to be relevant to the current task, relying on file names to judge relevance before reading.
  D. Archive old memory files into a compressed backup and require developers to manually delete obsolete entries whenever the assistant's startup latency becomes unacceptable.
Why B is correct: The root cause is unbounded memory file growth causing both latency and context bloat. Enforcing a maximum return size with pagination is a structural mechanism applied at the tool layer — it caps how much data floods into context on any single call, while pagination preserves full access when genuinely needed. This addresses the problem at its source (the tool interface) rather than relying on model judgment or manual intervention.
— Your team has built a developer productivity agent using the Claude Agent SDK. The agent is configured with three... Show
  A. The three MCP servers are using incompatible transport types; mixing HTTP and local process transports prevents Claude from discovering available tools across servers.
✓ B. The allowedTools field is missing or not configured for the MCP servers, so Claude can see the tool definitions but is not permitted to call them.
  C. The system prompt does not explicitly instruct Claude to prefer MCP tools over built-in capabilities, so Claude defaults to its internal knowledge instead of invoking external tools.
  D. The agent's context window is saturated by the tool schemas from three MCP servers, causing Claude to skip tool selection and generate a direct response.
Why B is correct: The allowedTools field is a required permission gate in the Claude Agent SDK — it is not inferred from the presence of configured MCP servers. When allowedTools is absent, Claude sees the tool definitions but lacks permission to invoke them, producing exactly the observed symptom: confirmed server connectivity with zero tool calls. The fix is to add allowedTools entries such as "mcp__github__*", "mcp__jira__*", and "mcp__internal-docs__*" (or a wildcard pattern) for each server. This is a structural permission mechanism, not a prompt instruction.
— Your CI pipeline uses an executor model with the advisor tool enabled for code change validation tasks.... Show
  A. Add a system prompt instruction telling the executor to retry the advisor call if no response is received within a defined timeout window, ensuring advice is eventually received before the pipeline continues.
  B. Restructure the executor system prompt so that the completion-check advisor call is made before writing files, giving the advisor a chance to approve the overall approach before any changes are persisted to disk.
✓ C. Restructure the executor system prompt so that deliverables are written, saved, and committed before the completion-check advisor call, ensuring durable artifacts exist before any session-ending latency occurs.
  D. Increase the session timeout threshold in the CI environment so that long-running advisor inference passes have sufficient time to complete before the pipeline is terminated by the orchestration layer.
Why C is correct: The advisor tool documentation explicitly prescribes making deliverables durable — writing the file, saving the result, committing the change — before the completion-check advisor call. The principle is that the advisor call introduces latency during which the session may end; durable artifacts survive a session termination while in-memory or unwritten results do not. This is an ordering constraint in the orchestration protocol, not a timeout or approval issue.
— Your CI pipeline uses Claude Code to automatically triage test failures: for each failing test, an agent calls a set... Show
  A. The agent's tool descriptions are too long, consuming input tokens that should be reserved for output; shorten the tool descriptions so the model has more room to generate complete responses and tool use blocks are no longer truncated mid-execution.
✓ B. The agent loop does not inspect stop_reason before treating a response as complete; when output is truncated mid-tool-use-block, the agent must detect stop_reason: "max_tokens" and treat that invocation as a hard failure requiring retry or escalation — not silently advance to the next item.
  C. The pipeline is processing too many failures concurrently, causing resource contention that limits how many tokens each individual response can use; reducing batch size and serializing requests will give each invocation its full token budget and prevent truncation.
  D. The diagnostic tools are returning excessively verbose output that fills the context window before Claude can emit a complete tool use block; summarizing tool outputs before passing them back to the agent will free up space for Claude to finish generating its response.
Why B is correct: When a response stops with stop_reason: "max_tokens" and contains an incomplete tool use block, the tool invocation did not complete — the agent received a partial, unusable result. The correct architectural response is to inspect stop_reason on every API response and treat max_tokens with an incomplete tool use block as an explicit failure signal, not a successful response. Silently advancing is a silent error suppression pattern: the pipeline hides the failure instead of surfacing it. The fix is structural — the agent loop must branch on stop_reason before processing tool call results, then retry or escalate to human review.
— Your Claude Code integration generates function implementations by issuing tool-use requests. Overnight batch jobs... Show
  A. The tool schema is missing required fields, causing Claude to abandon the tool_use block before completion.
✓ B. The max_tokens limit is being reached mid-response, truncating the tool_use block before Claude can close it, producing an unusable partial output that the pipeline treats as a success.
  C. The pipeline is misreading a valid end_turn response as a success when the actual content is empty, masking a prompt construction error.
  D. Claude is returning a text block instead of a tool_use block because the system prompt and tool description are ambiguous, and the pipeline does not validate the content type before proceeding.
Why B is correct: When stop_reason is max_tokens, Claude's response generation was cut short by the token budget — it did not finish naturally. If the truncation occurs inside a tool_use block, the block is structurally incomplete and cannot be parsed or executed. The API call itself succeeds (HTTP 200, no error), so a pipeline that only checks for API-level errors will silently record a success while discarding the unusable partial output. The diagnostic signal (stop_reason: "max_tokens" + incomplete tool_use block) uniquely identifies this cause. The fix is to detect stop_reason: "max_tokens" explicitly and retry with an adequate token budget, not to ignore the stop reason.
— Your team uses Claude Code's Remote Control feature to allow developers to start long-running code generation tasks... Show
  A. The ultraplan session exhausts the token budget reserved for Remote Control, causing a timeout. The fix is to increase --capacity so the server can handle both sessions simultaneously.
✓ B. Both ultraplan and Remote Control compete for the single claude.ai/code interface, and only one can be connected at a time. The fix is to complete or pause Remote Control review before starting an ultraplan session, treating them as mutually exclusive workflows.
  C. The network drop from switching apps causes the Remote Control process to exit after the 10-minute outage threshold. The fix is to keep the local claude process alive by pinning it in a background terminal multiplexer.
  D. The /remote-control command on VS Code does not support concurrent session features. The fix is to re-launch with claude remote-control server mode and set --spawn=session so a dedicated session is reserved for the developer.
Why B is correct: Ultraplan and Remote Control both occupy the claude.ai/code interface, and only one can be active at a time — starting an ultraplan session unconditionally disconnects any active Remote Control session. This is a hard architectural constraint, not a configuration problem. The correct response is to treat the two modes as mutually exclusive: finish or checkpoint the Remote Control review before entering ultraplan, rather than trying to run them concurrently. No server flag, capacity setting, or process-management change alters this constraint.
— Your CI pipeline uses Claude Code with a catalog of 400 tools covering linting, testing, security scanning,... Show
  A. Increase max_tokens to ensure Claude has enough room to process all 400 tool definitions before selecting the appropriate one.
✓ B. Enable tool search so Claude dynamically discovers and loads only the tools relevant to each CI step rather than loading all 400 definitions upfront.
  C. Add a system prompt instruction telling Claude to prefer specific, purpose-named tools over generic alternatives whenever both are available.
  D. Consolidate the 400 tools into broader, multi-purpose tools so fewer definitions are loaded into context at once.
Why B is correct: Tool selection accuracy degrades with more than 30–50 tools loaded simultaneously. With 400 tools in context, Claude cannot reliably distinguish between closely related tools. Tool search addresses this at the architectural level — instead of presenting all 400 definitions upfront, the agent searches the catalog and loads only the tools needed for the current step, keeping the active set within the range where selection is reliable. This solves both the attention problem (fewer definitions to reason over) and the context efficiency problem (tool definitions can consume 10–20K tokens for just 50 tools).
— Your team has built a CI pipeline that invokes `claude -p` as a subprocess to auto-generate test scaffolding for... Show
  A. The defer mechanism requires Claude Code v2.1.89 or later, and CI environments typically pin to an older version to ensure reproducibility, so the hook result is silently ignored and the tool proceeds through the normal permission flow.
✓ B. When Claude makes multiple tool calls in a single turn, defer is ignored with a warning and the tool proceeds through the normal permission flow, leaving AskUserQuestion undeferred and the headless session hanging as before.
  C. The defer mechanism only works in interactive terminal sessions; in non-interactive -p mode the hook result is silently discarded, so the AskUserQuestion call executes immediately and the pipeline hangs waiting for terminal input.
  D. The cleanupPeriodDays retention sweep will delete the session before the CI pipeline can resume it, because the default 30-day window does not protect sessions that have been idle for more than a few hours between CI stages.
Why B is correct: The defer mechanism has an explicit architectural constraint: it only works when Claude makes a single tool call in the turn. If Claude issues multiple parallel tool calls in the same turn, defer is ignored with a warning and the tool proceeds through the normal permission flow. Because the failing runs show AskUserQuestion batched alongside Read calls, returning "defer" from the hook will be silently bypassed, the AskUserQuestion will proceed to execution, and the headless session will hang as before. The fix must address this batching behavior — either by constraining Claude to sequential tool calls or by intercepting AskUserQuestion with a "deny" and injecting a default answer.
— You've built a Claude Code–based automated code review agent that uses extended thinking with tool use. The agent... Show
  A. The agent is using tool_choice: {"type": "tool", "name": "run_tests"} to force the first tool call, which is incompatible with extended thinking and silently corrupts the reasoning chain.
✓ B. The agent is stripping thinking blocks from previous assistant messages before sending them back to the API, breaking reasoning continuity across tool call turns.
  C. The budget_tokens value is set below max_tokens, which prevents Claude from completing its reasoning about tool results before generating the summary.
  D. The agent is not using interleaved thinking, so Claude only reasons once at the start and cannot incorporate intermediate tool results into its thinking when producing the summary.
Why B is correct: When using extended thinking with tool use, the complete, unmodified thinking blocks from each assistant turn must be passed back to the API in subsequent turns. Omitting them breaks reasoning continuity — Claude loses the chain of intermediate reasoning that informs how it interprets tool results. The symptom (misinterpreting test results, ignoring coverage gaps) is a direct consequence of Claude reconstructing its reasoning from scratch on each turn without access to its prior thinking context. This is not a prompt or configuration issue; it is a structural data-flow requirement for maintaining coherent multi-turn reasoning.
— Your team uses a shared monorepo where Claude Code is typically launched from the repository root. A senior engineer... Show
  A. The hooks in /repo/libs/shared/.claude/hooks/ require CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 to be set before they are discovered from --add-dir paths.
✓ B. Hooks are not loaded from --add-dir directories; --add-dir grants file access only, and hooks are discovered exclusively from the working directory hierarchy and ~/.claude/.
  C. The hooks are scoped to the shared library subdirectory, so Claude only triggers them when a file write targets a path inside /repo/libs/shared, not when launched from the repo root.
  D. Claude Code requires hooks to be defined in the root ~/.claude/settings.json to fire during file modification; per-project .claude/hooks/ directories are not supported.
Why B is correct: The --add-dir flag extends the file paths Claude can read and edit — it does not make the added directory a full configuration root. Hooks (along with subagents, commands, output styles, and most other settings) are discovered only from the current working directory and its parents, plus ~/.claude/. Because the team launches Claude from /repo and the hooks live in /repo/libs/shared/.claude/hooks/, those hooks are never discovered regardless of --add-dir. The fix is to either move the hooks to the repo root .claude/hooks/, place them in ~/.claude/ for user-level availability, or launch Claude from /repo/libs/shared when working on that library.
— Your team is building a contract analysis pipeline that must both verify claims against source documents (for... Show
✓ A. Citations interleave citation blocks with text output, which cannot conform to a strict JSON schema; the two requirements must be served by separate API calls — one citations-enabled call for auditor review, one structured-output call for the CRM.
  B. The output_config.format parameter conflicts with PDF-type documents specifically; switching the contracts to plain-text document blocks will allow citations and structured outputs to coexist in the same request without a 400 error.
  C. Citations are only incompatible with nested JSON schemas; flattening the CRM schema to a single-level object will eliminate the 400 error while still allowing citation blocks to appear in the response alongside the output.
  D. The 400 error is triggered by exceeding a document block limit when citations are enabled; splitting the contracts across smaller batched requests will allow both citations and structured outputs to be used together successfully.
Why A is correct: Citations require interleaving citation blocks within text output so that each claim is paired with its source reference. This structure is fundamentally incompatible with strict JSON schema constraints — the API cannot simultaneously guarantee a fixed schema and inject citation blocks at arbitrary positions. The correct resolution is architectural separation: a citations-enabled call for auditor traceability and a separate structured-output call for the CRM. This is a design tradeoff, not a configuration error patchable within a single call.
— Your structured data extraction pipeline processes 500 legal contracts per night, pulling out clause summaries,... Show
✓ A. Require Claude to extract a verbatim quote from the contract supporting each target field before populating the output, and emit a null sentinel for any field where no supporting quote can be found.
  B. Run each contract through the extraction prompt three times and use majority-vote logic to select the most frequently returned field values, discarding any outlier responses that differ across runs.
  C. Add a system prompt instruction telling Claude to be conservative and only include values it is highly confident about, flagging uncertain fields with a numeric confidence score between 0 and 1.
  D. Increase the output token budget for each extraction call so Claude has more room to reason carefully over the full contract text before committing to specific field values.
Why A is correct: For long documents (here, 30,000-token contracts), requiring Claude to extract verbatim supporting quotes before populating fields grounds each value in the actual text. If no quote exists, the pipeline receives an explicit "not found" signal rather than a fabricated value. This is a structural grounding mechanism: it forces a traceable evidence chain between source text and output field, making hallucination structurally harder — Claude cannot populate a field without first locating text that supports it. The sentinel also converts silent fabrication into an explicit, auditable failure mode.
— Your CI pipeline uses Claude Code to automate dependency upgrades. You've deployed it with a `canUseTool` callback... Show
  A. Update the denial message in the canUseTool callback to explain that /usr/local/lib is off-limits in CI and instruct Claude to use the sandbox path /ci/sandbox/lib instead, so Claude can self-correct on the next attempt.
✓ B. Switch to a PermissionResultAllow response with updated_input that rewrites the --target flag from /usr/local/lib to /ci/sandbox/lib before the command executes, so Claude always installs to the correct path without being blocked.
  C. Add a system prompt instruction to the CI agent telling it to always use /ci/sandbox/lib as the install target so it never attempts the production path.
  D. Replace the interactive canUseTool callback with a PreToolUse hook that auto-approves all pip install commands and relies on post-run test failures to catch bad install paths.
Why B is correct: The "approve with changes" pattern — returning PermissionResultAllow with a modified updated_input that replaces the forbidden path — intercepts the problem at the point of execution rather than creating a feedback loop. Claude sees only the result of the tool execution, not that the input was modified, so it proceeds successfully with the correct sandbox path. This addresses the root cause (wrong path in the command) structurally at the callback layer, eliminating both the denial and the retry loop without requiring Claude to infer the correct path from a message.
— Your multi-agent research system uses `PreToolUse` hooks to validate each subagent's external API calls before... Show
✓ A. Increase the timeout value in the HookMatcher configuration to give the compliance API call sufficient time to complete before the hook is considered failed.
  B. Remove the compliance check from the PreToolUse hook and implement it as a PostToolUse hook that flags non-compliant results for human review after execution.
  C. Add a stronger instruction in the subagent's system prompt telling it to pause and retry API calls if a compliance error is detected, reducing the frequency of non-compliant tool calls reaching the hook.
  D. Replace the synchronous compliance API call inside the hook callback with a cached local policy check, reserving the full remote compliance call for a periodic background refresh of the cache.
Why A is correct: The timeout field in HookMatcher configuration is the purpose-built mechanism for exactly this failure mode. When a hook callback performs a slow operation — like an outbound compliance API call — the default timeout may be insufficient, causing spurious failures that halt execution. Increasing the timeout preserves the PreToolUse blocking guarantee: the agent cannot proceed until the compliance check returns a decision. This is the proportionate fix that addresses the root cause (insufficient time budget for the callback) without changing the architecture or weakening the enforcement model.
— Your team has built a Claude Code environment for code generation with a suite of eight Skills — covering tasks like... Show
  A. Increase the context window allocation for the session so all Skill metadata, SKILL.md content, and conversation history can coexist without competing for space.
✓ B. Trim each SKILL.md to remove explanations of concepts Claude already knows — retaining only configuration values, environment-specific paths, and non-obvious constraints — so loaded Skill content consumes fewer tokens.
  C. Split the eight Skills into two separate Claude Code instances — one for document-handling Skills and one for code-quality Skills — so each instance loads a smaller set of Skill metadata at startup.
  D. Move the conceptual explanations from SKILL.md into the system prompt so they are always globally available rather than loaded conditionally per-Skill, reducing per-Skill token overhead.
Why B is correct: Context window space is a shared, finite resource — once a SKILL.md is loaded, every token in it competes directly with conversation history and active task context. The root cause here is unnecessary tokens: explanations of concepts (what a PDF is, how extraction libraries work) that Claude already knows from pretraining. Removing that content at the source — applying the "does Claude really need this?" test to each paragraph — eliminates the token pressure crowding out conversation history and causing mid-task context loss.
— Your team is using Claude Code to automate a large-scale test remediation effort: fixing 200 failing tests across a... Show
  A. Add more detail to the freeform progress.txt narrative, including the names of every test fixed, so Claude can scan the file to determine what has been resolved across sessions.
✓ B. Introduce a structured JSON file (e.g., tests.json) tracking each test's id, name, and status alongside the existing freeform notes, applying each format to what it does best.
  C. Instruct Claude at the start of each session to re-run the full test suite and derive current status from scratch, discarding prior session notes entirely to avoid stale information.
  D. Switch to a single longer session so Claude never loses context between handoffs, removing the need for any cross-session state tracking mechanism in the workflow.
Why B is correct: Freeform narrative is well-suited for tracking general progress and contextual notes, but it is a poor format for discrete, structured records like per-test status. A structured JSON file with explicit fields (id, name, status) gives Claude a machine-readable schema it can query deterministically — checking status: "passing" rather than inferring completion from prose. Combining both formats applies each to the problem it's suited for: structured data for schema-driven state, unstructured text for narrative context.
— Your structured data extraction pipeline uses a Claude agent to process 1,200 regulatory filings per day. A... Show
  A. Add a stronger system prompt instruction telling Claude to always validate extracted values before calling write tools, so the hook is not the only enforcement point and prompt-level checks catch malformed records before they reach the database.
  B. Increase max_turns to a significantly higher limit so that Claude is far less likely to hit the cap during normal extraction sessions, reducing how often the hook-bypass window can occur in production.
✓ C. Add a post-session validation gate outside the agent session boundary that re-validates all records written during the session against the same schema before marking them committed.
  D. Switch the PreToolUse hook matcher from an exact tool name to a wildcard pattern so it fires for a broader set of tool types, making it harder for any single tool call to bypass the validation check.
Why C is correct: When an agent hits max_turns, the session terminates before hooks can execute — hooks are session-internal mechanisms and cannot fire after the session boundary closes. A post-session validation gate operates outside the agent session entirely, so it runs regardless of how the session ended. This addresses the root cause: the hook depends on session continuation, which is not guaranteed. Moving validation to a session-external boundary makes it unconditional — the principle of placing enforcement at the layer that is always reachable, not the layer that assumes normal execution flow.
— Your team uses Claude Code's Agent SDK to power a code generation service that handles long-running refactoring... Show
  A. Increase the agent's token budget so the context window limit is reached less frequently, keeping the original instructions in scope for longer sessions.
✓ B. Move the error handling pattern requirements into CLAUDE.md rather than the initial prompt, so they are re-injected on every request and survive compaction boundaries.
  C. Add a stronger system prompt instruction at session start telling Claude to never forget the error handling pattern, even after long periods of inactivity.
  D. Trigger manual /compact calls at regular intervals so the compactor runs on a predictable schedule rather than automatically, giving Claude a chance to re-read the initial instructions before each compaction.
Why B is correct: Automatic compaction replaces older messages — including the initial prompt — with a summary. Any instructions that were delivered only in the initial prompt are at risk of being lost or degraded. CLAUDE.md content is re-injected on every request, meaning it is present in the context window after every compaction event regardless of how much history was summarized. Moving persistent rules to CLAUDE.md addresses the root cause: the rules need to survive compaction boundaries, and CLAUDE.md is the mechanism designed exactly for that.
— Your team is building a Python-based CI pipeline that uses the Claude Code agent SDK to run automated code reviews... Show
  A. Register the initialization logic as a PreToolUse SDK callback with no matcher, so it fires before any tool call in the session and acts as a session-start proxy.
✓ B. Define the initialization logic as a SessionStart shell command hook in .claude/settings.json and include setting_sources=["project"] in the ClaudeAgentOptions so the SDK loads it.
  C. Wrap the SDK client initialization in a try/except block that logs the failure and retries session creation, ensuring the callback eventually runs.
  D. Migrate the CI pipeline from the Python SDK to the TypeScript SDK, which supports SessionStart as an SDK callback hook natively.
Why B is correct: SessionStart is not available as a Python SDK callback hook — the Python HookEvent type omits it. The correct fix uses the mechanism designed for this gap: define the hook as a shell command in .claude/settings.json and load that settings file via setting_sources=["project"] in ClaudeAgentOptions. This makes the shell command hook available to the Python SDK session without any code restructuring, and is the pattern Anthropic guidance prescribes for this exact capability gap.
— Your team has integrated a memory tool into a Claude-powered developer productivity assistant. Developers store... Show
  A. Add a system prompt instruction telling Claude to only request paths that begin with /memories and never use relative path components like ../.
✓ B. In the memory tool's server-side handler, resolve every incoming path to its canonical form and reject any request whose resolved path does not remain within the /memories directory.
  C. Increase the tool's input validation verbosity so that suspicious-looking paths are logged and flagged for manual review before being executed.
  D. Restrict the memory tool so it only accepts absolute paths, rejecting any input that contains a relative component such as . or ...
Why B is correct: Path traversal protection must be enforced server-side through canonical path resolution. Resolving a path to its canonical form (e.g., via Python's pathlib.Path.resolve()) collapses ../ sequences and symlinks into the real filesystem path; checking the result with relative_to('/memories') then definitively rejects anything that escapes the directory. This is a structural enforcement mechanism — it is deterministic regardless of how the path was constructed, including URL-encoded variants like %2e%2e%2f. It addresses the root cause: the tool handler trusts raw input from Claude without validation.
— Your team has integrated a custom `SearchCodebase` tool into a Claude-powered developer productivity agent. The tool... Show
  A. Increase the max_tokens budget for the agent so Claude has more room to issue all search calls in a single response turn instead of spreading them across multiple turns.
✓ B. Mark SearchCodebase as read-only in its tool annotations (readOnly in TypeScript or readOnlyHint in Python) so the SDK can execute multiple instances concurrently rather than sequentially.
  C. Add SearchCodebase to allowed_tools / allowedTools so the SDK auto-approves each call without waiting for a permission prompt before starting the next one.
  D. Rewrite SearchCodebase as a single batched tool that accepts an array of search queries so Claude can express all lookups in one tool call.
Why B is correct: Custom tools default to sequential execution regardless of whether they mutate state. The SDK uses the readOnly / readOnlyHint annotation to determine whether concurrent execution is safe. Marking SearchCodebase as read-only signals to the SDK that parallel execution carries no conflict risk, allowing the 6–8 calls Claude issues per turn to run concurrently instead of serially. This directly addresses the root cause — sequential scheduling of a safe-to-parallelize tool — with the smallest possible change.
— A developer on your team is onboarding to Claude Code for the first time on a Windows machine. They open their usual... Show
  A. Stay in the current terminal and rerun the macOS/Linux install command with administrator privileges, since the error indicates a permissions problem rather than a shell mismatch.
✓ B. Open PowerShell and run irm https://claude.ai/install.ps1 | iex — the Windows-native installer designed for PowerShell.
  C. Open PowerShell and run the CMD installer command curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd, since PowerShell supports more syntax than CMD.
  D. Install Windows Subsystem for Linux (WSL) so the original bash-based install command can be used without modification.
Why B is correct: The 'bash' is not recognized error is a definitive signal that a macOS/Linux shell command was run in a Windows environment. The correct fix is to use the PowerShell installer (irm https://claude.ai/install.ps1 | iex), which is the Windows-native installer. This resolves the root cause — shell mismatch — with the smallest change: switching to the correct installer for the correct environment.
— A developer has been using Claude Code to debug a complex authentication issue for 45 minutes. The session... Show
✓ A. Use "Summarize from here" at the start of the debugging phase, leaving the early architectural messages untouched and replacing the verbose debug exchange with a compact AI-generated summary targeted at the noisy portion.
  B. Run /compact on the entire session to compress the full conversation — including the early architectural decisions and all 60 debug messages — into a single summary before continuing work.
  C. Fork the session with claude --continue --fork-session to preserve the original transcript intact and open a new branch with its own context budget for the remaining debugging work.
  D. Restore to the checkpoint at message 20 to strip out all 60 debug messages and the associated code changes, then re-describe the authentication problem in a fresh, condensed prompt to Claude.
Why A is correct: "Summarize from here" is a targeted compression mechanism: it leaves all messages before the selected point untouched and replaces only the selected message onward with a compact summary. This is precisely the right tool when early context is valuable and dense, and only a later portion is consuming space. Unlike /compact (which summarizes the entire history) or restore (which discards state), it preserves the architectural detail in full while reclaiming the context budget consumed by debug noise — the proportionate fix for this specific failure pattern.
— Your developer productivity platform uses Claude to parse and route incoming GitHub issue descriptions into... Show
  A. Increase the token budget for each request so Claude has more room to resolve the schema during generation.
✓ B. Reserve strict: true only for the tools where schema violations cause real downstream problems, and rely on Claude's natural adherence for the simpler categorization tools.
  C. Rewrite the system prompt with more detailed examples of correctly-structured tool calls so Claude can infer the intended schema without hitting complexity limits.
  D. Merge the eight specialized tools into one generic routing tool with a flexible, consolidated schema so the total complexity is concentrated in a single definition rather than spread across multiple strict tools.
Why B is correct: Schema complexity limits are a structural constraint, not a generation-length problem. The corpus explicitly recommends marking only critical tools as strict as the first strategy when hitting complexity limits — reserving guaranteed schema validation for tools where violations have real consequences, and relying on Claude's natural adherence for lower-stakes tools. This reduces the total grammar state space without changing the core required fields or restructuring the tools.
— Your team is building a structured data extraction pipeline that processes 10,000 legal contracts per day. The... Show
✓ A. Replace the agent team with a subagent architecture: the orchestrator spawns a focused subagent per extraction task, each subagent returns its structured result to the orchestrator, and the orchestrator reconciles outputs before writing to the schema.
  B. Keep the agent team architecture but add an explicit coordination protocol to the shared task list, strictly limiting each agent to two rounds of direct inter-agent messaging before escalating unresolved conflicts to the lead agent for a final binding decision.
  C. Increase the token budget allocated to each teammate so that individual agents can complete their extraction and validation work in fewer messaging rounds without hitting context-window constraints mid-task and triggering additional coordination loops.
  D. Add a fourth "arbitration" teammate to the agent team whose sole responsibility is to monitor inter-agent messages in real time, detect field-level contradictions between the three extraction roles, and issue binding decisions to resolve them before schema writes.
Why A is correct: The core principle is choosing the right coordination model for the task structure. The three extraction roles produce independent outputs that an orchestrator can reconcile — they don't require real-time discussion with each other. Agent teams are designed for "complex work requiring discussion and collaboration" with higher token cost because each teammate is a fully independent Claude instance. Subagents are designed for "focused tasks where only the result matters," returning summarized results at lower token cost. Switching to subagents eliminates the inter-agent messaging overhead that is causing both the cost and latency problems.
— Your team is running a large-scale migration of 2,000 Python files from a legacy framework to a new one using Claude... Show
  A. Add explicit instructions to the prompt telling Claude to only edit the target file and not perform any additional git operations or file modifications beyond the migration task.
  B. Run the migration sequentially with a human reviewing each file before moving to the next, to catch out-of-scope operations before they accumulate.
✓ C. Add --allowedTools "Edit,Bash(git commit *)" to each claude -p invocation to structurally restrict what operations Claude can perform per file.
  D. Switch from claude -p to an interactive Claude Code session so the developer can monitor the operations in real time and intervene when Claude goes off-script.
Why C is correct: The --allowedTools flag enforces a structural permission boundary at the CLI level — Claude cannot invoke tools outside the specified set regardless of what its reasoning suggests. Scoping permissions to Edit and Bash(git commit *) ensures each unattended invocation is limited to editing the target file and committing the result, with no path to remote pushes or config modifications. This is the structural mechanism that makes unattended batch operations safe; prompt instructions (A) are probabilistic and cannot prevent tool misuse when the tools remain available.
— Your team has standardized on Claude Code for a large API project, and you've written a root CLAUDE.md with rules... Show
✓ A. CLAUDE.md is delivered as a user message, not the system prompt, so vague instructions are followed probabilistically. Rewrite the rule to be concrete and specific: "all functions performing file, network, or database I/O must use async/await — callbacks and .then() chains are forbidden."
  B. The root CLAUDE.md is not the right location for code style rules; move the async/await rule into an auto memory entry so Claude treats it as a learned preference rather than an instruction, which gives it stronger enforcement weight in every session.
  C. Increase the token budget for each session so Claude has more processing capacity to read and internalize the CLAUDE.md instructions before generating code, reducing the chance that style rules are skipped under context pressure.
  D. Add a system prompt instruction at the start of each conversation reminding Claude to re-read the CLAUDE.md file before generating any functions, so the async/await rule is refreshed in Claude's attention window prior to each code generation task.
Why A is correct: CLAUDE.md content is delivered as a user message after the system prompt — Claude reads it and tries to follow it, but compliance is probabilistic, not guaranteed. The documented fix for inconsistent compliance is to make instructions more specific rather than vague. "Always use async/await" is open to interpretation; a rule that names the exact anti-patterns to avoid (callbacks, .then() chains) and the exact contexts where the rule applies (file, network, database I/O) removes ambiguity and raises consistent compliance. The /memory check already ruled out a loading failure, pointing directly at instruction specificity as the root cause.
— Your team has deployed a structured data extraction pipeline using Claude Code inside a Docker-based CI environment.... Show
✓ A. enableWeakerNestedSandbox reduces filesystem and network isolation, and allowing /var/run/docker.sock via allowUnixSockets effectively grants the agent host-level access — together these eliminate both the OS-level sandbox boundary and the container boundary simultaneously.
  B. Running Claude Code inside Docker without privileged namespaces prevents filesystem writes, so the agent cannot persist extracted data — the fix is to grant broader filesystem write permissions to the output directories.
  C. The network filtering proxy does not inspect traffic content, so any allowed domain could exfiltrate extracted data — the fix is to increase max_tokens so the agent batches more data per request, reducing the number of outbound connections.
  D. enableWeakerNestedSandbox is only a risk on macOS; on Linux the sandbox implementation is strong enough that allowing /var/run/docker.sock poses no additional escalation risk in Docker environments.
Why A is correct: enableWeakerNestedSandbox is documented as considerably weakening security — it removes the strong OS-level isolation that is the sandbox's primary defense. Simultaneously, allowing /var/run/docker.sock through allowUnixSockets is explicitly called out as effectively granting access to the host system via the Docker socket. Together, these two choices eliminate independent layers of protection: the first removes the sandbox boundary, and the second grants a direct escalation path to the host. Recognizing that each configuration option weakens a distinct isolation layer — and that compounding them leaves no effective boundary — is the correct architectural judgment.
— A team is building a structured data extraction pipeline to pull financial line items from 500 PDF invoices per... Show
  A. Expand the Skill documentation to cover additional edge cases and invoice formats, ensuring Claude has comprehensive guidance before processing each batch.
✓ B. Establish a baseline without the Skill, build targeted evaluations from the specific failure types already observed in production, and write minimal instructions only to close those measured gaps.
  C. Increase the model's context window allocation so that Claude can ingest the full text of each invoice alongside the extraction instructions without any truncation risk.
  D. Switch to a multi-pass workflow where a second Claude call reviews every extracted result and flags low-confidence fields for human review before the batch completes.
Why B is correct: Evaluation-driven development addresses the root cause: the team is optimizing for imagined requirements rather than actual production failures. By establishing a baseline without the Skill, constructing evaluations from real observed failure modes, and writing minimal instructions only to close those specific gaps, each iteration is grounded in measured evidence. This converts the accuracy improvement cycle from speculative documentation into a testable, falsifiable feedback loop — which is exactly what the plateau exposes as missing.
— Your CI pipeline uses Claude Code to generate automated code review summaries for pull requests. After three weeks... Show
  A. Add a chain-of-thought instruction requiring Claude to cite the specific line number and code path that supports each behavioral claim before including it in the summary.
  B. Switch to a best-of-N approach by running the same diff through the review agent three times and surfacing only claims that appear in at least two of the three outputs.
  C. Increase the context window allocation so Claude can see the full file history alongside the diff, giving it more information to base behavioral claims on.
✓ D. Add an instruction explicitly restricting Claude to only describe changes visible in the provided diff and to flag any behavioral inference it cannot directly trace to a line in the diff.
Why D is correct: The root cause is that Claude is drawing on general programming knowledge to infer behavioral consequences that aren't demonstrated in the provided diff — a hallucination pattern where the model fills gaps with plausible but unverified claims. Explicitly restricting Claude to only describe what is directly observable in the provided diff (external knowledge restriction) targets this failure mode at its source: it prevents the model from generating claims it cannot ground in the input, rather than trying to verify or outvote bad outputs after they're generated.
— Your team has configured a background subagent to run automated integration test suites concurrently while... Show
  A. Add a system prompt instruction to the subagent telling it to request only the minimum necessary permissions and avoid tool calls it is uncertain about.
✓ B. Audit the subagent's full tool usage during a foreground run, then enumerate all required tools in the subagent's tools frontmatter field so they can be pre-approved at background launch time.
  C. Switch the integration test subagent to run in the foreground so that unexpected permission prompts can be answered interactively, accepting the loss of concurrency.
  D. Set CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 to eliminate background execution and require developers to manually trigger each test suite run.
Why B is correct: Background subagents must have all required tool permissions pre-approved at launch — once running, they auto-deny any tool call not in the pre-approved set, and clarifying-question tool calls (like AskUserQuestion) fail silently rather than blocking. The root cause is incomplete tool enumeration at definition time. Auditing the full tool surface during a foreground run and declaring every required tool in the subagent's tools frontmatter ensures the pre-approval prompt at launch covers all needed permissions, eliminating the silent mid-run abandonment without sacrificing concurrency.
— Your CI pipeline uses Claude Code to perform dependency vulnerability research across 40+ microservices. Each... Show
  A. Increase the token budget for the session so Claude has enough context to retain CVE findings from early services all the way through to the final consolidated report.
✓ B. After each service scan, have Claude write structured research notes (CVE findings, confidence levels, service status) to a persisted file, then start a fresh context window that loads those notes before continuing.
  C. Add a system prompt instruction telling Claude to explicitly prioritize retaining vulnerability findings from earlier services and to cross-reference all of them before writing the final consolidated security report.
  D. Run a dedicated second Claude pass over the completed report to catch any missed vulnerabilities, supplying the original CVE database records as reference input for that review pass.
Why B is correct: Attention dilution across a long single-context session causes findings from early in the run to lose salience by the time the final report is generated — even though the information was present in context. The fix is to treat context as a scarce resource: persist structured state (CVE findings, confidence levels, service status) to an external file after each service scan, then continue with a fresh context window that loads only the persisted notes. This decouples information retention from context length and mirrors the established pattern for long-horizon tasks where Claude saves state and resumes across multiple context windows.
— Your structured data extraction pipeline processes 1,200 insurance claim forms per day. Each extraction job runs... Show
✓ A. Replace the cleanup instruction with explicit guidance distinguishing reversible actions (writing to staging, flagging records) from irreversible ones (deleting source files), and require a concrete integrity check as a prerequisite before any deletion proceeds.
  B. Increase the pipeline's max_tokens budget so Claude has more room to reason through edge cases before deciding whether to delete source files, giving it space to weigh the risks of deletion against the efficiency gains of cleanup.
  C. Add a post-processing review step where a second Claude instance audits the staging table after each batch, flags potential data loss, and attempts to restore source files if integrity issues are detected in the written records.
  D. Rewrite the system prompt to instruct Claude to "be conservative and avoid risky actions," relying on its judgment to assess when cleanup conditions are met rather than enumerating specific irreversible operations or prerequisite checks.
Why A is correct: The principle is: for irreversible actions affecting shared systems, prompt guidance must explicitly classify the action as high-risk and define a concrete prerequisite gate — not rely on vague efficiency framing or model judgment. Naming deletion as a destructive operation and requiring an integrity check before proceeding mirrors the "reversibility and potential impact" framing from the docs: Claude is encouraged to take local, reversible actions freely but must pause before hard-to-reverse ones. This addresses the root cause — the prompt gave no signal that file deletion was categorically different from writing records — without requiring infrastructure changes.
— Your structured data extraction pipeline uses Claude to process 500 financial documents per day. Each extraction... Show
  A. The tool description is too brief and doesn't explain which fields Claude should use for its next reasoning step; expanding the description to cover each returned field's semantics will resolve the re-checking behavior.
✓ B. The tool response contains bloated, low-signal data that dilutes Claude's attention; refactoring the tool to return only the semantic fields and stable identifiers Claude needs to reason about its next step will eliminate the confusion.
  C. Claude is losing track of already-retrieved values because the context window is filling up; increasing max_tokens will give Claude more room to retain previous tool results and avoid redundant calls.
  D. The single get_document_fields tool is overloaded; splitting it into separate tools for each document field type will reduce selection ambiguity and prevent Claude from re-fetching data.
Why B is correct: The principle is that tool responses should return only high-signal information — semantic fields and stable identifiers Claude needs to reason about its next step, not raw API payloads. When tool responses include opaque internal references, audit arrays, and formatting metadata, Claude must spend attention parsing irrelevant noise before it can reason about the actual values. This causes degraded decision quality and, in this case, redundant tool calls as Claude attempts to re-establish clarity. The fix addresses the root cause at the source: the tool's response contract, not downstream prompt instructions or context budget.
— Your team has deployed a Claude Code agent to perform automated code reviews in a CI pipeline. The agent runs in... Show
  A. Switch from a bind mount to a Docker volume so the container runtime mediates access to the filesystem, preventing credential files from being visible inside the container.
✓ B. Scope the Docker mount to copy only the source files required for code review — excluding credential files such as ~/.aws/credentials and ~/.kube/config — rather than mounting the full home directory path.
  C. Add a system prompt instruction telling the agent to ignore any credential files it encounters and to not read files matching patterns like *.pem, *.key, or credentials.
  D. Grant the agent read-only access to the entire home directory but enable audit logging so any credential file access is detected and alerted on after the fact.
Why B is correct: The root cause is that the mount scope is broader than the task requires — the agent receives access to credential files because they live within the mounted path. The principle of least privilege applied to filesystem access means mounting only the source files actually needed for code review, either by scoping the bind mount to the source directory itself or by using .dockerignore-style filtering to exclude known credential paths (~/.aws/credentials, ~/.kube/config, *.pem, etc.). This eliminates the exposure structurally: files that are never mounted cannot be read, regardless of agent behavior.
— A structured data extraction pipeline processes 150 regulatory filings per night, each averaging 35,000 tokens.... Show
✓ A. Reorder the prompt so the full filing text appears before the extraction instructions and field definitions, and require Claude to quote the relevant passages before populating each field.
  B. Split each 35,000-token filing into overlapping 8,000-token chunks and run a separate extraction call per chunk, then merge the results downstream.
  C. Add a stronger system prompt instruction emphasizing that Claude must read the entire document carefully before extracting any values, particularly those in the middle sections.
  D. Increase max_tokens to give Claude more room to reason through the full filing before committing to extracted field values.
Why A is correct: Placing longform document content before instructions is a documented structural technique that can improve response quality by up to 30% on complex, multi-document inputs — the model attends better to content encountered during the reading phase before the query anchors its attention. Combining this with a quote-first step further improves accuracy: by requiring Claude to surface relevant passages before populating fields, the model is forced to locate and anchor on the exact text for each value rather than relying on diffuse recall across a 35,000-token document. Both changes address the root cause — attention drift over long inputs — at the prompt structure level.
— A developer on your team is working on a large monorepo with Claude Code. They've structured path-scoped rules in... Show
✓ A. Auto-compaction summarizes path-scoped rules along with message history; they only reload when Claude next reads a matching file. To guarantee persistence across compaction, move critical rules to project-root CLAUDE.md or remove the paths: frontmatter entirely.
  B. Auto-compaction clears all CLAUDE.md files including the project-root one; the correct fix is to increase the session's token budget so compaction is triggered less frequently, preserving the path-scoped rules in context for longer.
  C. Path-scoped rules are dropped permanently once compaction runs and cannot reload automatically; the fix is for the developer to manually re-specify the relevant rules in each new prompt to restore them for that session.
  D. Auto-compaction retains path-scoped rules in the system prompt but strips their frontmatter metadata; the fix is to migrate the rules into the auto memory file so they are re-injected from disk independently of any path trigger.
Why A is correct: Path-scoped rules load into message history when their trigger file is read — not into the system prompt or a persistent store. When compaction runs, message history is summarized, taking those rules with it. They do not reload until Claude reads a matching file again in the same session. The architectural fix is to move rules that must persist across compaction to the project-root CLAUDE.md (re-injected from disk after compaction) or to drop the paths: frontmatter so the rule is always loaded. This is the principle of matching persistence mechanism to durability requirement: path-scoped rules trade durability for relevance scoping, and architects must choose deliberately between them.
— A structured data extraction pipeline uses server-side web_search tools to enrich contract records with public... Show
  A. The server tools are timing out due to network latency. Add retry logic with exponential backoff around each individual web_search call to prevent early termination and ensure all enrichment lookups complete successfully.
✓ B. The sampling loop is hitting the 10-iteration limit before completing all lookups. Detect pause_turn, append the assistant's response to the message history, and issue a continuation request — gating the database write until a non-pause_turn stop reason is received.
  C. The max_tokens budget is being exhausted mid-enrichment. Increase max_tokens so Claude has sufficient room to complete the full sequence of lookups in a single response, preventing truncation before all fields are populated.
  D. Claude is silently dropping tool calls because the tool description is too vague. Rewrite the web_search tool description to explicitly enumerate each field the pipeline expects to extract, ensuring all required lookups are attempted before the response is returned.
Why B is correct: The pause_turn stop reason is returned specifically when the server-side sampling loop reaches its iteration limit (default: 10) while executing server tools. The response at that point contains an incomplete server_tool_use block without a corresponding result. The correct fix is to detect this signal in the agent loop, append the assistant's partial response to the message history, and issue another API request — allowing Claude to resume from where it stopped. Writing to the database before handling pause_turn is what causes the missing fields; the fix is to gate the database write until a non-pause_turn stop reason is received.
— Your developer productivity platform uses a keyword-based classifier to route internal engineering tickets — bug... Show
  A. The ticket volume is high enough that automated routing — regardless of approach — will provide measurable cost-per-ticket savings compared to manual triage.
  B. The classifier must handle tickets written in multiple languages from globally distributed engineering teams, and maintaining separate models per language is not feasible.
✓ C. Routing categories have changed and will continue to evolve, meaning any retrained classifier will require repeated data-intensive relabeling cycles each time definitions shift.
  D. The existing classifier's accuracy dropped to 78%, which is below the 90–95% industry benchmark, indicating the model is underperforming and needs replacement.
Why C is correct: The core limitation of traditional ML classifiers is that changing category definitions requires extensive relabeling and retraining — a laborious, data-intensive cycle. The scenario explicitly describes ongoing category evolution as the root cause of degradation. Claude can adapt to new or redefined classes with minimal labeled examples, eliminating the retraining bottleneck. This is the architectural tradeoff that favors an LLM approach over retraining the existing model.
— A developer productivity tool uses Claude to analyze large codebases. Developers report that when they ask Claude to... Show
  A. The context window is too small to hold 40–50k tokens of source files alongside the instructions, causing silent truncation of the file content before analysis.
✓ B. The prompt places detailed instructions and review questions before the source files, causing Claude's attention to degrade on the document content that appears later in the context.
  C. The review questions are too open-ended, so Claude prioritizes surface-level patterns it can detect quickly rather than performing a deep architectural analysis.
  D. Claude lacks sufficient working memory for multi-file analysis tasks and requires the codebase to be split into separate, sequential requests to maintain accuracy.
Why B is correct: For long-context inputs (20k+ tokens), placing documents at the top of the prompt — above instructions, queries, and examples — can improve response quality by up to 30%. When instructions and questions precede the source files, Claude's attention is anchored to the instruction section, and the large document content that follows receives less focus. Reordering the prompt so source files appear first, with review questions at the end, directly addresses the root cause: information placement determines where attention is concentrated in a large context.
— Your team has deployed a Claude Code Stop hook that automatically runs a suite of post-generation linting and test... Show
✓ A. The Stop hook is triggering Claude to continue working, and the hook script re-fires each time Claude finishes, because it does not check stop_hook_active and exit early when the field is true.
  B. The Stop hook is running in parallel with a PostToolUse hook, and the two hooks are issuing conflicting instructions that prevent the session from terminating cleanly.
  C. Claude is exceeding its context window during the linting phase, causing the session to restart automatically rather than halt, and the fix is to increase the token budget allocated to the Stop hook.
  D. The shell command type is inappropriate for post-generation validation; switching the hook to type: "http" pointing at a local service will prevent the re-entry loop.
Why A is correct: The Stop hook fires each time Claude finishes responding. If the hook script triggers Claude to do additional work (e.g., re-run tests), Claude finishes that work and fires Stop again — re-entering the hook. The stop_hook_active field is specifically set to true when the Stop event is firing during a hook-triggered continuation. A hook that doesn't inspect this field and exit early will unconditionally trigger another continuation, producing an infinite loop. The fix is to parse stop_hook_active at the top of the script and exit 0 when it is true, allowing Claude to stop rather than re-enter.
— Your developer productivity assistant handles four distinct task types: code review, documentation generation,... Show
✓ A. Add a separate intent classifier to route each incoming developer request to a specialized Claude instance with its own system prompt and task-specific tool set.
  B. Expand the unified system prompt with explicit per-task sections that instruct Claude to ignore guidelines not relevant to the current request type.
  C. Increase the context window allocation so Claude has more room to separate task-specific instructions before generating a response.
  D. Merge all four task types into a single generalist tool that accepts a task_type parameter, letting Claude select the appropriate behavior at inference time.
Why A is correct: Routing through an intent classifier to specialized instances enforces task isolation at the architectural level: each task type receives its own system prompt and tool set, so guidelines and tools from one task are structurally invisible to another. Cross-task contamination cannot occur because the contexts never overlap. The tradeoff is one additional latency-adding classifier call, but this is the only approach that eliminates the failure mode rather than reducing its frequency through prompt instructions.
Study Mode Home