[BUG] Bash tool output silently empty on Windows (Git Bash) in long sessions

Resolved 💬 3 comments Opened Mar 19, 2026 by a-nakama-mao Closed May 4, 2026

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 echo commands
  • 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

  1. Start Claude Code on Windows 11 with Git Bash as the shell
  2. Work through a moderately long session (many tool calls over 30+ minutes)
  3. At some point, Bash tool output starts returning empty for all commands
  4. Run echo "hello" — returns "Tool ran without output or errors"
  5. Run pwd — same empty result
  6. Run echo "test" 2>&1 — same empty result
  7. Use Agent tool to run the same commands — works fine (fresh subprocess)
  8. Use run_in_background + TaskOutput — also works fine
  9. 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:

  1. run_in_background: true + TaskOutput tool — async shell captures output correctly
  2. Agent tool (subagent) — spawns a fresh shell subprocess, always works
  3. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗