claude-code - 💡(How to fix) Fix Bash tool stdout is always empty on Windows 11

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Workaround

Redirect output to file then read with Read tool:

command > result.txt 2>&1

Then Read result.txt.

Code Example

command > result.txt 2>&1
RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 Home 10.0.26200
  • Shell: bash (Git for Windows / MSYS2)
  • Claude Code backend: DeepSeek API proxy (api.deepseek.com/anthropic)
  • Model: deepseek-v4-pro

Symptoms

All bash commands return empty stdout/stderr in tool results, even basic commands like echo hello world. The commands themselves execute successfully (exit code 0, file redirects work correctly).

Steps to Reproduce

  1. Run echo hello world via Bash tool
  2. Tool result shows "Bash completed with no output"
  3. Repeat with any command (pwd, git --version, ls, etc.)

Evidence

  • echo test > file.txt → Read tool confirms file contains "test" (commands execute correctly)
  • Background tasks show exit code 0 but empty output files
  • gh auth status works (confirmed login succeeded) but stdout not shown in tool results
  • File redirect + Read workaround works correctly

Workaround

Redirect output to file then read with Read tool:

command > result.txt 2>&1

Then Read result.txt.

Additional Context

The bash shell appears to use Windows-style PATH (semicolons) which bash cannot parse, making basic Unix utilities unavailable (which, ls, uname not found). Full paths to Windows executables do work (e.g., "/c/Program Files/GitHub CLI/gh.exe").

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING