Question 30
A monorepo has Python backend rules and TypeScript frontend rules. Putting both complete rule sets into every task causes confusion. Which organization is most appropriate?
- Use path-scoped rules for the relevant directories and retain only shared guidance globally.
- Put backend rules in each developer's global user instructions and frontend rules in shared project instructions.
- Keep both complete rule sets global and add a sentence telling Claude to choose whichever seems relevant.
- Choose one language's complete rules as the global standard for both directories.
Explanation
Correct Answer
A:Scope-specific instructions associate conventions with the files they govern. This reduces irrelevant context while preserving a consistent baseline for cross-cutting work.
Incorrect Answers
B:User scope applies across unrelated projects and varies between developers. Language-specific repository rules should be selected by project paths, not by who owns the local configuration.
C:This retains the irrelevant context that caused the problem. Explicit path scoping gives a more reliable association between each convention and the files it governs.
D:Some conventions are language-specific and cannot govern the other component correctly. A single global language policy loses the distinction that the monorepo needs.
Question 31
A developer has a non-secret test endpoint used only in one repository. Claude Code should remember it for that developer, but it must not become shared team guidance or affect other projects. Which placement fits?
- Commit the endpoint in the repository's shared CLAUDE.md.
- Add the endpoint as an unconditional instruction in the developer's global CLAUDE.md.
- Keep it in local project guidance excluded from version control.
- Add the endpoint to a centrally managed organization instruction file.
Explanation
Correct Answer
C:Local instructions can carry environment-specific context without changing shared policy. Excluding the file from commits preserves the intended personal scope.
Incorrect Answers
A:A shared instruction file distributes the setting to teammates. That gives a developer-specific endpoint broader scope than intended.
B:User-level instructions follow the developer across projects. An unconditional endpoint there can influence unrelated repositories, violating the project-specific requirement.
D:Managed guidance is intended for organization-wide policy. It is the wrong scope for a single developer's test environment.
Question 32
A PreToolUse hook rejects shell command strings containing /protected/config. A script invoked under another filename can still write that path, and the process has filesystem permission to do so. What change closes this enforcement gap most directly?
- Add more natural-language reminders that scripts should avoid the protected file.
- Check only the script's filename against the same literal path string.
- Detect changes to the protected file in a PostToolUse hook and treat detection as prevention.
- Deny the executing process write access to the protected path through an appropriate filesystem boundary.
Explanation
Correct Answer
D:An effective filesystem restriction applies to writes performed by the script as well as direct commands. It addresses the runtime capability the string-matching hook failed to constrain.
Incorrect Answers
A:Reminders can steer the model but do not constrain the operating-system write performed by the script. The process retains the permission that makes the bypass possible.
B:The script name need not mention the target it modifies. Inspecting that name preserves the same gap between command text and runtime behavior.
C:Detection occurs after the write and may support recovery or alerting. It does not satisfy a requirement to prevent the modification itself.
Question 33
Before a risky repository migration, a team wants Claude Code to inspect the codebase and propose an implementation plan for review, with edits deferred until the plan is accepted. Which workflow best matches this requirement?
- Use print mode alone as proof that the process is read-only.
- Generate a plan in a post-edit hook after each migration change.
- Use Plan Mode for investigation and a proposed plan, then explicitly transition to implementation after review.
- Start in an edit-permitting mode and use the generated diff as the first planning artifact.
Explanation
Correct Answer
C:Planning separates exploratory analysis from implementation. The team can evaluate the approach before authorizing the editing stage, while continuing to enforce its ordinary execution controls.
Incorrect Answers
A:Noninteractive output behavior is separate from tool permissions. Print mode does not itself establish that tools cannot edit the repository.
B:A post-edit check can document completed actions but reverses the requested review order. It cannot defer a change that has already happened.
D:A diff can be reviewed, but producing it already changes files. The requested sequence calls for investigation and plan review before those edits occur.
Question 34
An extraction response conforms to the required JSON schema, but its invoice total does not match the source document. What does this demonstrate?
- Requiring the model to repeat the total twice is sufficient evidence that it matches the invoice.
- Setting the sampling temperature to its lowest supported value makes source comparison unnecessary.
- Structural conformity and factual correctness require different checks.
- Schema validation must have been skipped because a valid schema would prove the number came from the invoice.
Explanation
Correct Answer
C:A schema can constrain fields and types without proving that a value was extracted faithfully. The application should verify critical values against source evidence and applicable business rules.
Incorrect Answers
A:Agreement between two generated fields can reveal internal consistency. It does not establish that either occurrence matches the original document.
B:Lower sampling variability does not verify a value against evidence. A consistently generated wrong total remains wrong.
D:A number can satisfy the schema while being copied from the wrong field or inferred incorrectly. Source fidelity is a separate property from structural validity.
Question 35
A contract extractor must report a termination date, but some contracts contain no termination date. Which instruction best prevents fabricated dates while retaining a usable output contract?
- Copy the effective date into the termination field without distinguishing the two.
- Use a schema default containing a standard one-year termination date whenever the field is absent.
- Use an explicit missing-value representation permitted by the schema and require supporting evidence for populated dates.
- Use an empty string even though the consumer accepts only dates or null.
Explanation
Correct Answer
C:A declared null or missing status preserves the distinction between unavailable and observed information. Evidence checks discourage filling a required business field with an unsupported guess.
Incorrect Answers
A:The dates describe different events. Reusing an available date hides missing evidence and can create a materially false record.
B:A default can be useful for application settings, but it would create a contractual fact absent from the document. The extractor must preserve missing evidence instead of substituting a conventional term.
D:An empty string is neither a valid date nor the agreed missing-value representation. Uncertainty should be encoded in the schema-supported form that the consumer understands.
Question 36
A classifier frequently confuses refund requests with payment-status inquiries. The existing examples contain only clear refund cases. What is the most targeted prompt improvement?
- Balance the number of labels in the examples but leave every example far from the confusing boundary.
- Add refund examples from more industries while continuing to omit payment-status inquiries.
- Add many more copies of the same obvious refund example.
- Add representative examples of both classes, including ambiguous wording with explanations of the intended distinction.
Explanation
Correct Answer
D:Boundary-focused examples demonstrate which evidence should control the classification. They address the observed confusion more directly than adding redundant easy cases.
Incorrect Answers
A:Class balance helps avoid skew but does not by itself teach subtle intent distinctions. The observed failures require examples of the language that separates the adjacent classes.
B:Broader surface variety can improve coverage within the refund class. It still does not demonstrate the boundary with the class that is being confused.
C:Repeated easy cases add little information about the decision boundary. The confusion involves a neighboring class absent from the examples.
Question 37
A prompt contains task instructions, examples, and a document to extract from. Claude sometimes treats an example as part of the document. Which prompt change most directly clarifies the intended sections?
- Repeat the extraction instruction after each paragraph of the document while leaving the examples unlabeled.
- Rename every tag to a generic label such as text and preserve the same ambiguous arrangement.
- Give instructions, examples, and source text distinct descriptive delimiters and refer to those sections consistently.
- Put all three sections inside one common tag without separate internal labels.
Explanation
Correct Answer
C:Explicit boundaries help the model identify each section's role. The benefit is clearer prompt organization; the delimiters are not a substitute for validating extracted facts.
Incorrect Answers
A:Repeated instructions increase clutter without marking where examples end and source data begins. The confusion is about section roles rather than the frequency of the instruction.
B:Uniform labels discard the role information needed to distinguish a demonstration from the actual input. Cosmetic markup alone does not resolve the ambiguity.
D:One outer boundary identifies the whole prompt but leaves the ambiguous relationship among instructions, examples, and source text unresolved.
Question 38
A prompt revision improves ten handpicked examples. Before deployment, how should the team determine whether the improvement generalizes?
- Compare old and new prompts on a held-out representative set using predefined quality and failure metrics.
- Evaluate only the examples used to tune the revision and accept it if their average score improves.
- Change the rubric while testing the new prompt and compare its score with the old rubric's score.
- Test the new prompt on easier inputs than those used for the previous prompt.
Explanation
Correct Answer
A:A separate evaluation set reduces tuning bias, while fixed metrics make the comparison interpretable. Including edge cases helps expose regressions hidden by a few favorable demonstrations.
Incorrect Answers
B:That measures fit to the development cases rather than generalization. A held-out comparison is needed to detect regressions outside the tuned examples.
C:Different scoring rules do not provide a controlled before-and-after comparison. The evaluation criteria should be defined consistently for both versions.
D:Changing the input difficulty confounds the comparison. An improvement could result from the test set rather than the prompt revision.
Question 39
A shipment record must have end_date on or after start_date. Both extracted fields are valid ISO dates, but the end date is earlier. Which check directly detects this violation?
- Check that both dates fall within the same calendar year.
- Validate each field against an ISO-date pattern independently.
- Require both fields to be present and reject additional properties.
- Validate the temporal relationship between the parsed dates.
Explanation
Correct Answer
D:Field types alone do not capture every business invariant. Comparing the dates after parsing detects a relationship that is invalid even when each field separately has an acceptable shape.
Incorrect Answers
A:Two dates in the same year can still be reversed. That condition neither expresses nor reliably detects the required chronological invariant.
B:Both fields already satisfy the individual format. A pattern check on either field cannot compare their temporal relationship.
C:Presence and object-shape checks ensure the expected structure. They do not establish ordering between two values that are already present.
Question 40
A policy assistant cites the correct current policy, but an answer sentence attributes a benefit to that policy that its text does not support. Which review step directly detects and corrects this attribution error?
- Verify that the cited URL resolves, then accept every sentence attached to it.
- Confirm that the policy title contains the same keywords as the benefit.
- Add more citations about similar benefits from other organizations.
- Compare the sentence with the cited passages and remove or correct the unsupported attribution.
Explanation
Correct Answer
D:A claim-level support check tests whether the evidence actually establishes the statement. If the policy does not support it, the answer should not present it as that policy's rule.
Incorrect Answers
A:A working link proves source availability, not that the source supports a particular claim. The cited text must be checked against the assertion.
B:Topical relevance is weaker than support for the claim. A policy can mention a benefit category without granting the specific entitlement stated in the answer.
C:Other organizations' rules do not substantiate this policy attribution. More references cannot repair the mismatch between the stated source and the asserted entitlement.