Skip to content

Documentation: .claude/rules/ frontmatter format incorrect - globs works, paths with quotes/YAML list does not #17204

Description

@dheeraj5612

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

  1. Update documentation to show the working format (globs:)
  2. Or fix the parser to support the documented paths: formats

Workaround

Use globs: with comma-separated unquoted patterns:

---
globs: pattern1, pattern2, pattern3
---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions