SSH remote connection fails on Windows — hardcoded /usr/bin/ssh path
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?
When using Claude Code Desktop on Windows and attempting to connect to a remote machine via SSH, it fails with:
Failed to spawn /usr/bin/ssh: spawn /usr/bin/ssh ENOENT
The SSH spawning logic appears to hardcode the Unix path /usr/bin/ssh, which doesn't exist on Windows. On Windows, SSH is typically located at C:\Windows\System32\OpenSSH\ssh.exe or C:\Program Files\Git\usr\bin\ssh.exe.
Expected behavior: Claude Code should detect the platform and resolve the SSH binary path accordingly (e.g., using where ssh on Windows or respecting the system PATH).
Environment:
- Windows 11 Pro
- Claude Code Desktop (latest)
- OpenSSH 10.2p1 installed and working from terminal
What Should Happen?
Claude Code should detect the operating system platform and resolve the SSH binary path accordingly. On Windows, it should:
- Use the appropriate SSH executable locations (e.g., C:\Windows\System32\OpenSSH\ssh.exe or C:\Program Files\Git\usr\bin\ssh.exe)
- Respect the system PATH environment variable to locate ssh
- Use platform detection to determine the correct binary path instead of hardcoding /usr/bin/ssh
This would allow remote SSH connections to work properly on Windows systems with OpenSSH installed.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code Desktop on Windows 11
- Navigate to the SSH feature/settings
- Attempt to configure a remote SSH connection to any machine
- Try to connect using the SSH remote feature
Expected result: Connection should attempt to establish
Actual result: Connection fails with error "Failed to spawn /usr/bin/ssh: spawn /usr/bin/ssh ENOENT"
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
latest
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗