[BUG] Duplicate project entries in .claude.json due to Windows path format inconsistency
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
On Windows, the same project directory creates multiple duplicate entries in ~/.claude.json depending on which shell environment launches Claude Code.
Launching from CMD/PowerShell creates:
"C:\\Users\\John\\Documents\\projects\\myapp": { ... }
Launching the same folder from Git Bash creates:
"C:/Users/John/Documents/projects/myapp": { ... }
Additionally, drive letter casing varies (C: vs c:), creating further duplicates.
This affects both the projects object and githubRepoPaths array.
What Should Happen?
A single canonical entry should exist per project directory regardless of which shell was used. Paths should be normalized before being used as keys or stored.
Error Messages/Logs
No errors — duplicates are created silently and only discovered when inspecting the config file.
Steps to Reproduce
- On Windows, open a project directory in CMD or PowerShell
- Run
claudeand let it initialize the project - Exit Claude Code
- Open the same directory in Git Bash
- Run
claudeagain - Open
~/.claude.jsonand inspect theprojectskey - Observe two separate entries for the same directory with different path formats
Claude Model
Opus
Is this a regression?
Unknown
Last Working Version
N/A
Claude Code Version
2.1.15
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
CMD, PowerShell, Git Bash (issue occurs when switching between them)
Additional Information
Impact:
- Config file grows with duplicate entries over time
- Project-specific settings (
allowedTools,disabledMcpServers, etc.) may not apply if the stored path format doesn't match the current shell's format - Requires periodic manual cleanup
Suggested fix:
Normalize all Windows paths to a canonical format before storing or looking up project entries.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗