[BUG] SSH commands return exit code 141 (SIGPIPE) and capture no stdout 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?
SSH commands executed via the Bash tool never capture stdout. Short commands appear to succeed silently (exit 0, no output shown), while commands that produce significant output fail with exit code 141 (SIGPIPE — signal 13).
The remote commands complete successfully — the issue is entirely on the local pipe between the SSH child process and the Bash tool's output capture.
This was not an issue a few days/versions ago. The ssh script is the same and the deploy script im using is the same as they were a few days/versions ago when this worked as expected.
What Should Happen?
SSH stdout should be captured and displayed like any other command. A command like ssh myhost hostname should show the hostname in the tool output.
Error Messages/Logs
Steps to Reproduce
1. Simple command — succeeds but captures NO output (should print the hostname)
ssh myhost hostname
Result: "Tool ran without output or errors" — stdout is lost
2. Long-output command — fails with SIGPIPE
ssh myhost "cd /project && bash scripts/deploy.sh"
Result: exit code 141, no output captured
3. File redirect — works perfectly, proving the remote command succeeds
ssh myhost "cd /project && bash scripts/deploy.sh" > output.txt 2>&1
Result: exit code 0, full output captured in file
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.39
Claude Code Version
2.1.45
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
This was not an issue a few days/versions ago. The ssh script is the same and the deploy script im using is the same as they were a few days/versions ago when this worked as expected.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗