Anthropic CCA-F Practice Test 33
Question 320
A scoped rule header misspells its path key and no longer applies. What should a reviewer inspect?
- Validate the supported rule front matter syntax and expected paths fields
- Narrow the rule's path pattern so generated JSON files are excluded
- Match documentation markdown paths explicitly instead of all source files
- Restrict the rule to Python filename glob patterns and test exclusions
Explanation
Correct Answer
A:Configuration syntax determines whether a rule is loaded. A correct instruction body is ineffective if its metadata is ignored. A misspelled frontmatter key prevents the runtime from recognizing intended path matching. Check the documented syntax and test both a matching SQL path and an unrelated file.
Incorrect Answers
B:Overbroad matching loads irrelevant instructions into tasks. The scenario instead requires a way to fix malformed scoped-rule metadata. Narrowing a rule's file pattern does not fix a misspelled path key that the loader ignores. The first repair is valid documented frontmatter syntax.
C:Content conventions should apply only where intended. The proposed option cannot provide the specific “Validate the supported rule front matter syntax and expected paths fields” behavior that the case requires. A misspelled frontmatter key prevents the runtime from recognizing intended path matching.
D:A Python-only glob is not the root problem when a scoped rule header misspells the path key. Correct and validate the supported YAML frontmatter field first. A perfect filename expression under an unrecognized key will never be applied as intended.
Question 321
A formatter rule encourages manual edits to generated SDK clients despite a no-edit policy. What is a sensible configuration?
- Manually patch generated SDK client files and suppress regeneration warnings
- Validate the supported rule front matter syntax and expected paths fields
- Test representative matching and nonmatching paths against the configured glob patterns
- Define a narrow exclusion or separate generated-code rule explaining regeneration
Explanation
Correct Answer
D:Generated files should normally be changed through their generators or authoritative source inputs rather than patched in place. A path-scoped instruction can explicitly tell the coding agent which generated directories to avoid and where the editable specification lives. This helps the fix survive regeneration and prevents an apparently successful patch from being silently overwritten by the next build.
Incorrect Answers
A:Direct edits to generated clients are discarded and bypass the prescribed regeneration process. Generated API clients normally derive from a schema or generator configuration. Manual edits will be lost during regeneration; fix the source definition and rerun generation and tests instead.
B:Validating frontmatter syntax prevents rules from silently failing to load, but a valid formatter rule can still incorrectly request manual edits to generated SDK clients. Add generated-file exclusions and explicit regeneration guidance, then check that the rule no longer activates for generated paths.
C:Path-based rules are triggered by applicability. The decisive requirement here is to distinguish source files from generated outputs. Pattern testing cannot prevent hand edits to generated SDK output when the actual instructions still direct manual modification. The rule should refer users to generator sources and regeneration steps.
Question 322
Three packages copy identical security rules and changes have become inconsistent. How should the team consolidate?
- Test representative matching and nonmatching paths against the configured glob patterns
- Inspect the actual glob pattern and its match behavior before editing rule content
- Treat scoped-rule changes as policy-affecting modifications requiring peer review
- Move the cross-cutting security requirement to one scoped rule matching all applicable files
Explanation
Correct Answer
D:Duplicate local copies drift and increase upkeep. A shared glob-scoped rule provides one canonical instruction for the covered file set. Use one maintained cross-cutting security rule with a scoped pattern covering all relevant packages. Multiple independent copies drift when an update reaches only one directory.
Incorrect Answers
A:Path-based rules are triggered by applicability. The scenario instead requires a way to centralize truly cross-cutting requirements. Glob tests help prove coverage but leave three copied rule definitions that can still diverge. Consolidate them into one maintained rule for the relevant paths.
B:Inspecting one glob's matching behavior is useful after a rule has been authored, but identical security instructions across three packages should first be centralized. One scoped cross-package rule prevents drift and reduces competing copies of the same constraint.
C:Peer review is important for a security policy change, but the current failure is duplication of an unchanged requirement across packages. Move the common instruction to a single scoped source; apply review controls to that consolidated rule afterward.
Question 323
A YAML rules file loads during edits outside the expected directory. What should be investigated?
- Inspect the actual glob pattern and its match behavior before editing rule content
- Move the cross-cutting security requirement to one scoped rule matching all applicable files
- Test only files inside the expected directory and ignore examples of the rule loading outside that directory
- Define a path-scoped rule in .claude/rules/ using a glob pattern
Explanation
Correct Answer
A:A wildcard can capture more files than intended. Diagnosing path matching avoids rewriting correct security guidance for a scoping defect. Inspect the real glob and its expansion rather than relying on the author’s intended scope. An overbroad pattern can load instructions into files whose code or documentation format they do not govern.
Incorrect Answers
B:Moving shared security guidance to a global scoped rule can reduce duplication, but this YAML rule unexpectedly loads outside its intended directory. Inspect and test the existing matcher and hierarchy first; centralizing it without correcting the pattern could increase unintended coverage.
C:Testing only intended matches would miss the very failure reported: the rule fires in paths outside its expected scope. Inspect the configured glob and test both matching and nonmatching paths, especially those where the rule unexpectedly loads, before changing unrelated instruction text.
D:Creating another scoped rule does not establish why the current YAML rule loads on unrelated paths. Examine its paths frontmatter, glob semantics and actual activated files, then tighten or fix the matcher instead of adding another potentially conflicting file.
Question 324
Python lint rules must apply only to Python sources. Which path-specific rule change should be made?
- Use scoped rule files with a YAML paths matcher for relevant Python paths
- Scope frontend instructions to the relevant UI directory patterns
- Separate global repository guidance from targeted package rule files
- Tighten pattern matching and test which files actually activate the rule
Explanation
Correct Answer
A:Path-scoped rules load guidance only when files match the targeted language or directory. For this situation, the system should use scoped rule files with a YAML paths matcher for relevant Python paths. The factual trigger is python lint rules must apply only to Python sources. Use the smallest applicable editing operation, then inspect the diff and execute focused tests.
Incorrect Answers
B:Narrow path selection avoids applying unrelated conventions to backend database work. The proposed option cannot provide the specific “Use scoped rule files with a YAML paths matcher for relevant Python paths” behavior that the case requires. Path-scoped rules load guidance only when files match the targeted language or directory.
C:Independent path conditions keep cross-cutting policy while allowing local conventions. The direct remedy is “Use scoped rule files with a YAML paths matcher for relevant Python paths”, which the alternative does not itself accomplish. Path-scoped rules load guidance only when files match the targeted language or directory.
D:Overbroad globs defeat conditional configuration and dilute the relevant guidance. Here, python lint rules must apply only to Python sources. Use scoped rule files with a YAML paths matcher for relevant Python paths. Path-scoped rules load guidance only when files match the targeted language or directory.
Question 325
Frontend conventions must not govern a database migration folder. How should matching and rule scope be corrected?
- Separate global repository guidance from targeted package rule files
- Scope frontend instructions to the relevant UI directory patterns
- Tighten pattern matching and test which files actually activate the rule
- Use a recursive path pattern that covers the intended nested files
Explanation
Correct Answer
B:When frontend conventions must not govern a database migration folder, the system should scope frontend instructions to the relevant UI directory patterns. Narrow path selection avoids applying unrelated conventions to backend database work. A claimed edit is not verified until the changed file and validation output have been inspected.
Incorrect Answers
A:Independent path conditions keep cross-cutting policy while allowing local conventions. This is not a substitute for “Scope frontend instructions to the relevant UI directory patterns”; that control is necessary in the stated circumstances. Narrow path selection avoids applying unrelated conventions to backend database work.
C:Overbroad globs defeat conditional configuration and dilute the relevant guidance. Here, frontend conventions must not govern a database migration folder. Scope frontend instructions to the relevant UI directory patterns. Narrow path selection avoids applying unrelated conventions to backend database work.
D:The path matcher must include all intended descendants without expanding into unrelated areas. The direct remedy is “Scope frontend instructions to the relevant UI directory patterns”, which the alternative does not itself accomplish. Narrow path selection avoids applying unrelated conventions to backend database work.
Question 326
A monorepo needs shared rules plus package-specific exceptions. What rule configuration would prevent this mismatch?
- Tighten pattern matching and test which files actually activate the rule
- Use a recursive path pattern that covers the intended nested files
- Separate global repository guidance from targeted package rule files
- Validate the supported metadata syntax and test rule loading
Explanation
Correct Answer
C:A monorepo needs shared rules plus package-specific exceptions. The relevant control is to separate global repository guidance from targeted package rule files. Independent path conditions keep cross-cutting policy while allowing local conventions. Use the smallest applicable editing operation, then inspect the diff and execute focused tests.
Incorrect Answers
A:Overbroad globs defeat conditional configuration and dilute the relevant guidance. The required action is “Separate global repository guidance from targeted package rule files”; the other measure addresses a separate concern. Independent path conditions keep cross-cutting policy while allowing local conventions.
B:The path matcher must include all intended descendants without expanding into unrelated areas. Here, a monorepo needs shared rules plus package-specific exceptions. Separate global repository guidance from targeted package rule files. Independent path conditions keep cross-cutting policy while allowing local conventions.
D:Incorrect rule metadata can cause intended conditional instructions not to load. The proposed option cannot provide the specific “Separate global repository guidance from targeted package rule files” behavior that the case requires. Independent path conditions keep cross-cutting policy while allowing local conventions.
Question 327
An engineer defines a path glob so broad it loads every specialized rule. Which path-specific rule change should be made?
- Use a recursive path pattern that covers the intended nested files
- Validate the supported metadata syntax and test rule loading
- Create a dedicated path-scoped rule rather than appending every rule to global guidance
- Tighten pattern matching and test which files actually activate the rule
Explanation
Correct Answer
D:The relevant control is to tighten pattern matching and test which files actually activate the rule. Overbroad globs defeat conditional configuration and dilute the relevant guidance. This matters when an engineer defines a path glob so broad it loads every specialized rule. A claimed edit is not verified until the changed file and validation output have been inspected.
Incorrect Answers
A:The path matcher must include all intended descendants without expanding into unrelated areas. Here, an engineer defines a path glob so broad it loads every specialized rule. Tighten pattern matching and test which files actually activate the rule. Overbroad globs defeat conditional configuration and dilute the relevant guidance.
B:Incorrect rule metadata can cause intended conditional instructions not to load. The required action is “Tighten pattern matching and test which files actually activate the rule”; the other measure addresses a separate concern. Overbroad globs defeat conditional configuration and dilute the relevant guidance.
C:Targeted loading preserves a concise effective instruction context. This is not a substitute for “Tighten pattern matching and test which files actually activate the rule”; that control is necessary in the stated circumstances. Overbroad globs defeat conditional configuration and dilute the relevant guidance.
Question 328
A rule works for top-level files but not nested subdirectories. How should matching and rule scope be corrected?
- Use a recursive path pattern that covers the intended nested files
- Validate the supported metadata syntax and test rule loading
- Create a dedicated path-scoped rule rather than appending every rule to global guidance
- Use scoped rule files with a YAML paths matcher for relevant Python paths
Explanation
Correct Answer
A:The path matcher must include all intended descendants without expanding into unrelated areas. For this situation, the system should use a recursive path pattern that covers the intended nested files. The factual trigger is a rule works for top-level files but not nested subdirectories. Use the smallest applicable editing operation, then inspect the diff and execute focused tests.
Incorrect Answers
B:Incorrect rule metadata can cause intended conditional instructions not to load. The direct remedy is “Use a recursive path pattern that covers the intended nested files”, which the alternative does not itself accomplish. The path matcher must include all intended descendants without expanding into unrelated areas.
C:Targeted loading preserves a concise effective instruction context. Here, a rule works for top-level files but not nested subdirectories. Use a recursive path pattern that covers the intended nested files. The path matcher must include all intended descendants without expanding into unrelated areas.
D:Path-scoped rules load guidance only when files match the targeted language or directory. This is not a substitute for “Use a recursive path pattern that covers the intended nested files”; that control is necessary in the stated circumstances. The path matcher must include all intended descendants without expanding into unrelated areas.
Question 329
A TypeScript file matches two otherwise valid path-scoped rules: one requires tabs and the other requires spaces. What should maintainers resolve before accepting generated formatting?
- Delete all path-scoped rules so no repository formatting guidance is ever applied
- Resolve the overlap into one authoritative formatting rule, and verify the effective rule on representative matching files
- Retain both conflicting rules and use whichever instruction the model mentions first
- Increase the model token allowance so contradictory rules are likely to cancel each other out
Explanation
Correct Answer
B:Each rule can have valid YAML frontmatter while their simultaneous applicability creates contradictory formatting requirements. Decide which policy governs the overlapping TypeScript paths, update or narrow the rules so only the intended directive applies, and test against a real matching file and the repository formatter. This prevents nondeterministic style changes.
Incorrect Answers
A:Removing every scoped rule discards unrelated, useful repository conventions and still does not establish the required formatting standard. Preserve legitimate rules and isolate the actual overlap, then verify that the effective policy has one consistent tab-or-space requirement.
C:Picking the first instruction the model happens to mention makes the result dependent on incidental loading or reasoning order. Two contradictory matching rules need a deliberate scope or precedence resolution in the repository configuration, followed by formatter verification.
D:A larger context window makes contradictory rules more visible but does not reconcile them. The generated file could alternate between tabs and spaces across runs. Resolve the conflicting path scopes or instructions at the source and validate the output with the project formatter.
Question 330
A repository introduces a new package with its own conventions. Which path-specific rule change should be made?
- Use scoped rule files with a YAML paths matcher for relevant Python paths
- Scope frontend instructions to the relevant UI directory patterns
- Create a dedicated path-scoped rule rather than appending every rule to global guidance
- Separate global repository guidance from targeted package rule files
Explanation
Correct Answer
C:A repository introduces a new package with its own conventions. The relevant control is to create a dedicated path-scoped rule rather than appending every rule to global guidance. Targeted loading preserves a concise effective instruction context. Use the smallest applicable editing operation, then inspect the diff and execute focused tests.
Incorrect Answers
A:Path-scoped rules load guidance only when files match the targeted language or directory. Here, a repository introduces a new package with its own conventions. Create a dedicated path-scoped rule rather than appending every rule to global guidance. Targeted loading preserves a concise effective instruction context.
B:Narrow path selection avoids applying unrelated conventions to backend database work. Here, a repository introduces a new package with its own conventions. Create a dedicated path-scoped rule rather than appending every rule to global guidance. Targeted loading preserves a concise effective instruction context.
D:Independent path conditions keep cross-cutting policy while allowing local conventions. Here, a repository introduces a new package with its own conventions. Create a dedicated path-scoped rule rather than appending every rule to global guidance. Targeted loading preserves a concise effective instruction context.