[DOCS] `paths:` frontmatter syntax in rules files is incorrect

Status Fixed / completed
Reported on v2.0.76
Maintainer reply ✓ Yes — sarahdeaton
Activity 3 comments · opened Jan 2, 2026 · closed Jan 11, 2026
💡 Likely answer: A maintainer (sarahdeaton, collaborator) responded on this thread — see the highlighted reply below.

Documentation Type

Incorrect/outdated documentation

Documentation Location

_No response_

Section/Topic

Path-specific rules (paths: YAML frontmatter in .claude/rules/*.md files)

Current Documentation

The docs currently say:

"Rules can be scoped to specific files using YAML frontmatter with the paths field."

With this example:

---
paths: src/api/**/*.ts
---

And additional examples showing:

  • Brace expansion: paths: src/**/*.{ts,tsx}
  • Comma-separated: paths: {src,lib}/**/*.ts, tests/**/*.test.ts

What's Wrong or Missing?

The documented string syntax does not work. Rules using this syntax silently fail to load.

Tested and verified: Only YAML array syntax works.

Reproduction

  1. Create ~/.claude/rules/test-string.md:
---
paths: src/**/*.ts
---
# Test String
MARKER_STRING
  1. Create ~/.claude/rules/test-array.md:
---
paths:
  - "src/**/*.ts"
---
# Test Array
MARKER_ARRAY
  1. Create test project with matching files:
mkdir -p /tmp/test-project/src
echo "const x = 1;" > /tmp/test-project/src/app.ts
  1. Check which rules load:
cd /tmp/test-project
claude --print "Which MARKERS do you see? MARKER_STRING or MARKER_ARRAY?"

Result: Only MARKER_ARRAY loads. The documented string syntax is ignored.

Full test matrix

| Syntax | Loaded? |
|--------|---------|
| paths: src/**/*.ts | NO |
| paths: src/**/*.{ts,tsx} | NO |
| paths: {src,lib}/**/*.ts, tests/**/*.test.ts | NO |
| paths: **/*.test.ts | NO |
| paths:\n - "src/**/*.ts" | YES |

Suggested Improvement

Update the documentation to show the working YAML array syntax:

---
paths:
  - "src/api/**/*.ts"
---

# API Development Rules

- All API endpoints must include input validation
- Use the standard error response format

For multiple patterns:

---
paths:
  - "src/**/*.ts"
  - "src/**/*.tsx"
  - "lib/**/*.ts"
---

Or fix the implementation to accept the documented string syntax.

Impact

High - Prevents users from using a feature

Additional Context

  • Claude Code version: 2.0.76
  • Platform: Anthropic API
  • OS: macOS (Darwin 25.1.0)
  • Terminal: VS Code integrated terminal
  • Tested: 2026-01-01

Note: claude --debug shows hooks, skills, and permissions loading, but does not show rules file loading or paths: frontmatter evaluation. Adding debug output for rules loading would help users troubleshoot this.

View original on GitHub ↗

3 Comments

github-actions[bot] · 9 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/13905

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

sarahdeaton collaborator · 9 months ago

Thank you for reporting this! We've updated the docs to the correct syntax.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.