Path-scoped markdown files in the .claude/rules/ directory that provide modular, conditional instructions to Claude Code based on which files the model is working with.
↑ ContentsDefinition
In Anthropic’s terminology, rules are modular markdown files in .claude/rules/ that can be scoped to specific file paths using glob patterns in YAML frontmatter. Rules without a paths field load at session start; path-scoped rules load on demand when the model reads matching files. Rules are distinct from instructions (CLAUDE.md files loaded by directory hierarchy) — they solve the scaling problem of monolithic CLAUDE.md by making context conditional. Like instructions, rules are passive: they are loaded into context but the model may not follow them. For enforcement, see hooks.
↑ Contents