[BUG]
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?
Bug: Bash tool returns empty output for all commands on Windows (Git Bash)
Environment
- Claude Code version: (please fill in with
claude --version) - OS: Windows 11 Home China 10.0.26200
- Shell:
/usr/bin/bash(Git Bash, presumably via MSYS2 or Git for Windows) - Terminal: (please fill in — Windows Terminal / CMD / PowerShell / other)
Summary
Every Bash command executed via Claude Code returns (Bash completed with no output), regardless of whether the command succeeds, produces stdout, or produces stderr. The commands themselves do execute correctly — this was verified by redirecting output to a file and reading it back via the Read tool.
Steps to reproduce
- Open Claude Code on Windows with Git Bash as the configured shell
- Run any Bash command, e.g.,
echo "hello"
Expected behavior
The stdout/stderr of the command should be returned in the tool result and displayed to the user.
Actual behavior
The tool always returns (Bash completed with no output). No stdout or stderr is captured.
Diagnostics performed
| Test | Command | Tool Result | Verified via file redirect |
|------|---------|-------------|---------------------------|
| Basic stdout | echo "CLAUDE_DEBUG_TEST" | (empty) | Wrote successfully to file |
| Stderr | this_command_does_not_exist | (empty) | N/A |
| Shell info | echo $SHELL | (empty) | File contained /usr/bin/bash |
| Redirect to file | echo test > file.txt | (empty) | Read tool confirmed file content |
The file redirect + Read tool workaround confirms:
- The shell process spawns and executes commands correctly
- The issue is specifically in how stdout/stderr pipes are read back by the harness
- Both stdout and stderr are affected
Additional notes
- The
/doctorslash command shows "Claude Code diagnostics dismissed" with no further output - This may be related to how the Node.js child process stdio streams interact with Git Bash on Windows (MSYS2's PTY emulation vs native Windows pipes)
Workaround
Commands can be run by redirecting output to a file and then reading the file with the Read tool, but this is extremely cumbersome for interactive use.
What Should Happen?
Bug: Bash tool returns empty output for all commands on Windows (Git Bash)
Environment
- Claude Code version: (please fill in with
claude --version) - OS: Windows 11 Home China 10.0.26200
- Shell:
/usr/bin/bash(Git Bash, presumably via MSYS2 or Git for Windows) - Terminal: (please fill in — Windows Terminal / CMD / PowerShell / other)
Summary
Every Bash command executed via Claude Code returns (Bash completed with no output), regardless of whether the command succeeds, produces stdout, or produces stderr. The commands themselves do execute correctly — this was verified by redirecting output to a file and reading it back via the Read tool.
Steps to reproduce
- Open Claude Code on Windows with Git Bash as the configured shell
- Run any Bash command, e.g.,
echo "hello"
Expected behavior
The stdout/stderr of the command should be returned in the tool result and displayed to the user.
Actual behavior
The tool always returns (Bash completed with no output). No stdout or stderr is captured.
Diagnostics performed
| Test | Command | Tool Result | Verified via file redirect |
|------|---------|-------------|---------------------------|
| Basic stdout | echo "CLAUDE_DEBUG_TEST" | (empty) | Wrote successfully to file |
| Stderr | this_command_does_not_exist | (empty) | N/A |
| Shell info | echo $SHELL | (empty) | File contained /usr/bin/bash |
| Redirect to file | echo test > file.txt | (empty) | Read tool confirmed file content |
The file redirect + Read tool workaround confirms:
- The shell process spawns and executes commands correctly
- The issue is specifically in how stdout/stderr pipes are read back by the harness
- Both stdout and stderr are affected
Additional notes
- The
/doctorslash command shows "Claude Code diagnostics dismissed" with no further output - This may be related to how the Node.js child process stdio streams interact with Git Bash on Windows (MSYS2's PTY emulation vs native Windows pipes)
Workaround
Commands can be run by redirecting output to a file and then reading the file with the Read tool, but this is extremely cumbersome for interactive use.
Error Messages/Logs
Steps to Reproduce
Bug: Bash tool returns empty output for all commands on Windows (Git Bash)
Environment
- Claude Code version: (please fill in with
claude --version) - OS: Windows 11 Home China 10.0.26200
- Shell:
/usr/bin/bash(Git Bash, presumably via MSYS2 or Git for Windows) - Terminal: (please fill in — Windows Terminal / CMD / PowerShell / other)
Summary
Every Bash command executed via Claude Code returns (Bash completed with no output), regardless of whether the command succeeds, produces stdout, or produces stderr. The commands themselves do execute correctly — this was verified by redirecting output to a file and reading it back via the Read tool.
Steps to reproduce
- Open Claude Code on Windows with Git Bash as the configured shell
- Run any Bash command, e.g.,
echo "hello"
Expected behavior
The stdout/stderr of the command should be returned in the tool result and displayed to the user.
Actual behavior
The tool always returns (Bash completed with no output). No stdout or stderr is captured.
Diagnostics performed
| Test | Command | Tool Result | Verified via file redirect |
|------|---------|-------------|---------------------------|
| Basic stdout | echo "CLAUDE_DEBUG_TEST" | (empty) | Wrote successfully to file |
| Stderr | this_command_does_not_exist | (empty) | N/A |
| Shell info | echo $SHELL | (empty) | File contained /usr/bin/bash |
| Redirect to file | echo test > file.txt | (empty) | Read tool confirmed file content |
The file redirect + Read tool workaround confirms:
- The shell process spawns and executes commands correctly
- The issue is specifically in how stdout/stderr pipes are read back by the harness
- Both stdout and stderr are affected
Additional notes
- The
/doctorslash command shows "Claude Code diagnostics dismissed" with no further output - This may be related to how the Node.js child process stdio streams interact with Git Bash on Windows (MSYS2's PTY emulation vs native Windows pipes)
Workaround
Commands can be run by redirecting output to a file and then reading the file with the Read tool, but this is extremely cumbersome for interactive use.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.150 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗