[Bug] VSCode Extension: User-level rules (~/.claude/rules/) not loading into context
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?
The VSCode extension does not load user-level rules from ~/.claude/rules/ into the context window, despite this feature working correctly in the CLI version.
Investigation findings:
- Rules placed in
~/.claude/rules/(including symlinked directories and top-level.mdfiles) are NOT being loaded into the agent context when using the VSCode extension - The same rules ARE loaded correctly when using Claude Code CLI in the terminal
- Stop hook output is also not visible in the VSCode extension (works in CLI)
Key discovery:
This was confirmed by testing with a simple ~/.claude/rules/test-rule.md file:
- CLI: ✅ Rule loaded and visible in context
- VSCode Extension: ❌ Rule NOT loaded
Documentation reference:
According to the official docs at https://code.claude.com/docs/en/memory:
~/.claude/rules/(user-level) is "Fully supported"- Symlinks are supported for sharing rules across projects
- Subdirectories should be discovered recursively
- No special configuration needed—they work automatically
This discrepancy between documented behavior and actual VSCode extension behavior is blocking users who rely on user-level rules for consistent behavior across projects.
What Should Happen?
The VSCode extension should load user-level rules from ~/.claude/rules/ into the agent context, matching the behavior of the CLI version.
Expected behavior (per documentation):
- All
.mdfiles in~/.claude/rules/should be discovered recursively - Symlinks should be followed for shared rules across projects
- User-level rules should load before project rules (with project rules having higher priority)
- No special configuration should be needed—rules should work automatically
Comparison table:
| Feature | CLI | VSCode Extension |
|---------|-----|-----------------|
| ~/.claude/rules/ loading | ✅ Works | ❌ Broken |
| Plugin bundled rules | ✅ Works | ❌ Broken |
| Stop hook output | ✅ Visible | ❌ Hidden |
Error Messages/Logs
Steps to Reproduce
- Create a test rule file at
~/.claude/rules/test-rule.mdwith any content:
``markdown``
# Test Rule
This is a test rule that should appear in the context.
- Open VSCode with the Claude Code extension installed
- Start a new Claude Code session in VSCode
- Ask Claude to describe what rules are currently loaded in context (or use introspection if available)
- Observe that the test rule is NOT present in the context
- Now, open a terminal and run
claudeCLI in the same directory
- Ask the same question about loaded rules
- Observe that the test rule IS present in the CLI context
Alternative reproduction with symlinked directories:
- Create a rules directory:
mkdir -p ~/my-rules - Add rule files to it
- Symlink to Claude rules:
ln -sf ~/my-rules ~/.claude/rules/my-rules - Test in VSCode extension vs CLI - CLI will see the rules, VSCode won't
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Latest (as of 2025-12-13)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
Environment Details
- Testing directory:
/home/yuye/workspace/cc-projects/claude-composition - Symlink structure tested:
````
~/.claude/rules/
└── alaska/ ← Symlink to plugin rules (subdirectory)
├── directory-guidelines.md
└── commit-workflow.md
Root Cause Hypothesis
The VSCode extension may not be:
- Following symlinks correctly
- Scanning subdirectories recursively
- Loading user-level rules at all (only project-level
.claude/rules/)
Workarounds Attempted
None of these workarounds fixed the issue in the VSCode extension (all work in CLI):
- Symlinking individual files to top-level
~/.claude/rules/ - Creating direct
.mdfiles in~/.claude/rules/ - Using absolute paths
Related Findings
Hook-based rule enforcement (Layer 2) DOES work in the VSCode extension—it's specifically the context loading (Layer 1) that's broken. This suggests the issue is specifically with how the extension loads ~/.claude/rules/ content into the context window at session start.
Documentation Reference
https://code.claude.com/docs/en/memory states that user-level rules should auto-load without configuration.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗