-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
The documentation for modular rules(https://code.claude.com/docs/en/memory#modular-rules-with-claude%2Frules%2F) states:
"Rules can be scoped to specific files using YAML frontmatter with the
pathsfield."
However, the examples provided are invalid YAML.
The Issue:
Glob patterns starting with { or * are reserved indicators in YAML and cannot be used unquoted at the start of a value.
Invalid Examples (from docs):
---
paths: {src,lib}/**/*.ts
------
paths: **/*.ts
---These both fail on parsing pasting into any online parser.
Impact:
- Tooling Breakage: Standard parsers fail to validate these files, breaking any CI/CD pipelines and automation.
- GitHub Rendering: GitHub cannot parse the frontmatter, breaking syntax highlighting and making diff reviews more tedious
What Should Happen?
Claude code and the documentation should usevalid YAML examples by using quoted strings for these patterns.
Error Messages/Logs
Steps to Reproduce
- Navigate to the documentation section: Modular rules with claude/rules/(https://code.claude.com/docs/en/memory#modular-rules-with-claude%2Frules%2F)
- Copy the provided examples for the
pathsfrontmatter. - Attempt to parse them with any standard YAML parser or paste into an online YAML parser
- Observe syntax errors regarding invalid flow mappings or undefined aliases.
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
No response
Claude Code Version
recent versions supporting rules
Platform
Anthropic API
Operating System
Other
Terminal/Shell
Other
Additional Information
Beyond the syntax error, the current paths implementation uses an obtuse pattern for defining lists by relying on a single string with comma-separated values:
paths: pathA, pathB
This effectively treats YAML as a dumb text container and forces the application to implement custom string splitting logic.
Suggestion:
Support and document standard YAML Sequences. This is more readable, robust, and requires no custom parsing logic.
paths:
- "src/**/*.ts"
- "tests/**/*.test.ts"