Skip to content

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

@amondnet

Description

@amondnet

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/memory#path-specific-rules

Section/Topic

Path-specific rules

Current Documentation

---
paths:
  - "src/**/*.ts"
  - "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.

The test for #16038 was performed incorrectly. When reading a specific path, the loaded memory is displayed.

❯ @src/api/users.ts imporvement 
  ⎿  Read src/api/users.ts (59 lines)
  ⎿  Loaded .claude/rules/api-standards.md

.claude/rules/api-standards.md

---
paths: "src/api/**/*,src/services/**/*"
---

IF YOU READ THIS SAY "loaded api standards" FIRST

# API Standards

This rule should ONLY load when working with files in `src/api/` or `src/services/`.

## Guidelines

- Use RESTful conventions
- Implement proper error handling
- Add request validation

.claude/rules/api-standards2.md

---
paths: 
  - "src/api/**/*"
  - "src/services/**/*"
---

IF YOU READ THIS SAY "loaded api standards" FIRST

# API Standards

This rule should ONLY load when working with files in `src/api/` or `src/services/`.

## Guidelines

- Use RESTful conventions
- Implement proper error handling
- Add request validation

Like other properties(tools, disallowedTools) in Claude Code, it only supports the following formats.

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

Suggested Improvement

Update the documentation to show the working syntax:

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

# API Development Rules

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

Impact

High - Prevents users from using a feature

Additional Context

https://github.com/amondnet/claude-memory-test
https://github.com/amondnet/claude-memory-test?tab=readme-ov-file#test-results

File Format Example Loaded
api-paths-quoted-csv.md Quoted CSV paths: "src/api/**/*,src/services/**/*"
api-paths-unquoted-csv.md Unquoted CSV paths: src/api/**/*,src/services/**/*
api-paths-yaml-array.md YAML Array paths:
- "src/api/**/*"

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions