Skip to content

[BUG] Invalid YAML syntax in claude/rules frontmatter paths property #13905

@mkobit

Description

@mkobit

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 paths field."

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:

  1. Tooling Breakage: Standard parsers fail to validate these files, breaking any CI/CD pipelines and automation.
  2. 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

  1. Navigate to the documentation section: Modular rules with claude/rules/(https://code.claude.com/docs/en/memory#modular-rules-with-claude%2Frules%2F)
  2. Copy the provided examples for the paths frontmatter.
  3. Attempt to parse them with any standard YAML parser or paste into an online YAML parser
  4. 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workingdocumentationImprovements or additions to documentationhas reproHas detailed reproduction steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions