Path-Specific Rules
Claude Certified Architect – Foundations (CCAR-F) exam practice questions · 10 flashcards
Question
How do you scope a rule to certain files?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Path-Specific Rules practice questions and answers
- How do you scope a rule to certain files?YAML frontmatter in a .claude/rules/ file with a paths field of glob patterns.
- Example path pattern for test files?"**/*.test.tsx".
- When do path-scoped rules load?Only when editing files matching the pattern.
- Why use path rules instead of directory CLAUDE.md?They apply to files spread across many directories (like all test files).
- What are the benefits of conditional loading?Relevant conventions only, less irrelevant context and fewer tokens.
- Test files are scattered across the codebase and need shared conventions. Best approach?A .claude/rules/ file with a paths glob matching test files.
- Example rule for Terraform files?paths: ["terraform/**/*"] with infrastructure conventions.
- When is a directory CLAUDE.md enough?When conventions apply to one directory tree.
- Can one rule file cover several patterns?Yes, list multiple globs in paths.
- Why not rely on Claude to infer which section applies?Inference is unreliable; explicit path matching is deterministic.