[BUG] Global CLAUDE.md loaded twice due to path case mismatch

Resolved 💬 2 comments Opened Oct 1, 2025 by JRPrice5 Closed Oct 18, 2025

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 global CLAUDE.md file located at C:\Users\<username>\.claude\CLAUDE.md is being loaded twice into the context window:

  1. Once as "User" memory (correct): C:\Users\<username>\.claude\CLAUDE.md (uppercase C)
  2. Once as "Project" memory (incorrect): c:\Users\<username>\.claude\CLAUDE.md (lowercase c)

This duplicate loading:

  • Wastes ~1k tokens of the 200k context window per session
  • Treats the same file as two different memory sources
  • Incorrectly includes the global .claude directory in project-level context scanning

What Should Happen?

The global CLAUDE.md file should be loaded only once as "User" memory. It should never appear as "Project" memory.

Expected /context output:

Memory files · /memory
└ User (C:\Users\<username>\.claude\CLAUDE.md): 1.1k tokens
└ Project (c:\Users\<username>\Projects\MyProject\CLAUDE.md): 2.0k tokens

Error Messages/Logs

**Actual `/context` command output (anonymized)**:

⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛝ ⛝   Context Usage
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝   claude-sonnet-4-5-20250929 • 66k/200k tokens (33%)

Memory files · /memory
└ User (C:\Users\<username>\.claude\CLAUDE.md): 1.1k tokens
└ Project (c:\Users\<username>\.claude\CLAUDE.md): 1.1k tokens  ← DUPLICATE
└ Project (c:\Users\<username>\Projects\MyProject\CLAUDE.md): 2.0k tokens


**Key observation:** Note the case difference in drive letter:
- User memory: `C:\` (uppercase)
- Project memory: `c:\` (lowercase)

No error messages are displayed; the duplication happens silently.

Steps to Reproduce

  1. Install Claude Code VSCode extension on Windows (v2.0.1)
  2. Create global CLAUDE.md at C:\Users\<username>\.claude\CLAUDE.md with some content
  3. Open any project in VSCode (e.g., C:\Users\<username>\Projects\MyProject)
  4. Create project CLAUDE.md at project root with different content
  5. Open Claude Code in VSCode
  6. Run /context command
  7. Observe the Memory files section shows the global CLAUDE.md twice:
  • Once with uppercase C:\ as "User"
  • Once with lowercase c:\ as "Project"

Reproduction rate: 100% consistent across restarts

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.1

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Similar Issues:*

  • Issue #3465: Hooks firing twice from home directory (fixed in v1.0.53)
  • Similar pattern: duplication due to path handling bug
  • Different scope: affected hook execution, not CLAUDE.md loading
  • Root cause: duplicate configurations when running from home directory
  • Issue #7536: Path resolution fails with case-sensitive matching on Windows
  • Similar problem: Windows path case sensitivity (C:\ vs c:\) not normalized
  • Different symptom: warnings/errors about paths not found, not duplicate loading
  • Affects versions: 1.0.86, 1.0.88, 1.0.110, 1.0.112
  • Issue #6578, #7078: Windows drive letter duplication bugs
  • Related: Windows path parsing errors creating malformed paths (e.g., C:\c\...)
  • Different root cause: path construction bugs vs. path normalization failure

View original on GitHub ↗

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