Claude Rules
Claude Rules
Claude Rules allows you to organize instructions into multiple files for larger projects.
your-project/
├── .claude/
│ ├── CLAUDE.md # Main project instructions
│ └── rules/
│ ├── code-style.md # Code style guidelines
│ ├── testing.md # Testing conventions
│ └── security.md # Security requirements
- Each file should cover one topic, with a descriptive filename.
- Rules without paths frontmatter are loaded at launch with the same priority as
.claude/CLAUDE.md. - Rules can be scoped to specific files using YAML frontmatter with the
pathsfield. - You can use symlinks to share rules across projects.
Example scoped rule file:
---
paths:
- "src/api/**/*.ts"
---
# API Development Rules
- All API endpoints must include input validation
- Use the standard error response format
- Include OpenAPI documentation comments
Related: CLAUDE.md Files, Top Level CLAUDE.md