Question 160
A team needs test generation conventions for files ending in .spec.ts inside packages/web. Which match strategy is best?
- Apply the rule to all files in every package
- Rely on the developer to restate the pattern with each prompt
- Use a pattern constrained to packages/web and the spec file suffix
- Apply the rule to every markdown file in the repository
Explanation
Correct Answer
C:Both directory and file type matter to the requirement. Scoped matching avoids applying the test rule to unrelated TypeScript files.
Incorrect Answers
A:An overly broad policy introduces noise and may conflict with non-web standards.
B:Manual reminders are less reliable than versioned path rules. The team wants reusable configuration.
D:Markdown documents are not the requested test files. The selector would miss its target.
Question 161
A backend-focused reviewer opens a frontend file and sees backend-only database guidance. What is the likely configuration defect?
- The model's token budget is necessarily too small
- The repository has too few root instructions
- The frontend file must secretly contain a database schema
- Its path matcher is too broad or incorrectly scoped
Explanation
Correct Answer
D:A path-scoped mechanism should prevent backend rules from appearing during unrelated UI work. Inspect match patterns and duplicates.
Incorrect Answers
A:Context length may affect attention but does not explain why irrelevant rules were selected. The first issue is rule scope.
B:Adding global text would not solve inappropriate backend-rule loading. It could make conflicts worse.
C:The presence of guidance does not prove file contents. A mistaken rule match is a simpler explanation.
Question 162
A shared team instruction about secret handling must apply to every package, while formatting rules differ by language. How should files be organized?
- Duplicate contradictory security versions in each language folder
- Keep universal security guidance global and language rules path-scoped
- Convert formatter preferences into backend authorization checks
- Put security guidance only under the web package
Explanation
Correct Answer
B:This separates project-wide obligations from local conventions. It reduces repetition and makes each rule's intended reach explicit.
Incorrect Answers
A:Policy drift makes auditing difficult. A central universal rule is clearer.
C:Formatting belongs to project guidance and testing, while security controls have separate enforcement needs. Mixing them obscures scope.
D:Other packages also handle secrets. Narrow placement would leave gaps outside the UI.
Question 163
A new package is added under services/payments and needs stricter review instructions only there. What should the team add?
- A payments path rule defining review and escalation
- A global instruction to treat every file as a payment processor
- A hidden note in one developer's chat history
- A tool error that pretends every payment file is invalid
Explanation
Correct Answer
A:Local configuration can reflect the higher-risk package without imposing it on all repositories. Hard gates should still be enforced by CI and permissions.
Incorrect Answers
B:Overgeneralization creates irrelevant work across unrelated code. The new need is limited to one package.
C:Personal conversations do not establish shared repeatable package policy. The rule should be versioned with the repository.
D:Tool failures are observations, not the normal means to configure review guidance. The approach would break real operations.
Question 164
A repository has a generated directory that the team does not want Claude Code to edit. Which defense is strongest?
- Make generated files more difficult to read by renaming extensions
- Rely only on a polite reminder in a remote wiki
- Combine path guidance with enforced edit restrictions
- Remove all other edit tools from the assistant for every package
Explanation
Correct Answer
C:Path rules can express intent, while tool permissions or hooks provide stronger prevention. Generated files should be changed through their source pipeline.
Incorrect Answers
A:Obscurity is not a robust write-control mechanism. Clear policy and enforced boundaries are preferable.
B:Instructions alone do not guarantee tool behavior, and a remote link may be unavailable. Execution boundaries need enforcement.
D:A global ban may be disproportionate when edits are legitimate elsewhere. Scoped restrictions match the requirement better.
Question 165
A path rule intended for nested files matches only the immediate directory and misses deeper paths. What should the engineer review?
- The number of tokens in the path's filename
- The model's knowledge of the programming language
- Check whether the glob covers nested directories
- The repository's package version number
Explanation
Correct Answer
C:Glob syntax determines coverage. Adjusting the selector is more reliable than repeating instructions at every missed file.
Incorrect Answers
A:Token counts are unrelated to directory matching semantics. A correct recursive pattern is required.
B:Language knowledge does not affect whether a path pattern matches a file. The failure occurs in rule selection.
D:Version numbers may matter to code behavior but do not usually explain a nonrecursive path selector.
Question 166
A developer asks Claude Code to propose a risky database refactor but explicitly forbids edits until approval. Which mode should be used first?
- An unrestricted execution mode that applies edits while reasoning
- A prompt to claim no changes while using write tools anyway
- Plan mode to inspect and design without immediately modifying the project
- A deploy command that runs before any plan exists
Explanation
Correct Answer
C:Planning separates investigation and proposed steps from execution. The developer can review dependencies before approving changes.
Incorrect Answers
A:Premature mutations violate the no-edit constraint. A safe proposal stage is required.
B:Concealing writes would breach the requirement. Actual tool permissions and workflow state must match the planning phase.
D:Deployment is a side effect and does not help obtain approval of the refactor. It creates risk before design review.
Question 167
A maintainer has approved a patch and now wants Claude Code to implement and test it. Which transition is appropriate?
- Skip tests because an earlier design was reviewed
- Publish the proposed patch as though it had been applied
- Stay indefinitely in a mode that cannot modify files
- Leave planning for authorized execution and verification
Explanation
Correct Answer
D:Once the work is approved, edit tools and test commands can be used within the agreed scope. The final report should include evidence of tests.
Incorrect Answers
A:Planning approval does not prove the final edit works. Execution needs validation of actual results.
B:A plan is not an on-disk change. Users need accurate implementation status.
C:Read-only planning cannot deliver an approved code change. The workflow must permit the necessary controlled writes.
Question 168
A developer wants to understand an unfamiliar microservice before choosing implementation changes. Which initial workflow is strongest?
- Inspect dependencies using a read-only planning workflow
- Ask Claude to hallucinate a likely directory structure
- Deploy the service to discover what its code does
- Refactor the first file returned by search immediately
Explanation
Correct Answer
A:Discovery reduces mistakes and produces a grounded strategy. Modification can follow when the relevant files and tests are understood.
Incorrect Answers
B:The current repository provides more reliable evidence than guesses. Read tools should be used.
C:Deployment is a poor substitute for controlled inspection and may expose unwanted behavior.
D:Early mutation lacks evidence about ownership and integration. It can introduce regressions or miss the real issue.
Question 169
A request asks only for an estimate and migration steps, not for execution. What is the correct agent behavior?
- Delete legacy scripts before analyzing dependencies
- Modify code to demonstrate initiative
- Provide assumptions, risks and verification in a plan
- Create production resources so the estimate is realistic
Explanation
Correct Answer
C:The output should be a reviewable proposal. Executing mutations would exceed the user's request.
Incorrect Answers
A:Destructive cleanup is neither required nor safe at the planning stage. The impact has not been established.
B:Initiative does not authorize file changes when the task is explicitly planning only. Side effects should wait for approval.
D:Provisioning resources can incur cost and changes state. The request seeks analysis, not deployment.
Question 170
A team needs to review an edit's side effects before code changes are made. Which planning artifact is most useful?
- A single statement saying all changes will be safe
- A generated final commit that exists before edits are reviewed
- A file-by-file plan with tests, rollback and dependencies
- An unrelated list of framework trends
Explanation
Correct Answer
C:A concrete proposal exposes risk before implementation. Reviewers can challenge the scope and validation plan.
Incorrect Answers
A:Unsupported assurance contains no implementation details or test criteria. It cannot support meaningful approval.
B:Committing mutations defeats the requested pre-change gate. Approval should precede file modification.
D:General trends do not show the effect of the proposed repository changes. The plan must be project-specific.