[BUG] Bash script stdout not captured on Windows/MINGW64 (regression of #7630)

Resolved 💬 2 comments Opened Jan 16, 2026 by Reederoo Closed Jan 16, 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?

Bash script execution succeeds (exit code 0) but stdout is completely lost. This appears to be a regression of #7630 which was fixed in v1.0.113.

Key distinction: Direct commands work fine. Only script file execution loses output.

What Should Happen?

Script output should appear in the terminal instead of no content

Scripts that call Python or other executables also lose their output when run as ./script but work when sourced.

Root Cause Analysis

The issue is specific to bash script file execution. When a script is executed (not sourced), it runs in a subshell/subprocess, and stdout from that subprocess is not being captured by Claude Code's Bash tool.

  • Inline commands: captured ✅
  • bash -c 'command': captured ✅
  • Script file execution: not captured
  • Script sourcing (. script or source script): captured ✅

Error Messages/Logs

## Diagnostic Results

| Command | Output |
|---------|--------|
| `echo "inline test"` | ✅ Works - shows "inline test" |
| `bash -c 'echo "test"'` | ✅ Works - shows "test" |
| `/tmp/test.sh` | ❌ No output captured |
| `bash /tmp/test.sh` | ❌ No output captured |
| `./myscript.sh` | ❌ No output captured |
| `. ./myscript.sh` (source) | ✅ Works |
| `source ./myscript.sh` | ✅ Works |



## Impact

- Cannot see output from any bash scripts
- Breaks workflows that rely on script wrappers
- Affects git hooks, build scripts, test runners, and automation tools
- Workaround requires modifying how scripts are invoked

Steps to Reproduce

  1. Create a simple test script:
echo '#!/bin/bash
echo "hello from script"' > /tmp/test.sh
chmod +x /tmp/test.sh
  1. Run via Claude Code's Bash tool:
/tmp/test.sh
  1. Expected: Output shows "hello from script"
  2. Actual: Returns "Tool ran without output or errors" with no captured output

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

not sure, but likely a version just prior to 2.1.9 as it worked until the same day that update happened.

Claude Code Version

2.1.9 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Environment

  • Claude Code version: 2.1.9
  • OS: Windows 10 (MINGW64_NT-10.0-26100 3.5.7-463ebcdc.x86_64)
  • Shell: Git Bash (MINGW64)

Workaround

Use dot-sourcing instead of direct execution:

# Instead of:
./myscript.sh arg1 arg2

# Use:
. ./myscript.sh arg1 arg2

Related Issues

  • #7630 - [BUG] Bash tool complete output capture failure on Windows (MINGW64 & CMD) - Fixed in v1.0.113, now regressed

Additional Context

This was working correctly until recently (worked fine for months). The regression appeared sometime before January 16, 2026.

View original on GitHub ↗

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