Path Normalization Failure: Doubled Unix Drive Prefix in Windows Environments

Resolved 💬 8 comments Opened Aug 8, 2025 by JasonCubic Closed Jan 11, 2026

Bug Description

Claude Code Critical Path Corruption Bug Report

Summary

CRITICAL PATH CORRUPTION BUG: Claude Code systematically corrupts Git Bash Unix-style paths by doubling the /c/ prefix, causing cascading failures across multiple subsystems including IDE integration and file operations.

Forensic Evidence - Path Doubling Bug Discovered

SMOKING GUN: Direct evidence of path corruption found through filesystem forensics:

  1. File Write Test: Used path /c/trucktech_sandbox/aws-bedrock-cc/filename
  2. Actual File Location: Found at /c/c/trucktech_sandbox/aws-bedrock-cc/filename
  3. Path Corruption Pattern: Claude Code adds extra /c/ prefix to Unix-style paths
  4. IDE Integration Failure: Corrupted path prevents workspace matching

The Connection: VS Code reports c:\trucktech_sandbox\aws-bedrock-cc but Claude Code's corrupted path becomes /c/c/trucktech_sandbox/aws-bedrock-ccNO MATCH → IDE integration fails

Environment Details

  • Claude Code Version: 1.0.71
  • Platform: Windows (MSYS_NT-10.0-22631 3.4.10-87d29.x86_64)
  • IDE: Visual Studio Code
  • Shell: Git Bash (MSYS)
  • Working Directory: C:\trucktech_sandbox\aws-bedrock-cc (displayed as /c/trucktech_sandbox/aws-bedrock-cc in Git Bash)

Issue Description

Claude Code exhibits systematic path normalization failures affecting multiple subsystems:

IDE Integration Issue

Select IDE
Connect to an IDE for integrated development features.

No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin 
installed and is running.

Found 1 other running IDE(s). However, their workspace/project directories do not match 
the current cwd.

    • Visual Studio Code: c:\trucktech_sandbox\aws-bedrock-cc

File Operations Issue

  • Write tool reports success but files don't appear on filesystem
  • Security errors show malformed paths like 'C:\c\trucktech_sandbox\aws-bedrock-cc'

Root Cause Analysis - Path Doubling Bug

UNIFIED ROOT CAUSE IDENTIFIED: Claude Code's path normalization logic corrupts Unix-style paths by doubling the drive prefix:

The Bug Pattern:

  • Input Path (Git Bash): /c/trucktech_sandbox/aws-bedrock-cc
  • Corrupted Path (Claude Code): /c/c/trucktech_sandbox/aws-bedrock-cc
  • Expected Path (Correct): C:\trucktech_sandbox\aws-bedrock-cc
  • VS Code Path (Reference): c:\trucktech_sandbox\aws-bedrock-cc

Why IDE Integration Fails:

  1. VS Code extension reports workspace: c:\trucktech_sandbox\aws-bedrock-cc
  2. Claude Code CLI corrupts current directory to: /c/c/trucktech_sandbox/aws-bedrock-cc
  3. Path matching logic compares corrupted path vs. correct path → MISMATCH
  4. Result: "workspace/project directories do not match the current cwd"

Reproduction Steps

  1. Open VS Code in Windows directory
  2. Use Git Bash as integrated terminal
  3. Run Claude Code CLI
  4. Attempt /ide command - fails path matching
  5. Attempt file operations with Unix-style paths - files don't appear
  6. Security errors show malformed path concatenation

Impact

  • ❌ IDE integration completely broken
  • ❌ File operations unreliable
  • ❌ Path-dependent features failing
  • ✅ Basic CLI functionality works (reading existing files, bash commands)

Workaround

Using Windows-style paths (C:\...) instead of Git Bash paths (/c/...) may resolve file operation issues.

Definitive Reproduction Test

Proof of Path Corruption (easily reproducible):

# In Claude Code CLI (Git Bash environment):
# 1. Write file using Unix-style path
# 2. Search filesystem to find where it actually went
# 3. Observe the doubled /c/c/ path corruption

# Expected: /c/trucktech_sandbox/aws-bedrock-cc/test-file.txt  
# Actual: /c/c/trucktech_sandbox/aws-bedrock-cc/test-file.txt

Priority Level

CRITICAL - This bug breaks core Claude Code functionality on Windows with Git Bash, affecting:

  • IDE integration (primary user workflow)
  • File operations (data integrity risk)
  • Path-dependent security boundaries

Suggested Fix

Primary Fix Required: Fix path doubling corruption in Unix-to-Windows path conversion:

  1. Debug the path normalization logic that converts /c/... → should become C:\... not /c/c/...
  2. Implement proper Git Bash path handling without prefix doubling
  3. Add path normalization unit tests covering Git Bash, PowerShell, CMD environments
  4. Test IDE integration path matching with normalized paths
  5. Verify file operations work correctly across shell environments

Secondary Improvements:

  • Case-insensitive path matching for IDE detection
  • Consistent path format normalization before comparisons
  • Better error messaging when path operations fail

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 1.0.71
  • Feedback ID: 79634380-a774-4d51-a024-e1789aaa1686

Errors

[]

View original on GitHub ↗

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