Question 10
A Claude Code team audits the quality of its persistent project instructions. CLAUDE.md contains vague advice to 'write good code' but omits repository commands. What should the team do to resolve this particular gap?
- Enforce the gate in CI or permission policy, while keeping guidance aligned
- Document the actual lint, test, and review procedures with relevant paths
- Summarize service boundaries and point to authoritative files for details
- Resolve the conflict and express one authoritative formatting rule
- Replace the secret with a safe placeholder and managed-secret guidance
Explanation
Correct Answer
B:Specific commands and expected outcomes give Claude verifiable steps; broad style slogans offer little operational guidance.
Incorrect Answers
A:This choice is relevant when one developer asks Claude Code to ignore a required security gate for speed; prompt instructions are not an authoritative security boundary; a required check should fail independently of the assistant's compliance. Here, however, CLAUDE.md contains vague advice to 'write good code' but omits repository commands.
C:A navigational map improves codebase discovery while leaving large or frequently changing implementation text in its source files; the alternative problem occurs when the team wants Claude to know repository architecture without pasting full source files. The present scenario instead requires the system to replace generic slogans with actionable conventions.
D:Conflicting directives can produce nondeterministic edits; a clear standard prevents wasted patch iterations; it protects against the case where two instruction files issue contradictory formatting requirements, rather than the failure described here: CLAUDE.md contains vague advice to 'write good code' but omits repository commands.
E:It would be appropriate when a temporary secret appears in a copied setup example; persistent instructions may be read by agents and committed to version control; secrets do not belong in them. Here, CLAUDE.md contains vague advice to 'write good code' but omits repository commands, so a different mechanism is required.
Question 11
A Claude Code assistant supports an engineering team during feature development. The request has several plausible interpretations of the user experience. Which control is most directly relevant?
- Use a structured requirement interview covering behavior and constraints
- Create cases for missing, empty, and malformed inputs before coding
- Inspect the failed assertion and revise only the mismatched logic
- Reference nearby implementations and conventions while specifying differences
Explanation
Correct Answer
A:Clarifying choices reduces wasted implementation iterations and ensures stakeholders own product decisions. This matches the workflow goal to resolve design ambiguity with targeted questions rather than introducing an unrelated action.
Incorrect Answers
B:It would be appropriate when a new utility has no tests and several tricky null-handling cases; explicit edge-case tests make the expected semantics observable and prevent silent incorrect defaults. Here, the request has several plausible interpretations of the user experience, so a different mechanism is required.
C:Failure traces narrow the search space and provide stronger evidence than asking the model to try again generally; the alternative problem occurs when the first implementation fails a specific assertion in continuous integration. The present scenario instead requires the system to resolve design ambiguity with targeted questions.
D:Real repository examples anchor the solution in established architecture without forcing the model to invent project-specific patterns; it protects against the case where a developer wants generated code to conform to existing examples, rather than the failure described here: the request has several plausible interpretations of the user experience.
Question 12
A developer asks Claude Code to implement a new serialization routine. The exact expected encoding is ambiguous in the feature request. How should the workflow be adjusted?
- Inspect complexity assumptions and test evidence against acceptance criteria
- Ask for representative input/output pairs and edge cases
- Add unseen edge cases and regression checks
- Use the failing test output to make a targeted correction
Explanation
Correct Answer
B:Concrete examples expose ambiguity in the contract before implementation, reducing incorrect assumptions that tests might otherwise miss.
Incorrect Answers
A:This choice is relevant when a developer wants to know why the proposed algorithm is acceptable; a concise rationale should be backed by measured or inspectable behavior, not by the model's own confidence. Here, however, the exact expected encoding is ambiguous in the feature request.
C:Overfitting to a few examples can hide incorrect general behavior; independent cases test whether the implementation is robust; the alternative problem occurs when a generated solution passes only the examples it was shown. The present scenario instead requires the system to establish examples before coding.
D:It would be appropriate when Claude produces a patch that compiles but breaks a boundary case; compilation checks syntax and types, not all behavior; a failing edge-case test provides precise evidence for improvement. Here, the exact expected encoding is ambiguous in the feature request, so a different mechanism is required.
Question 13
A customer-service agent uses hooks around tool operations. A refund tool must never execute for amounts above the permitted threshold without approval. Which implementation decision is the best fit?
- Transform dates at a controlled post-tool boundary into a canonical format
- Use a pre-execution hook or service policy that rejects unauthorized refund calls
- Remove or deny shell execution in the actual tool permissions or hook
- Record the event at the tool-execution boundary using a hook or service log
Explanation
Correct Answer
B:A deterministic tool boundary can block a high-value mutation even if a model instruction fails to deter it. For the stated case, the check is whether the system can enforce an external transaction guard; this approach supplies that control.
Incorrect Answers
A:A post-tool normalization step makes structured evidence consistent without hoping a later prompt corrects every variant; it protects against the case where a source-search tool returns inconsistent date formats that confuse downstream parsing, rather than the failure described here: a refund tool must never execute for amounts above the permitted threshold without approval.
C:Text guidance is probabilistic, whereas execution controls can reject a forbidden operation regardless of model output; the alternative problem occurs when a prompt says 'never run shell commands,' but the tool remains available and callable. The present scenario instead requires the system to enforce an external transaction guard.
D:It would be appropriate when the application needs a durable record whenever a privileged tool is invoked; execution-time logging captures real calls and outcomes; model-generated explanations alone are not reliable audit evidence. Here, a refund tool must never execute for amounts above the permitted threshold without approval, so a different mechanism is required.
Question 14
Claude Code is used to modernize a legacy service under production constraints. The requested change affects database schema and multiple integrations. What should the architect specify in the design?
- Limit writes to authorized paths and escalate the out-of-scope changes
- Inspect dependencies and outline migration, rollback, and validation steps in plan mode
- Generate alternative plans with trade-offs and identify missing evidence
- Edit the identified key and run the acceptance test
Explanation
Correct Answer
B:High-impact changes benefit from a reviewable plan that exposes assumptions and ordering before writes occur. This matches the workflow goal to collect an impact plan before touching code rather than introducing an unrelated action.
Incorrect Answers
A:This choice is relevant when the final plan is accepted, but some files lie outside the permitted workspace; approval for a plan does not grant unrestricted filesystem rights; actual tool permissions must still match the authorized work. Here, however, the requested change affects database schema and multiple integrations.
C:A decision stage should expose risks and open questions rather than let the assistant silently pick an unreviewed migration strategy; the alternative problem occurs when the team disagrees about the safest migration approach. The present scenario instead requires the system to collect an impact plan before touching code.
D:It would be appropriate when a one-line configuration adjustment has an approved target and acceptance check; a concrete low-risk request with clear verification can move directly to execution without an elaborate architecture phase. Here, the requested change affects database schema and multiple integrations, so a different mechanism is required.
Question 15
An AI research assistant prepares high-stakes organizational recommendations. A key source is inaccessible and no equivalent evidence is available. Which change most directly addresses this condition?
- Present competing interpretations and escalate the trade-off to the responsible decision maker
- Apply documented style rules automatically and continue
- Execute the delegated decision inside the defined thresholds with an audit trail
- Mark the affected conclusion as unverified and request further review
- Request the applicable policy or route to its owner
Explanation
Correct Answer
D:The absence of a crucial source limits what the assistant can responsibly conclude; a plausible summary cannot replace verification.
Incorrect Answers
A:When evidence does not uniquely determine action, the architect should avoid manufacturing unwarranted certainty; it protects against the case where the cited facts support two materially different recommendations, rather than the failure described here: a key source is inaccessible and no equivalent evidence is available.
B:Human review capacity is best reserved for consequential ambiguity; deterministic cosmetic corrections can be handled within the workflow; the alternative problem occurs when a minor stylistic issue does not affect factual or safety requirements. The present scenario instead requires the system to disclose the evidence gap.
C:This choice is relevant when a legal owner has explicitly delegated a narrow approved judgment; escalation should follow actual authority boundaries; needless handoffs for approved routine cases slow the system without improving safety. Here, however, a key source is inaccessible and no equivalent evidence is available.
E:It would be appropriate when a requested final verdict depends on a policy that has not been supplied; an agent cannot safely invent an organization's normative requirements from generic patterns. Here, a key source is inaccessible and no equivalent evidence is available, so a different mechanism is required.
Question 16
A Claude Code assistant chooses safe file-system operations during investigation. The user asks which directory contains a certain module family. What is the most defensible next step?
- Run the approved test while keeping edit permissions disabled
- Search filenames or directory structure for the module pattern
- Use a targeted edit constrained to the authorized file or module
- Read the test source and called code before proposing a fix
Explanation
Correct Answer
B:A path-discovery operation is sufficient for locating modules and avoids unnecessary shell commands or source rewrites.
Incorrect Answers
A:A test execution can provide evidence without granting the assistant authority to modify files during diagnosis; the alternative problem occurs when the user approves running a test but not altering source code. The present scenario instead requires the system to discover module paths without modifying files.
C:This choice is relevant when the user approves a patch only in a named module, and broad rewrites are prohibited; a narrow modification respects the granted scope and keeps a diff small enough for meaningful review and rollback. Here, however, the user asks which directory contains a certain module family.
D:It would be appropriate when the user asks why a failing unit test expects a particular value; source inspection establishes what the assertion and implementation do instead of guessing from the test name. Here, the user asks which directory contains a certain module family, so a different mechanism is required.
Question 17
A Claude Code automation project uses lifecycle hooks for deterministic behavior. A test command must run after a source-editing tool successfully changes code. Which approach satisfies the stated constraint?
- Run the targeted test through an appropriate post-tool hook or workflow stage
- Check command and path policy through a pre-tool validation hook
- Sanitize tool outputs at a controlled result boundary before passing them to the model
- Capture the subagent lifecycle completion event for orchestration tracking
Explanation
Correct Answer
A:The validation is bound to the actual modification event, not to whether Claude remembers a reminder at the end of the conversation.
Incorrect Answers
B:Pre-execution enforcement can stop the command before any files are changed; post-execution review would be too late; it protects against the case where a shell command would write to a protected production directory, rather than the failure described here: a test command must run after a source-editing tool successfully changes code.
C:This choice is relevant when a tool result contains a bearer token accidentally echoed from logs; tool-return filtering reduces exposure of secrets in model context and later generated text; a user-facing disclaimer does not remove the token. Here, however, a test command must run after a source-editing tool successfully changes code.
D:A completion event is the right place to record the specialist's result without confusing it with the parent agent's final turn; the alternative problem occurs when a subagent finishes a task, and its completion status must be recorded centrally. The present scenario instead requires the system to trigger validation after a relevant tool event.
Question 18
A support workflow handles errors from external services. The order API times out and the agent states the customer has no order. Which mechanism should be selected?
- Query the transaction ledger by idempotency key before retrying
- Stop the action and route to the approved access process
- Treat a validated empty optional field as data, not a tool outage
- Propagate an unavailable-service error and avoid a negative factual assertion
Explanation
Correct Answer
D:A failed query provides no evidence that a record is absent; the customer should receive an honest temporary-status response.
Incorrect Answers
A:Unknown delivery of a response is not proof the operation failed; reconciliation prevents duplicate financial effects; it protects against the case where a refund call may have succeeded before its network connection dropped, rather than the failure described here: the order API times out and the agent states the customer has no order.
B:A fixed permission constraint is not repaired by exponential backoff; repeated calls can add noise without changing authority; the alternative problem occurs when a backend returns a permanent account-permission denial. The present scenario instead requires the system to distinguish unavailable lookup from missing record.
C:It would be appropriate when a policy lookup returns a valid empty result for an optional note; an expected empty value is distinct from execution failure; confusing them causes unnecessary recovery attempts. Here, the order API times out and the agent states the customer has no order, so a different mechanism is required.
Question 19
A document-extraction pipeline exposes conversion and validation tools to Claude. A validator requires normalized currency codes but callers send symbols. What should be implemented at the appropriate boundary?
- Split distinct operations into purpose-built tools with focused schemas
- Constrain the input schema to supported currency codes and document normalization
- Rename and describe the operation as a posting action with approval prerequisites
- Return page identifiers, text, status, and errors as separate structured records
Explanation
Correct Answer
B:A typed canonical contract prevents ambiguous symbols from becoming silently incorrect financial records. Here it serves the explicit need to express the expected canonical argument domain without adding a separate unverified inference.
Incorrect Answers
A:This choice is relevant when the team continually adds loosely related parameters to one giant function; narrow functions are easier for Claude to select and for the host to validate than a parameter-heavy command that mixes unrelated side effects. Here, however, a validator requires normalized currency codes but callers send symbols.
C:It would be appropriate when an extraction tool performs irreversible posting but is labeled process_document; accurate tool semantics make a state-changing command distinguishable from read-only extraction during model tool choice. Here, a validator requires normalized currency codes but callers send symbols, so a different mechanism is required.
D:Per-page status distinguishes a partly readable document from a fully successful extraction and supports targeted retries; it protects against the case where an OCR tool can return multiple pages with partial failures, rather than the failure described here: a validator requires normalized currency codes but callers send symbols.
Question 20
A development agent explores competing fixes across multiple sessions. A developer needs to continue yesterday's unfinished refactor. Which option best meets the operational need?
- Fork a common session context for each experiment
- Rerun relevant tests on the current revision before accepting success
- Use separate worktrees or sandboxes for mutable branch experiments
- Preserve goals, constraints, decisions, open issues, and source references while discarding noise
- Resume the relevant session and inspect the recorded pending work
Explanation
Correct Answer
E:Continuing the actual conversation preserves intent and decisions, although the current code must still be validated.
Incorrect Answers
A:Branching keeps baseline assumptions comparable, whereas serially editing one conversation blends conclusions; it protects against the case where two proposed fixes need separate experiments from the same baseline, rather than the failure described here: a developer needs to continue yesterday's unfinished refactor.
B:Tests describe a specific code state; a prior green result cannot establish correctness for a changed repository; the alternative problem occurs when a resumed worker reports success based on a cached test from last week. The present scenario instead requires the system to recover the existing task trajectory.
C:It would be appropriate when one experiment altered local files that another experiment must not see; forked dialogue history alone does not isolate disk writes; workspace separation prevents cross-experiment contamination. Here, a developer needs to continue yesterday's unfinished refactor, so a different mechanism is required.
D:This choice is relevant when a session has grown so large that prior assumptions hide the active requirement; structured compaction retains what is needed for continuation and reduces irrelevant history without implying forgotten facts are still available. Here, however, a developer needs to continue yesterday's unfinished refactor.