[BUG] Bash tool output silently empty on Windows (Git Bash) in long sessions
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?
The Bash tool frequently returns empty output (displayed as "Tool ran without output or errors") on Windows 11 with Git Bash. This happens even for trivial commands like echo "hello" or pwd.
Key observations:
- Occurs more frequently as the session gets longer
- Once it starts, ALL subsequent Bash calls return empty — even simple
echocommands - The commands themselves execute successfully (side effects like file writes do happen), but stdout/stderr is not captured
- Workarounds: using
run_in_background+TaskOutput, or delegating to an Agent (subagent spawns a fresh shell and works fine) - Restarting Claude Code resolves the issue temporarily
Example session:
> Bash: echo "test1"
→ "Tool ran without output or errors"
> Bash: pwd
→ "Tool ran without output or errors"
> Bash: echo "test2" 2>&1
→ "Tool ran without output or errors"
Meanwhile, Agent tool running the same commands in a subprocess returns output correctly.
What Should Happen?
The Bash tool should reliably capture and return stdout/stderr output for all commands, regardless of session length. A simple echo "hello" should always return "hello".
Error Messages/Logs
No error is shown. The Bash tool simply returns:
"Tool ran without output or errors"
for every command, including `echo "hello"`, `pwd`, `git status`, etc.
Steps to Reproduce
- Start Claude Code on Windows 11 with Git Bash as the shell
- Work through a moderately long session (many tool calls over 30+ minutes)
- At some point, Bash tool output starts returning empty for all commands
- Run
echo "hello"— returns "Tool ran without output or errors" - Run
pwd— same empty result - Run
echo "test" 2>&1— same empty result - Use Agent tool to run the same commands — works fine (fresh subprocess)
- Use
run_in_background+TaskOutput— also works fine - Restart Claude Code — Bash tool works again, until the issue recurs
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.33 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
- OS: Windows 11 Pro 10.0.26200
- Shell: Git Bash (bash via MSYS2/MinGW)
- Terminal: Windows Terminal
- Model: claude-opus-4-6 (1M context)
Suspected cause: Possible pipe/stdout buffer issue between Node.js child process and Git Bash on Windows. The shell process itself continues to execute commands correctly (file writes succeed), but the stdout/stderr stream back to Claude Code stops being captured.
Workarounds that work:
run_in_background: true+TaskOutputtool — async shell captures output correctly- Agent tool (subagent) — spawns a fresh shell subprocess, always works
- Restarting Claude Code — clears the broken shell session
This suggests the issue is specific to the persistent shell session that the Bash tool reuses, not a general process spawning issue.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗