Foundation

Rule File

A conditional instruction file that CLAUDE.md loads based on path patterns, scoping rules to specific domains without bloating the root config.

Rule files are the modular layer beneath CLAUDE.md. Each file contains a paths array (e.g., ["14_newsletters/**"]) that tells Claude when to load it. A repository with 8 workstreams might have 12-15 rule files, each under 100 lines, covering finance confidentiality, newsletter HTML patterns, consulting deliverable standards, and git safety. The key benefit is separation of concerns: updating newsletter rules does not risk breaking consulting rules. Rule files also carry validation rigor metadata (LOW/MEDIUM/HIGH) so quality gates scale appropriately per domain.

Where it shows up:

CLAUDE.md architectureDomain-specific instructionsMulti-workstream reposOnboarding new domains

Build your Knowledge OS

90 minutes from zero to your first skill chain.