[BUG] paths: frontmatter in user-level rules (~/.claude/rules/) is ignored

Resolved 💬 6 comments Opened Jan 30, 2026 by ucuc Closed Mar 24, 2026

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?

Rules with paths: frontmatter placed in user-level rules directory (~/.claude/rules/) are never loaded, even when working with files that match the specified glob patterns.

Setup:

  • User-level rule file: ~/.claude/rules/csharp-dotnet.md with paths: ["**/*.cs"] frontmatter
  • Project has .cs files

Observation:

  • When editing .cs files, the user-level rule with paths: is NOT loaded
  • The same rule file works correctly when placed in project-level rules (./.claude/rules/)
  • The same rule file also works when symlinked from user-level to project-level rules
  • Rules without paths: frontmatter in ~/.claude/rules/ load correctly (unconditionally)

Verified behavior:
| Location | paths: frontmatter | Result |
|----------|-------------------|--------|
| ~/.claude/rules/ | With paths | ❌ Not loaded |
| ./.claude/rules/ | With paths | ✅ Loaded |
| ./.claude/rules/ | Symlink to user-level | ✅ Loaded |

What Should Happen?

User-level rules with paths: frontmatter should be loaded when working with files that match the specified glob patterns, just like project-level rules.

According to the documentation:

User-level rules: You can create personal rules that apply to all your projects in ~/.claude/rules/

The paths: frontmatter should work consistently regardless of whether the rule is placed in user-level or project-level rules directory.

Error Messages/Logs

No error messages. The rules are silently not loaded. Running `/memory` shows the user-level rule with `paths:` is not listed in the loaded memory files.

Steps to Reproduce

  1. Create a user-level rule file with paths: frontmatter:

```bash
mkdir -p ~/.claude/rules
cat > ~/.claude/rules/csharp-rules.md << 'EOF'
---
paths:

  • "**/*.cs"

---

# C# Rules

  • Follow C# naming conventions

EOF
```

  1. Create a project with a .cs file:

``bash
mkdir test-project && cd test-project
echo 'public class Test { }' > Test.cs
``

  1. Start Claude Code: claude
  1. Run /memory - observe that csharp-rules.md is NOT listed
  1. Edit the .cs file: ask Claude to "Read Test.cs"
  1. Run /memory again - the rule is still NOT loaded
  1. Workaround test: Copy the same rule to project-level:

``bash
mkdir -p .claude/rules
cp ~/.claude/rules/csharp-rules.md .claude/rules/
``

  1. Restart Claude Code and edit the .cs file
  1. Run /memory - now the rule IS loaded

This confirms paths: works in project-level rules but not in user-level rules.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.25

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Workaround:
Using symlinks from project-level rules to user-level rules works:

# In project directory
mkdir -p .claude/rules
# On Windows (requires admin):
mklink ".claude\rules\csharp-rules.md" "C:\Users\username\.claude\rules\csharp-rules.md"
# On macOS/Linux:
ln -s ~/.claude/rules/csharp-rules.md .claude/rules/

Related issues:

  • #16853 - Path-scoped rules in .claude/rules/ not automatically loaded (project-level)
  • #17204 - Documentation: frontmatter format issues

This issue is different from the above as it specifically affects user-level rules (~/.claude/rules/), not project-level rules.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗