[BUG] Claude Code CLI `paths` handling in `.claude/rules/*.md`
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When I configure a rule file under .claude/rules/*.md with multiple entries in the paths array, Claude Code CLI does not handle them correctly.
It appears that only one path is honored; adding a second (or more) path entries causes the rule to not be applied as expected to all files.
Concretely, I have a rule like:
paths:
- "applet/src/manifest.json"
- "applet/src/pages.json"
In practice, only one of these files behaves as if the rule is applied; the other one is effectively ignored (no rule behavior is triggered there).
What Should Happen?
Claude Code should support multiple entries in the paths array for .claude/rules/*.md rule files.
With the configuration above, the same rule should be applied consistently to both:
applet/src/manifest.jsonapplet/src/pages.json
without needing any workaround like splitting into multiple rule files.
Error Messages/Logs
There is no explicit CLI error or stack trace in this case.
The CLI runs normally; the bug is in the behavior: only one of the configured `paths` is actually affected by the rule, while the other path behaves as if the rule were not present.
Steps to Reproduce
- Create or edit a rule file under
.claude/rules/, for example:
.claude/rules/rule-uniapp3-config.md
- Configure the
pathsfield with at least two entries, for example:
```yaml
paths:
- "applet/src/manifest.json"
- "applet/src/pages.json"
```
- Run Claude Code CLI in this repository and trigger behavior that should apply this rule (for example, commands that read/apply rules for these files).
- Observe that only one of the files behaves as if the rule is applied; the other file does not appear to be affected by the rule at all.
- If you reduce
pathsto a single entry (e.g. justapplet/src/manifest.json), the rule behaves as expected for that one file.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.47
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
- I have read the official documentation, and I did not find any statement that
pathsshould only contain a single entry. - The configuration works as expected when
pathscontains only one entry. - I also considered whether using a glob pattern (such as
applet/src/*.jsonorapplet/src/{manifest,pages}.json) would be the intended way to support multiple files, but the documentation suggests thatpathsas an array should be valid and therefore this appears to be a bug in how multiple entries are handled.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗