[BUG] Bash stdout not returned in VS Code Extension (Windows / Git Bash)
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?
Date tested: 2026-03-20
Claude Code version: 2.1.80
Model: claude-sonnet-4-6
Environment: VS Code extension (not CLI)
OS: Windows 11 Pro (10.0.26200)
Shell: Git Bash — MINGW64 / MSYS2 (3.6.5-22c95533)
---
Summary
When Claude Code runs Bash commands via the VS Code extension on Windows with Git Bash, stdout is never returned to Claude. Commands execute successfully but produce no visible output. File writes work correctly.
---
Steps to Reproduce
- Open Claude Code in the VS Code extension on Windows with Git Bash as the shell.
- Ask Claude to run any command that produces stdout output, e.g.:
echo "hello"
- Observe that the Bash tool result shows
(Bash completed with no output)despite the command succeeding.
---
Expected Behavior
Stdout from Bash commands should be returned to Claude as tool output, as documented and as works in the CLI version.
---
Actual Behavior
All Bash commands return (Bash completed with no output) regardless of what they print to stdout. Commands do execute (side effects like file writes succeed), but stdout is never captured.
Tested commands that silently fail to return output:
echo "hello"→ no outputdate→ no outputgit status→ no outputclaude --version→ no output
Workaround that works:
some_command > C:/Users/keith_pg85iui/_out.txt 2>&1
# then read the file with the Read tool
---
Root Cause (Diagnosed)
VS Code's ConPTY (Console Pseudoterminal) leaks into the bash subprocess chain. Bash's stdout (fd 1) ends up connected to /dev/pty0 — a PTY device that Claude Code is not reading from. File writes bypass this because > file overrides fd 1 before the subprocess runs.
Evidence:
- Redirect to file + Read tool always works
- Direct stdout never works
- This is specific to the VS Code extension — the CLI version does not have this issue
---
Additional Notes
- Hooks are also non-functional in VS Code extension mode (hook log files are never created), suggesting the same PTY issue affects hook execution.
- This has been reproduced across multiple Claude Code versions: first confirmed, and still present in v2.1.80 as of 2026-03-20.
- The workaround (file redirect) is functional but requires Claude to use a non-standard pattern for every single Bash command where output is needed.
---
Impact
High. Claude cannot read command output normally in the VS Code extension on Windows. Every output-dependent Bash operation requires the file redirect workaround, making the VS Code extension significantly degraded compared to the CLI on this platform.
---
What Should Happen?
Expected Behavior
Stdout from Bash commands should be returned to Claude as tool output, as documented and as works in the CLI version.
Error Messages/Logs
## Actual Behavior
All Bash commands return `(Bash completed with no output)` regardless of what they print to stdout. Commands do execute (side effects like file writes succeed), but stdout is never captured.
**Tested commands that silently fail to return output:**
- `echo "hello"` → no output
- `date` → no output
- `git status` → no output
- `claude --version` → no output
**Workaround that works:**
some_command > C:/Users/keith_pg85iui/_out.txt 2>&1
# then read the file with the Read tool
---
Steps to Reproduce
Root Cause (Diagnosed)
VS Code's ConPTY (Console Pseudoterminal) leaks into the bash subprocess chain. Bash's stdout (fd 1) ends up connected to /dev/pty0 — a PTY device that Claude Code is not reading from. File writes bypass this because > file overrides fd 1 before the subprocess runs.
Evidence:
- Redirect to file + Read tool always works
- Direct stdout never works
- This is specific to the VS Code extension — the CLI version does not have this issue
---
Additional Notes
- Hooks are also non-functional in VS Code extension mode (hook log files are never created), suggesting the same PTY issue affects hook execution.
- This has been reproduced across multiple Claude Code versions: first confirmed, and still present in v2.1.80 as of 2026-03-20.
- The workaround (file redirect) is functional but requires Claude to use a non-standard pattern for every single Bash command where output is needed.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.80 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗