100% Latest & Updated Anthropic CCA-F Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 260
A repository uses strict tests in files matching tests/**/*.py, but production source edits should not inherit those assertions. Which safeguard or workflow change provides the missing guarantee?
- Put the test convention into a path-scoped .claude/rules entry with matching globs.
- Validate rule metadata and effective matching rather than assuming filesystem presence is enough.
- Exclude generated artifacts from rules intended for maintained source files.
- Normalize rule globs to the path syntax used by the runtime and test matches.
- Update the path glob and verify representative new files activate the rule.
Explanation
Correct Answer
A:A path-scoped .claude/rules entry can bind the strict testing convention to tests/**/*.py without applying it to production source files. Verify the rule is active on representative test paths and inactive on ordinary source code. Root-level blanket guidance would overapply the rule.
Incorrect Answers
B:Rule metadata validation detects whether conditional settings parse, but it does not establish that the requirement is restricted to test files. A syntactically valid global rule can still incorrectly affect production changes. Scope the instruction to the specified test-file glob.
C:Excluding generated code is an independent hygiene rule, but the stated boundary is between test files and production source. Generated-file exclusions do not keep a strict test assertion from being applied to maintained application modules outside tests/.
D:Normalized glob syntax helps conditional rule matching work correctly, yet a correct matcher alone requires the intended content and location. The key design is to place the convention in a path-scoped rule applying to tests/**/*.py and validate examples.
E:Updating a stale glob would be necessary if tests had moved, but no move is described. The stated problem is unwanted application of test rules to production code. Add a scoped rule with the exact test-tree pattern instead of relying on universal instructions.
Question 261
A security rule intended for config/**/*.yaml never runs for nested .yml files. Which response is best supported by these operational facts?
- Narrow the glob to the actual API documentation directories.
- Add .yml to the pattern but retain a path prefix that does not include the configuration directories.
- Use an appropriate recursive glob and test representative nested files.
- Include the actual target extensions and directory paths in its glob.
Explanation
Correct Answer
D:Include both relevant extensions and the repository’s real configuration directories in the path pattern, then exercise representative nested .yml and .yaml files to verify the rule activates.
Incorrect Answers
A:Narrowing a rule to API documentation is unrelated to a security policy intended for configuration files; it would miss even more relevant YAML locations.
B:Adding an extension alternative to a glob rooted in the wrong directory still misses the protected nested configuration files. Both path and suffix must be covered by the effective rule.
C:A recursive pattern helps match nested directories, but without adding .yml it still excludes files with that actual extension.
Question 262
A code reviewer applies TypeScript formatting guidance to Python files because all rules are always loaded. Which design adjustment is most suitable under the stated constraints?
- Include both extensions in the applicable path patterns and verify coverage.
- Put TypeScript-specific formatting rules into root guidance and force them on all Python files as well.
- Scope the TypeScript rule to its relevant file path patterns.
- Run a targeted configuration test using a matching file path and verify expected behavior.
Explanation
Correct Answer
C:Use a scoped .claude/rules file or equivalent path-matching mechanism limited to TypeScript source patterns, and verify Python paths do not activate it. This separates common repository rules from language-specific formatting instructions that would produce invalid Python edits.
Incorrect Answers
A:Including TypeScript and Python extensions in one formatting rule would apply the TypeScript convention to Python code, which is exactly the mistake being observed. Keep the language-specific instruction limited to matching TypeScript paths, not a wider extension set.
B:A root rule forced onto all source languages repeats the configuration error. General architecture guidance may belong globally, but TypeScript syntax and formatting tools do not. The language-specific convention needs conditional activation.
D:Testing one TypeScript file can demonstrate that a rule activates but does not prove it stays inactive for Python files. Include negative path tests and correct the glob itself. The control is a path-restricted rule, not merely a successful positive match.
Question 263
A frontend rule applies only at src/components/* and misses deeper nested component directories. What targeted change avoids repeating this failure?
- Include the actual target extensions and directory paths in its glob.
- Use an appropriate recursive glob and test representative nested files.
- Keep src/components/* and verify only direct children, without checking deeper nested component files.
- Narrow the glob to the actual API documentation directories.
Explanation
Correct Answer
B:Use the supported recursive glob semantics for paths below src/components and verify examples two or more levels deep. This ensures the rule applies to nested components rather than only immediate children.
Incorrect Answers
A:Adding extensions or directory names is useful when those are missing, but the present issue is depth: a one-level components/* selector does not cover nested subdirectories.
C:Updating the pattern only for src/components/* leaves deeper directories excluded, even if a test of immediate files succeeds. The fix must actually extend the matched path depth.
D:A docs-only glob serves documentation policies, not frontend component rules. Narrowing to API documentation would remove coverage from the intended source tree.
Question 264
A team has a rule applying to two distinct test directories with identical requirements. Which corrective action most directly addresses the observed failure?
- Define explicit paths covering both locations rather than duplicate contradictory instructions.
- Narrow the glob to the actual API documentation directories.
- Use an appropriate recursive glob and test representative nested files.
- Normalize rule globs to the path syntax used by the runtime and test matches.
Explanation
Correct Answer
A:List or pattern-match the two intended test directories in the rule’s path scope, avoiding two copied instructions that can diverge over time. Verify representative files from each directory receive identical guidance.
Incorrect Answers
B:Narrowing to API documentation would exclude the requested test directories and could accidentally drop the rule from both sites.
C:A recursive glob solves depth coverage inside one subtree, but need not include the second distinct test directory unless both explicit path roots are represented.
D:Normalizing glob syntax prevents matcher bugs, but does not by itself express the desired inclusion of two distinct directories with one policy.
Question 265
A monorepo stores database migration rules at the root for every source file. Which implementation choice best closes the specific gap described?
- Place migration conventions in a scoped rule for migration file paths.
- Keep all database migration constraints in the root CLAUDE.md so they load for every package and file.
- Put the test convention into a path-scoped .claude/rules entry with matching globs.
- Scope the TypeScript rule to its relevant file path patterns.
- Validate rule metadata and effective matching rather than assuming filesystem presence is enough.
Explanation
Correct Answer
A:Use a path-scoped .claude/rules entry whose frontmatter matches migration directories or file patterns. Claude Code loads these rules when working with relevant files, avoiding unrelated database instructions during UI or service edits. Keep essential global project behavior in the root instructions, but apply migration conventions at the correct path boundary.
Incorrect Answers
B:A root CLAUDE.md file loads broad guidance for the project; storing migration-only constraints there repeats the reported scope problem. Frontend and documentation tasks then inherit irrelevant database instructions, consuming attention and causing inconsistent behavior. Move migration conventions into matching conditional rules.
C:A path-scoped test convention is a valid pattern for test files, but it does not target the migration paths specified in this case. The schema and review requirements for database migrations need their own conditional rule. Define the matching migration glob instead of solving an unrelated test-rule placement issue.
D:A TypeScript-only rule can apply narrowly to source files but does not necessarily match SQL, migration scripts or database directories. The scenario is about DB migration constraints being loaded everywhere, not a TypeScript coding style problem. Scope rules to actual migration file paths.
E:Checking metadata and globs is important because a rule placed in .claude/rules is useful only when its path patterns match. Validation alone cannot solve the issue if the substantive rule still resides in root CLAUDE.md. Relocate the migration instruction and then test matching and nonmatching files.
Question 266
A YAML frontmatter pattern contains a Windows backslash and does not match repository paths. Which architecture decision would most directly meet the stated requirement?
- Put the test convention into a path-scoped .claude/rules entry with matching globs.
- Update the path glob and verify representative new files activate the rule.
- Normalize rule globs to the path syntax used by the runtime and test matches.
- Include the actual target extensions and directory paths in its glob.
Explanation
Correct Answer
C:Use forward-slash repository-relative path syntax or the documented normalized matcher form, and validate both matching and nonmatching examples. This ensures the intended YAML rule fires in the actual runtime.
Incorrect Answers
A:Moving a convention into path-scoped rules can be appropriate, but an incorrectly escaped backslash pattern remains broken even in a different instruction file.
B:Changing the glob without testing representative matches risks assuming the fix worked. The specific error is path syntax incompatibility, so normalize it and run effective-rule checks.
D:Adding extensions and directories is useful only after the matcher syntax is correct. A Windows backslash might continue preventing matches regardless of target extension.
Question 267
A critical rule about secrets must apply to all files, but engineers restrict it to src/*.ts. What should the team change first to resolve this exact failure mode?
- Keep general architectural guidance in a global instruction and file-specific details in conditional rules.
- Keep truly universal security prohibitions at global scope while scoping only narrower details.
- Scope the TypeScript rule to its relevant file path patterns.
- Use an appropriate recursive glob and test representative nested files.
Explanation
Correct Answer
B:Keep the secrets prohibition in global project instructions or policy enforcement, applying narrower file-specific details only where appropriate. A `src/*.ts` filter cannot cover configuration, scripts or documentation that also contain credentials.
Incorrect Answers
A:Global architecture advice can coexist with narrower path rules, but moving a universal secrets policy into a conditional file rule allows other file types to bypass it.
C:A TypeScript glob can be appropriate for TypeScript-only formatting, but the rule here protects secrets in *all* files. Reinforcing the same narrow scope perpetuates the gap.
D:A recursive glob could cover nested TypeScript files, but it still excludes non-TypeScript files carrying secrets. Universal requirements must not depend on that language-specific match.
Question 268
A path-specific rule is triggered only when a matching file is edited, but the team expects it for a broad architecture discussion. Which safeguard or workflow change provides the missing guarantee?
- Keep general architectural guidance in a global instruction and file-specific details in conditional rules.
- Run a targeted configuration test using a matching file path and verify expected behavior.
- Scope the TypeScript rule to its relevant file path patterns.
- Validate rule metadata and effective matching rather than assuming filesystem presence is enough.
Explanation
Correct Answer
A:A path-scoped instruction normally activates when relevant files are read or edited, so it may be absent from a general architectural discussion with no matching path. Put genuinely repository-wide architectural guidance in a global CLAUDE.md or equivalent; keep code-specific rules conditional.
Incorrect Answers
B:A targeted configuration test can confirm activation when a path matches, but it does not change the trigger behavior for a broad discussion without file access. The instruction must move into an always-applicable scope if it is required independent of touched files.
C:Scoping a TypeScript convention is useful for language-specific edits, but the current question concerns guidance expected during a general discussion. Narrowing scope further would make the instruction even less likely to load when no file is touched.
D:Validating syntax and path matching can prove the conditional rule works as designed, but the team’s expectation is inconsistent with that design. A correctly working scoped rule still need not appear in a path-free conversation. Separate truly global guidance from conditional details.
Question 269
A developer adds new generated files under dist/ and unintended rules demand hand edits there. Which response is best supported by these operational facts?
- Apply the maintained-source hand-editing rule to every dist/ artifact in addition to editable source files.
- Add a path rule for unit-test code only, leaving generated bundles under the original broad rule.
- Expand the existing source glob to include more compiled assets and require edits to those files.
- Exclude generated dist/ artifacts from editing instructions intended for developer-maintained source files.
Explanation
Correct Answer
D:The rule should apply only to maintained source locations; generated outputs belong outside its path match. Edit the upstream source or generator when behavior changes, then regenerate artifacts using the normal build.
Incorrect Answers
A:Generated bundles are downstream outputs, so manually editing them is usually lost on the next build and may diverge from version-controlled source. Widening the style rule aggravates the inappropriate hand-edit instruction.
B:Test-specific scoping may be worthwhile independently, but it does not prevent the broad existing rule from matching dist/ and demanding edits to generated files.
C:Extending the match into compiled outputs produces more false work and risks altering artifacts that should come from the build process. The source-focused rule needs narrower applicability, not a larger generated-file scope.
Question 270
A repository changes from lib/ to packages/core/ but path rules are never updated. Which design adjustment is most suitable under the stated constraints?
- Update the path glob and verify representative new files activate the rule.
- Exclude generated artifacts from rules intended for maintained source files.
- Keep only a glob anchored to the removed lib/ folder and assume it still matches packages/core/ files.
- Put the test convention into a path-scoped .claude/rules entry with matching globs.
- Include both extensions in the applicable path patterns and verify coverage.
Explanation
Correct Answer
A:After the code moves from lib/ to packages/core/, the existing path matcher no longer selects affected files. Update the glob to the new directory and test representative files to confirm the intended rule loads. Otherwise Claude Code may silently omit relevant local instructions.
Incorrect Answers
B:Excluding generated artifacts is a valid way to avoid applying source conventions to build output, but no generated-code confusion is described. The problem is an obsolete path root. Correct the path selector rather than changing generated-file handling.
C:An unchanged matcher anchored to lib/ cannot apply to packages/core/ even if the new directory is nested elsewhere. Leaving the path unchanged means the rule silently misses moved files. The rule needs an updated location pattern and a real activation test.
D:Placing a convention in a scoped rule is appropriate, but the question says a scoped rule already exists and its paths are stale. Recreating another rule with the old glob would not load for the new source. Update the existing matcher.
E:File extension matching controls language-specific applicability and may matter after a migration, but the failure is the directory root being renamed. An extension-only change cannot make a lib/-anchored pattern reach packages/core/. Check the actual relocated paths.
Claude Certified Architect - Foundations (CCA-F) Practice Tests