Question 140
A quality-review skill contains hard-coded company secrets in its reference file. What is the correct fix?
- Save supporting resources within the skill and load them when needed
- Set up isolated or forked context for the specialized skill
- Remove embedded secrets and access approved credentials through secure runtime configuration
- Establish a custom slash-invocable command or skill for the PR summary
Explanation
Correct Answer
C:Skill contents may be loaded into model context and shared in repositories. Credentials need separate guarded provisioning and should be rotated if exposed.
Incorrect Answers
A:Because skills can bundle reference material and executable helpers for a focused task, the measure supports packaging on-demand skill resources rather than the needed securing reusable skill contents.
B:Context isolation can keep reviewer instructions and intermediate analysis apart from the parent task; its benefits for isolating a specialized skill's context do not resolve the need for securing reusable skill contents.
D:Named command workflows provide repeatable behavior for a familiar task; this contributes to creating a reusable named PR-summary action without meeting the need for securing reusable skill contents.
Question 141
A tool hook accesses a customer ID from untrusted input and then constructs a shell command. What hardening is essential?
- Validate and safely handle hook inputs before invoking external processes
- Launch a PostToolUse handler after successful file-edit tools
- Establish ordered responsibilities and nonconflicting hook contracts
- Add the validation to the agent-turn or stop lifecycle event
Explanation
Correct Answer
A:Hooks execute application-controlled code and may receive adversarial strings. Treating their input as trusted shell syntax can turn a policy boundary into an injection path.
Incorrect Answers
B:For reacting to a completed editing tool, a post-tool callback can inspect the completed edit and trigger formatting or verification in response; however, this requirement concerns validating data inside enforcement hooks.
C:Clear handler scope and explicit failure precedence prevent accidental interactions; that may serve resolving conflicting lifecycle handlers, but it is no substitute for validating data inside enforcement hooks.
D:End-of-turn hooks can trigger aggregate checks that would be wasteful after every individual edit; this may support validating at the end of agent activity but cannot alone meet the requirement for validating data inside enforcement hooks.
Question 142
An architect wants to assign a model to every database query in a workflow. What distinction should guide decomposition?
- Reissue or replace only the failed subtask while keeping successful outputs
- Allocate separate evaluators with distinct rubrics and merge after both finish
- Reserve agents for uncertain reasoning and use tools for well-defined operations
- Employ direct deterministic lookup and rule evaluation for the simple stages
Explanation
Correct Answer
C:Deterministic database queries are better expressed as typed tool actions. An extra model introduces variability where the operation already has a precise interface.
Incorrect Answers
A:Independence in the task graph permits selective replay; the deciding condition is choosing tools rather than unnecessary agents, whereas this action concerns isolating retry to failed work.
B:Different quality dimensions need different tests; the option would serve decomposing evaluation into distinct quality checks, not choosing tools rather than unnecessary agents as specified in the stem.
D:Not every step requires another model or subagent; that relates to separating deterministic steps from inference, not the necessary choosing tools rather than unnecessary agents.
Question 143
An automated refund finishes payment processing but the customer record remains unupdated. What design prevents a false done state?
- Check all required approvals as structured preconditions for execution
- Include a human approval gate between proposal and execution
- Introduce a test-pass acceptance condition before marking the coding task done
- Define a post-action reconciliation stage before marking the case resolved
Explanation
Correct Answer
D:Workflow success should depend on confirmed downstream state, not just a tool invocation. A reconciliation step detects partial completion and triggers compensation.
Incorrect Answers
A:When addressing enforcing multi-party approval prerequisites, multi-party authorization should be checked against the configured policy, not inferred from a narrative; the present task instead calls for verifying all required stages of case resolution.
B:Human-in-the-loop approval must be enforced by the controller for side effects; inserting human approval before side effects and verifying all required stages of case resolution require different controls in this situation.
C:Stage completion is a business invariant that should be checked with tool output; the unsatisfied requirement is verifying all required stages of case resolution, not using tests as a completion gate.
Question 144
A codebase has millions of lines and Claude Code starts reading entire directories into context. What first step reduces noise?
- Gather a short verified configuration summary with exact file references
- Provide a concise module map with relevant paths, responsibilities and unresolved questions
- Use package-scoped guidance while exploring the affected subtree
- Use repository search to locate relevant symbols and then read focused files
Explanation
Correct Answer
D:Search-first exploration narrows the context to likely dependencies. Bulk file loading can exhaust the window before the actual problem is understood.
Incorrect Answers
A:Shared grounded notes prevent repeated expensive reads while retaining the ability to verify details; this can serve reusing concise verified repository findings, but leaves the requirement for narrowing large-repository inspection by search unmet.
B:A structured map preserves navigation value without carrying every line into parent context; that addresses compacting repository exploration into an actionable map, whereas this case calls for narrowing large-repository inspection by search.
C:Local rules capture framework and testing differences across packages; this concerns using local conventions during monorepo exploration, leaving the requirement for narrowing large-repository inspection by search outstanding.
Question 145
An agent sent a refund_tool_result with the identifier from a different earlier tool call. What is the correct repair?
- Associate each tool_result with the actual tool_use_id that created it
- Handle the custom stopping sequence as a generation boundary and validate task completion separately
- Send back an explicit failed tool result with diagnostic information rather than fabricate data
- Forward the result back into the model loop so Claude can decide the next action
Explanation
Correct Answer
A:Tool-result correlation is by the invocation identifier, not merely by a shared tool name. Returning a result against the wrong call corrupts the conversation protocol and its evidence chain.
Incorrect Answers
B:A stop_sequence signals an application-specified token sequence caused termination; this contributes to separating custom stop boundaries from success without meeting the need for correlating tool responses by invocation.
C:The tool-error signal should flow into the conversation so the agent can retry, escalate, or communicate limits; that serves surfacing client-tool execution failure, whereas the case requires correlating tool responses by invocation.
D:Because the application does not simply display raw tool output as the final assistant response, the measure supports resuming model reasoning after a result rather than the needed correlating tool responses by invocation.
Question 146
The CI reviewer returns a confident claim that a function is broken but supplies no test or code citation. How should the gate treat it?
- Require verifiable evidence before elevating the claim to a blocking finding
- Constrain allowed tools and repository credentials to read-only review operations
- Obtain machine-readable JSON output and validate its schema
- Furnish relevant migration files and compatibility criteria with the diff
Explanation
Correct Answer
A:Model assertions are hypotheses until supported by inspected code or tests. Evidence requirements reduce false-positive failures and give developers actionable feedback.
Incorrect Answers
B:CI runners often have elevated tokens; this may support enforcing read-only CI review permissions but cannot alone meet the requirement for verifying CI review claims before blocking.
C:Structured output is easier for CI to parse and gate deterministically; the stated problem requires verifying CI review claims before blocking rather than parsing review output safely in CI.
D:Reviewing only altered lines can miss deployment sequencing and consumers; a method suited to providing dependency context for migration review does not meet the need for verifying CI review claims before blocking.
Question 147
An SDK team uses multiple packages and wants each package's conventions applied only while editing that package. Which hierarchy feature helps?
- Use appropriately scoped instructions in the package's directory
- Store reviewed repository conventions in the project-level CLAUDE.md
- Revise version-sensitive project instructions alongside the framework migration
- Choose the user's personal CLAUDE.md for cross-project preferences
Explanation
Correct Answer
A:Directory-local guidance gives specialized expectations without imposing them on unrelated packages. The file's location communicates the intended subtree.
Incorrect Answers
B:Project instruction files carry shared guidance alongside the codebase; that relates to distributing shared repository coding instructions, not the necessary selecting package-specific guidance.
C:Although standing guidance can become stale as dependencies and conventions evolve, the choice addresses maintaining instruction accuracy after upgrades and not the requested selecting package-specific guidance.
D:User-scoped instructions express developer preferences beyond one repository; the deciding condition is selecting package-specific guidance, whereas this action concerns applying personal preferences across projects.
Question 148
A delegating agent creates a subagent without specifying when the task is done. Which addition limits ambiguous handoffs?
- Include an explicit output contract and completion criteria in the delegated prompt
- Emit stable source identifiers alongside evidence extracts and claims
- Call the two workers in separate contexts and compare at the parent level
- Define a concise result schema suited to the parent's merge operation
Explanation
Correct Answer
A:A subagent needs a bounded objective, format and acceptance test. Without these, its response may be verbose but unusable by the parent orchestration stage.
Incorrect Answers
B:Citation-safe merge requires referential metadata; in this scenario, preserving source pointers through delegation is secondary to making subagent completion testable.
C:When considering obtaining independent subagent hypotheses, isolated contexts create genuinely independent assessments; the requirement for making subagent completion testable remains unmet.
D:When addressing minimizing unnecessary worker output context, an output shape with decision, evidence and uncertainty avoids spending context on unusable narration; the present task instead calls for making subagent completion testable.
Question 149
A monorepo rule written for migrations is being loaded during UI editing and wasting context. What should be revised?
- Tighten the rule's paths glob to target only migration files
- Revise the glob to cover nested directories explicitly
- Broaden the migration-review rule to all frontend and backend files so it is always visible
- Use a wildcard matching TypeScript UI files rather than the migration-file paths
Explanation
Correct Answer
A:A narrower glob controls the rule's applicability. Broad patterns introduce instructions where they have no effect and can conflict with other conventions.
Incorrect Answers
B:Path patterns control rule discovery; matching nested paths in a rule glob and narrowing a conditional rule's file scope are distinct responsibilities under these constraints.
C:A global selector makes the contextual-bloat problem worse by loading database guidance during UI tasks. Migration-specific paths should govern when the rule applies.
D:A UI-oriented glob would not target the migration files needing the review policy. The selector must match the actual migration paths and exclude unrelated code.
Question 150
A support system offers automatic escalation for low-confidence cases but no definition of what low confidence means. What design improvement helps?
- Specify the intended action and confirm authorization before choosing either operation
- Provide the case to a human approver with amount and policy evidence
- Define escalation signals based on evidence gaps and policy-critical uncertainty
- Mark the missing signature and request document correction or human review
Explanation
Correct Answer
C:Observable criteria are more actionable than a model's unsupported self-confidence score. Explicit missing fields and conflicting sources can trigger consistent review.
Incorrect Answers
A:Destructive and reversible operations are not interchangeable; that serves clarifying an ambiguous destructive request, whereas the case requires operationalizing uncertainty-based escalation.
B:Because threshold exceptions require explicit authority, the measure supports routing above-limit refunds to a human rather than the needed operationalizing uncertainty-based escalation.
D:Critical missing evidence cannot be filled from a language model's guess; supporting escalating missing legally required evidence cannot replace the required operationalizing uncertainty-based escalation.