[BUG] SSHFS/network drive mounts fail directory validation in v2.1.82+ (regression from v2.1.81)
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?
Description
Claude Code extension fails to initialize when the VSCode workspace is opened from an SSHFS-mounted drive letter, showing the error: Working directory "x:\" no longer exists. Please restart Claude from an existing directory.
This is a regression - version 2.1.81 worked correctly with SSHFS mounts, but all versions after (tested through 2.1.101) fail.
Environment
- OS: Windows 11 Enterprise 10.0.22631
- VSCode: Latest (using bundled Node.js)
- Claude Code Working Version: 2.1.81
- Claude Code Broken Versions: 2.1.82 through 2.1.101 (at minimum)
- Mount Tool: sshfs-win (WinFsp backend) mounting remote Linux filesystem via SSH
- Shell: Git Bash (C:\Users\[user]\AppData\Local\Programs\Git\bin\bash.exe)
Steps to Reproduce
- Mount a remote filesystem via SSHFS to a Windows drive letter (e.g., X:):
``bash``
sshfs-win.exe cmd user@remote.host:/path/to/dir X: -o "IdentityFile=C:/path/to/key,uid=-1,gid=-1,umask=000"
- Open VSCode and set workspace to
X:\
- Attempt to use Claude Code (send any message)
Expected Behavior
Claude Code should initialize successfully and execute commands in the X:\ directory (as it did in v2.1.81).
Actual Behavior
Error message appears:
Working directory "x:\" no longer exists. Please restart Claude from an existing directory.
Technical Details
From the Claude Code extension logs (Claude VSCode.log):
[DEBUG] Shell CWD "x:\" no longer exists, recovering to "x:\"
[DEBUG] Bash tool error (1550ms): Working directory "x:\" no longer exists. Please restart Claude from an existing directory.
The error occurs during bash shell initialization when Claude Code validates the working directory. The validation check fails despite:
- Windows acknowledging the drive exists
- PowerShell
Test-Path 'X:\'returningTrue - Bash commands successfully accessing
/x/files - VSCode itself opening the workspace without issues
Evidence the Drive is Valid
PowerShell confirms the drive exists:
PS> Test-Path 'X:\'
True
PS> Get-Item 'X:\' | Select-Object PSIsContainer, Exists, FullName
PSIsContainer Exists FullName
------------- ------ --------
True True X:\
Bash can access files:
$ ls /x/
CMakeLists.txt CONTRIBUTING.md Auxiliary/ Data_Collection/ ...
Timeline
- March 23, 2026: SSHFS mount (Z:) worked successfully with Claude Code v2.1.81
- March 24, 2026: After auto-update, SSHFS mounts stopped working
- April 13, 2026: Confirmed broken on v2.1.101, downgrade to v2.1.81 restored functionality
Workaround
Downgrade to v2.1.81:
- Extensions → Claude Code → Gear icon → "Install Another Version" → Select 2.1.81
- Disable auto-update for Claude Code extension
Alternative workaround: Launch Claude Code from a local directory (e.g., C:\Users\[user]) and access SSHFS files using absolute paths like /x/file.txt - this works at runtime but is inconvenient.
Root Cause Hypothesis
Between v2.1.81 and v2.1.82, the directory validation logic became stricter or changed its method of checking directory existence. The new validation appears to use a Node.js filesystem API call that doesn't handle SSHFS/network filesystem mounts reliably, even though the same check works fine at runtime when executing bash commands.
The validation happens specifically during shell initialization before any bash commands are executed, suggesting the issue is in the extension's TypeScript/JavaScript code rather than the shell itself.
Impact
This prevents users from working directly with remote filesystems mounted via SSHFS, which is a common workflow for:
- Remote development on HPC/server systems
- Working with large codebases that must remain on remote storage
- Accessing repositories on remote Linux servers from Windows
Suggested Fix
- Revert the directory validation logic to whatever was used in v2.1.81
- Add retry logic with a timeout for network filesystem validation
- Use the same validation method that works at runtime (e.g., attempt to run
pwdin bash) rather than a Node.js sync filesystem check - Consider allowing users to skip strict directory validation via a setting for network filesystems
What Should Happen?
Claude Code should initialize successfully and execute commands in the X:\ directory (as it did in v2.1.81).
Error Messages/Logs
Error message appears:
Working directory "x:\" no longer exists. Please restart Claude from an existing directory.
Steps to Reproduce
- Mount a remote filesystem via SSHFS to a Windows drive letter (e.g., X:):
``bash``
sshfs-win.exe cmd user@remote.host:/path/to/dir X: -o "IdentityFile=C:/path/to/key,uid=-1,gid=-1,umask=000"
- Open VSCode and set workspace to
X:\
- Attempt to use Claude Code (send any message)
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
v2.1.81
Claude Code Version
v2.1.101
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Terminal/Shell is Git Bash
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗