Key points
- The paths field in a rule file's YAML frontmatter holds glob patterns that decide when the rule activates.
- Path-scoped rules load only when a matching file is being edited, cutting irrelevant context and token usage.
- Globs such as **/*.test.tsx match files by naming pattern regardless of directory, which a directory-level CLAUDE.md cannot do.
- A double star () matches any depth, so terraform//* covers every nested module under terraform/.
- The frontmatter decides when the rule loads; the markdown body says what to do.
- Directory-level CLAUDE.md is still the simplest choice when a convention truly belongs to one folder.
Common misconceptions
- "A rules file applies everywhere like CLAUDE.md." With a paths field it applies only to matching files.
- "A directory CLAUDE.md can reach files in other directories." It is bound to its own folder.
- "Rules must be invoked like skills." They load automatically on a path match.
Watch for
- Conventions for scattered files duplicated into many directory-level CLAUDE.md files.
- A root CLAUDE.md that loads every area's conventions into every session.
- Relying on Claude to infer which section of a big file applies instead of matching deterministically.
Practice Task 3.3
Start with the free 10-question check to see where you stand across all five domains. In CCA Prep Studio, 54 practice items cover this task, each tracked toward your mastery score.