[BUG] Claude Code hangs on all subprocess commands when running inside SSH session on Windows
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?
Environment: Claude Code 2.1.220, Windows 11, SSH Session
Issue: When I SSH into my Windows machine from my Mac using Terminal or iPhone, then launch Claude Code in that SSH session, Claude cannot execute any commands. Even simple commands like "echo hello" hang and time out after 2 minutes with exit code 143.
Actual behaviour: All subprocess execution hangs indefinitely. PowerShell times out, no output captured.
Key observation: The same commands run instantly if I execute them manually in the terminal outside of Claude Code, in the identical SSH session. Additionally, Claude Code works perfectly when launched directly on Windows without SSH involved.
This appears to be a subprocess spawning issue specific to Claude Code running in an SSH-reached session on Windows, not related to SSH keys, agent forwarding, or authentication.
What Should Happen?
Expected behaviour: Commands should execute normally, just as they do outside Claude Code.
Error Messages/Logs
Time out and hang. 2 minutes. Exit code 143.
Steps to Reproduce
- SSH into Windows machine.
- Launch Claude Code (version 2.1.220).
- Ask Claude to run any command like "echo hello".
- Command hangs and times out.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.220
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Everything is straight forward. Other bug reports exist, however this bug report has to do with Claudes environment itself. Claude cannot run any command through SSH into Windows.