[BUG] Duplicate project entries in .claude.json due to Windows path format inconsistency

Resolved 💬 5 comments Opened Jan 21, 2026 by aturkelson Closed Mar 1, 2026

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

  1. On Windows, open a project directory in CMD or PowerShell
  2. Run claude and let it initialize the project
  3. Exit Claude Code
  4. Open the same directory in Git Bash
  5. Run claude again
  6. Open ~/.claude.json and inspect the projects key
  7. 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.

View original on GitHub ↗

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