[BUG] Bash tool hangs/returns empty on Windows 11 — causes token-burning retry loops

Resolved 💬 4 comments Opened Mar 14, 2026 by davemills81MSN Closed May 22, 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?

Description

Bash tool commands (especially git commands like git status, git log, git diff) frequently hang or return
empty output on Windows 11. When this happens, Claude retries the same command multiple times, consuming significant
tokens without ever getting results.

## Environment

  • OS: Windows 11 Home 10.0.26200
  • Shell: Git Bash (MINGW64)
  • Claude Code version: Latest (as of March 2026)

## Steps to Reproduce

  1. Start a Claude Code session on Windows 11 with Git Bash
  2. Ask Claude to run any git command (e.g., git status, git log --oneline -5)
  3. Observe: command hangs until timeout, returns empty output, or silently fails
  4. Claude automatically retries the same command, burning tokens each attempt

## Expected Behavior

Commands execute and return output promptly (as they do when run manually in the same terminal).

## Actual Behavior

  • Commands hang until the 2-minute timeout
  • Output is empty or not captured
  • Claude retries repeatedly, each retry consuming tokens
  • A single git status can cost 5-10x normal token usage due to retries

## Workaround

Running commands with run_in_background: true and redirecting to a temp file, then using the Read tool to retrieve
output. This is clunky and still costs 3 tool calls per command.

## Impact

This is a significant usability and cost issue on Windows. Token burn from retries makes extended coding sessions
expensive and frustrating. It particularly affects workflows that rely heavily on git operations (commit, diff,
status, log).

## Possibly Related Issues

  • #21915 — Bash tool produces no output on Windows
  • #26545 — Bash tool returns exit code 1 with no output on Git Bash since v2.1.45
  • #5101 — Claude Code hangs on basic bash commands
  • #4049 — Significant pre-execution delay on Windows

What Should Happen?

Claude should be able to read the output consistently which stops the repeated tool call.

Error Messages/Logs

Steps to Reproduce

See above

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.76 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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