Summary
The documentation for .claude/rules/ frontmatter is incorrect or incomplete. After extensive testing, the documented paths: format does not work in several configurations, while the undocumented globs: format works reliably.
Environment
- Claude Code CLI
- WSL2 (Linux on Windows)
- Project with
.claude/rules/ directory containing multiple rule files
Testing Methodology
Created multiple test files with different frontmatter formats and checked /memory output:
| Format |
Loads? |
| No frontmatter (unconditional) |
YES |
globs: "**/*.cs" |
YES |
paths: **/*.cs (unquoted) |
YES |
paths: "**/*.cs" (quoted) |
NO |
paths: + YAML list |
NO |
Expected Behavior
Based on documentation and GitHub issues, this should work:
---
paths:
- "**/*.cs"
- "**/Controllers/**"
---
Actual Behavior
Only these formats work:
---
globs: **/*.cs, **/Controllers/**
---
Impact
Users following the documentation will have non-functional path-scoped rules with no error messages indicating why rules are not loading. This is a silent failure that is very difficult to debug.
Suggested Fix
- Update documentation to show the working format (
globs:)
- Or fix the parser to support the documented
paths: formats
Workaround
Use globs: with comma-separated unquoted patterns:
---
globs: pattern1, pattern2, pattern3
---
Summary
The documentation for
.claude/rules/frontmatter is incorrect or incomplete. After extensive testing, the documentedpaths:format does not work in several configurations, while the undocumentedglobs:format works reliably.Environment
.claude/rules/directory containing multiple rule filesTesting Methodology
Created multiple test files with different frontmatter formats and checked
/memoryoutput:globs: "**/*.cs"paths: **/*.cs(unquoted)paths: "**/*.cs"(quoted)paths:+ YAML listExpected Behavior
Based on documentation and GitHub issues, this should work:
Actual Behavior
Only these formats work:
Impact
Users following the documentation will have non-functional path-scoped rules with no error messages indicating why rules are not loading. This is a silent failure that is very difficult to debug.
Suggested Fix
globs:)paths:formatsWorkaround
Use
globs:with comma-separated unquoted patterns: