[Bug] VSCode Extension: User-level rules (~/.claude/rules/) not loading into context

Open 💬 6 comments Opened Dec 13, 2025 by IndieDevYulin

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 .md files) 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):

  1. All .md files in ~/.claude/rules/ should be discovered recursively
  2. Symlinks should be followed for shared rules across projects
  3. User-level rules should load before project rules (with project rules having higher priority)
  4. 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

  1. Create a test rule file at ~/.claude/rules/test-rule.md with any content:

``markdown
# Test Rule
This is a test rule that should appear in the context.
``

  1. Open VSCode with the Claude Code extension installed
  1. Start a new Claude Code session in VSCode
  1. Ask Claude to describe what rules are currently loaded in context (or use introspection if available)
  1. Observe that the test rule is NOT present in the context
  1. Now, open a terminal and run claude CLI in the same directory
  1. Ask the same question about loaded rules
  1. Observe that the test rule IS present in the CLI context

Alternative reproduction with symlinked directories:

  1. Create a rules directory: mkdir -p ~/my-rules
  2. Add rule files to it
  3. Symlink to Claude rules: ln -sf ~/my-rules ~/.claude/rules/my-rules
  4. 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:

  1. Following symlinks correctly
  2. Scanning subdirectories recursively
  3. 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 .md files 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.

View original on GitHub ↗

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