Claude Code CLI Bug Report: Bash Tool Returns No Output on macOS 26
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?
Claude Code CLI Bug Report: Bash Tool Returns No Output on macOS 26
Summary
Claude Code CLI's Bash tool returns "(No content)" for all commands on macOS 26.2, but the same Bash tool works perfectly in Claude Desktop on the same machine.
Environment
Platform:
- macOS 26.2 (Build 25C56)
- Darwin 25.2.0
- Mac Studio M4 Max, 64GB RAM
Claude Code Version: 2.1.14
Terminals Tested:
- Warp
- Terminal.app
Shell: zsh (SHELL=/bin/zsh)
Issue Description
When running Claude Code via CLI (claude command in terminal), all Bash tool commands return "(No content)" with no stdout or stderr captured. However, the exact same Bash tool works perfectly when using Claude Code through Claude Desktop app.
CLI (BROKEN) - Example Output
❯ Run: echo "test"
⏺ Bash(echo "test")
⎿ (No content)
Desktop (WORKS) - Same Command
Run: echo "test"
Ran 1 command
Done:
Echo: test
Key Finding: CLI vs Desktop
Same machine, same OS, same version - different results:
| Environment | Bash Output | Status |
|------------|-------------|--------|
| Claude Code CLI | (No content) | ❌ Broken |
| Claude Desktop (Claude Code feature) | Output displayed | ✅ Works |
This strongly suggests the issue is specific to how the CLI handles subprocess stdio in terminal environments on macOS 26, not a fundamental Bash tool problem.
Installation History
Claude Code was installed via npm initially (through fnm), then tested with Homebrew installation. Both methods show identical broken behavior in CLI.
Most recent npm install: 2026-01-20 18:18 (version 2.1.14)
System Checks
Node/npm Environment (when using npm):
- Node via fnm with multishells
- Path:
/Users/rk/.local/state/fnm_multishells/[session]/bin/node
Homebrew Installation:
- Binary:
/opt/homebrew/bin/claude - Completely outside npm/fnm environment
Both installations broken identically in CLI.
Debug Log Excerpt
From ~/.claude/debug/*.txt:
[DEBUG] executePreToolHooks called for tool: Bash
[DEBUG] Getting matching hook commands for PreToolUse with query: Bash
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)
No errors in logs - commands appear to execute, but output is never captured.
Expected Behavior
Bash commands should return stdout/stderr output like they do in Claude Desktop.
Actual Behavior
All Bash commands return "(No content)" in CLI.
Workarounds
- Use Claude Desktop's Claude Code feature (works perfectly)
- Use file-based tools (Read/Write/Edit/Glob/Grep) which work fine
- Run bash commands manually in terminal
Impact
- CLI is effectively broken for any workflow requiring bash command execution
- Users must switch to Claude Desktop or manually run all bash commands
- Critical for CI/CD, scripting, git operations, builds, tests
Additional Context
Issue was discovered during extensive debugging session on 2026-01-20. Multiple hypotheses tested:
- Shell configuration interference (ruled out)
- fnm/npm environment issues (ruled out - Homebrew install same)
- macOS 26 incompatibility (ruled out - Desktop works)
- Version regression (ruled out - all versions broken)
The CLI-vs-Desktop difference is the smoking gun: this is a terminal stdio capture issue in the CLI implementation on macOS 26.
Related Issues
- #12998 - Bash commands freeze with no output
- #12115 - Bash commands fail with no output
Request
This is a critical bug affecting macOS 26 users of Claude Code CLI. Desktop workaround exists but CLI should be fixed.
Suggested investigation areas:
- How CLI spawns subprocess vs Desktop
- Terminal stdio file descriptor handling on macOS 26
- Differences in Electron (Desktop) vs Node.js (CLI) subprocess spawning
---
Reporter: Randy Kerber
Date: 2026-01-20
Contact: (add if desired)
What Should Happen?
Should run as it does in 'Code' tab in Claude Desktop:
Run: echo "test with claude code in claude desktop"
Run: pwd
Run: date
I'll run those three commands for you.
Ran 3 commands
Done:
Echo: test with claude code in claude desktop
Working directory: /Users/rk/tmp
Date: Tue Jan 20 23:26:37 MST 2026
To confirm, those 'Bash(...)' commands produced output?
Yes, all three commands ran successfully and produced output:
echo → test with claude code in claude desktop
pwd → /Users/rk/tmp
date → Tue Jan 20 23:26:37 MST 2026
Everything worked as expected.
Error Messages/Logs
❯ Run: echo "test with homebrew install"
Run: pwd
Run: date
⏺ I'll run those three commands for you.
⏺ Bash(echo "test with homebrew install")
⎿ (No content)
⏺ Bash(pwd)
⎿ (No content)
⏺ Bash(date)
⎿ (No content)
⏺ The commands ran but produced no output, which is unusual for pwd and date. Let me try again with a combined command
to see if there's an output issue.
⏺ Bash(echo "test with homebrew install" && pwd && date)
⎿ (No content)
⏺ This is unusual - the commands should produce output. Let me try writing to a file and reading it back to verify
execution.
⏺ Bash((echo "test with homebrew install" && pwd && date) > /tmp/claude/test_output.txt)
⎿ (No content)
⏺ Read(/tmp/claude/test_output.txt)
⎿ Error reading file
⏺ Bash(ls -la /tmp/claude/ 2>&1)
⎿ (No content)
⏺ There appears to be an issue with command output. Let me try with the sandbox disabled to see if that's the cause.
⏺ Bash(echo "test with homebrew install" && pwd && date)
⎿ (No content)
⏺ I'm encountering an unusual issue where bash commands are executing without errors, but producing no output. Even
simple commands like echo, pwd, and date that should always produce output are returning nothing.
This appears to be a system-level issue with how command output is being captured. The commands you requested are:
1. echo "test with homebrew install" - Should print "test with homebrew install"
2. pwd - Should print the current working directory (/Users/rk based on your environment)
3. date - Should print the current system date and time
All three executed without errors, but the output isn't being displayed. This might be a configuration issue with the
Bash tool or the environment. Would you like me to try a different approach or investigate further?
Steps to Reproduce
Reproduction Steps
CLI Test (Fails)
- Open Terminal.app or Warp
- Run:
claude - Execute:
Run: echo "test" - Result: "(No content)"
Desktop Test (Works)
- Open Claude Desktop app
- Use Claude Code feature
- Execute:
Run: echo "test" - Result: Output displays correctly
Extensive Diagnostics Performed
✅ Bash Works Directly in Terminal
/bin/bash -c "echo test" # ✅ Works
/bin/bash --noprofile --norc -c "echo test" # ✅ Works
✅ Tested with Zero Shell Init Files
Renamed all shell init files (.bashrc, .bash_profile, .zshrc, .zshenv, .zprofile) to completely clean environment - issue persists.
✅ SHELL Environment Variable Correct
echo $SHELL
# /bin/zsh (correct absolute path, not /usr/bin/env)
✅ Tested Multiple Claude Code Versions
All versions show same issue:
- 2.0.76
- 2.1.11
- 2.1.12
- 2.1.14
✅ Tested Multiple Installation Methods
- npm install (broken)
- Homebrew cask (broken)
- Both show identical behavior
✅ Tested with Sandbox Disabled
/sandbox
No change - still broken.
✅ Tested in Multiple Terminals
- Warp: Broken
- Terminal.app: Broken
✅ File Tools Work Perfectly
- Read tool: ✅ Works
- Write tool: ✅ Works
- Edit tool: ✅ Works
- Glob tool: ✅ Works
- Grep tool: ✅ Works
Only Bash tool is affected.
Test Commands That Fail
All return "(No content)":
echo "test"
pwd
date
ls
whoami
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.14
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Selected model is '4. Opus Plan Mode (Opus 4.5 / Sonnet)'
24 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
## POSSIBLE ROOT CAUSE IDENTIFIED
The bash snapshots contain
set -o onecmdwhich causes bash to exit afterexecuting one command. This breaks Claude Code's wrapper script that needs
to execute multiple commands (source snapshot, source env-setup.sh, run
user command).
Evidence:
```bash
$ grep "^set -o onecmd" ~/.claude/shell-snapshots/snapshot-bash-*.sh
set -o onecmd
This matches the root cause identified in #18856 for Windows, but also
affects macOS (and likely Linux per #18486).
Impact: Wrapper script execution is interrupted, causing either:
This is a CRITICAL bug affecting all platforms in v2.1.x series.
```
related issue: Issue 18856
## CRITICAL FINDING: Issue is likely in Wrapper Execution, Not Snapshots
Both Claude Desktop AND standalone CC create snapshots with
set -o onecmd.However:
Problem still present in v2.1.19:
Default shell is
zsh. Setting SHELL to bash does not fix, results in different error:I hae the same problem, also zsh shell, running CC v2.1.20 on macos 15.3... and it's driving me crazy... even a full uninstall and reinstall hasn't fixed the issue. File-based tools (Read, Grep, Glob, Edit) are unaffected.
Can confirm this - I have tried a few Claude Code versions on MacOS 26.2 (25C56)
I have also tried switching the SHELL environment variable, no change.
Also "Explore" seems to get stuck, probably because it uses the Bash tool interenally
This is infuriating, I don't want to downgrade the installed version but there is no other option it seems.
also in windows.
$ set -o | grep "on" | awk '{print "set -o " $1}' | head -n 1000
set -o braceexpand
set -o emacs
set -o hashall
set -o histexpand
set -o history
set -o interactive-comments
set -o monitor
set -o onecmd
should remove set -o onecmd
emptying
~/.claude/shell-snapshots/seems to make some bash commands work again for me on macos but still missing some basic commands...Additional Confirmation: Bug Affects BOTH CLI and Desktop on macOS
Environment
Critical Finding: Desktop Also Affected
Unlike the original issue report which stated Desktop works fine, I can confirm that Claude Desktop's Code feature also exhibits the same bug on my system.
CLI Reproduction
Desktop Reproduction
Same commands in Claude Desktop's Code mode:
Both CLI and Desktop return "(No content)" for all bash commands.
Troubleshooting Attempted
✅ Complete uninstall and reinstall of CLI (both npm and native)
✅ Removed ALL Claude-related files:
~/.claude(CLI working directory)~/.claude-worktrees(git worktree configs)~/Library/Application Support/Claude/claude-code(Desktop's built-in binary)✅ Cleaned corrupted git worktree configurations
✅ Deleted
~/.claude/shell-snapshots/(community workaround)✅ Tested CLI versions: 1.0.119, 2.0.76, 2.1.31
✅ Deleted and let Desktop re-download claude-code component
❌ None of these resolved the issue
Version Downgrade Results
CLI versions tested (all exhibit same bug):
Desktop versions:
The bug exists across all available versions and both delivery methods (CLI and Desktop).
Impact
This completely blocks the core bash execution functionality:
Both Claude Code CLI and Claude Desktop's Code feature are essentially unusable for development workflows on macOS.
Divergence from Original Report
The original issue stated:
However, in my environment, Desktop is also broken, suggesting this may be a broader macOS stdio capture issue affecting both Electron (Desktop) and Node.js (CLI) environments under certain macOS configurations.
Request
This bug has been open for 2 weeks (since Jan 21, 2026) and severely impacts productivity. Could the team please:
This is a critical blocker for professional development workflows. Thank you for your attention.
@linsy89 -- Thanks for the very thorough followup confirmation of this critical issue.
Yes, I am still severely handicapped by this definite cripplilng bug.
Anthropic -- please take this seriously. This is not a minor annoyance, it is a serious deficiency, not limited to Mac, referenced by multiple people in multiple other GitHub issues.
Had to reinstall macos to fix this on my machine :(
But at least CC is working again now :)
i have the same issue but
SHELL=/bin/bash claude —resumeseems to fix it for meHaving the same issue.
I uninstalled and reinstalled Claude. Tried the native installation and also through Homebrew.
Facing this on v2.1.49 and been an issue since v2.1.30. I'm on MacOS 15.7.3 on MBP M1Pro
found my issue... it was in the .bashrc file
Root Cause Found: Heavy
statusLinecommand causes "(No output)"After extensive debugging (source code analysis, process tracing, timing instrumentation), I found that a heavy
statusLinescript is the root cause of intermittent "(No output)" from the Bash tool on macOS.The problem
My
statusLinescript ranclaude mcp list, multiplegitcommands, andjqon every UI refresh. This spawned additional bash processes (~1.5s each) that competed with the Bash tool's output capture in the event loop. Commands taking >0.5-0.8s before producing output would silently return empty.How I confirmed it
I added timing instrumentation via
BASH_ENVand discovered that every Bash tool call spawned 2+ bash processes — the actual command plus the statusline script. The combined execution pushed past internal timing thresholds, causing output to be lost.Setting the statusline to
echo ''(no-op) immediately fixed everything —sleep 5 && echo test,gh pr list, parallel bash calls all work 100%.The fix
Replaced the heavy statusline with a lightweight version:
claude mcp list(spawns a full Claude Code subprocess, ~1.5s)wc -lloop on untracked filesjqon stdin JSON,git branch --show-current,git diff HEAD --numstat(all fast)Recommendation for Claude Code
The statusline command should probably run in a way that doesn't contend with Bash tool output capture — either:
I'm having the same issue in Windows 11.
<img width="1113" height="626" alt="Image" src="https://github.com/user-attachments/assets/843d2ac6-0f2c-49b2-b879-55f5ed442cb8" />
I've fixed it. The issue was that I had misconfigured the environment variable CLAUDE_CODE_GIT_BASH_PATH. It should point to /bin/bash.exe inside the Git installation directory, not the outer git-bash.exe.
Having the same issues on Windows
I had the same issue (#40977)
SHELL=/bin/bash gave another error
!echo a
/bin/bash: -c: line 1: syntax error: unexpected end of fileThen I realized I have an empty skeleton env file pointed to by CLAUDE_ENV_FILE, unsetting that or adding something to the file fixed my issue
Resolution:
CLAUDE_ENV_FILEenvironment variable causes silent Bash tool failureI hit this same issue — Bash tool returning empty output for every command, no stdout, no stderr. macOS (Darwin 24.6.0), zsh, Claude Code 2.1.70+.
Root cause
I had this in my
~/.zshrc:This was meant to inject environment variables (API keys, etc.) into the Claude Code session. However, it appears that Claude Code's handling of the
CLAUDE_ENV_FILEvariable interferes with subprocess stdio, causing the Bash tool to silently swallow all output.Fix
Remove the
CLAUDE_ENV_FILEexport and source the file directly instead:The environment variables still get loaded into the shell session (and are available to Claude Code), but without triggering whatever internal processing
CLAUDE_ENV_FILEdoes that breaks output capture.Symptoms before fix
Hope this helps anyone else hitting the same wall.
Similar problems seen in locked tickets:
https://github.com/anthropics/claude-code/issues/466
https://github.com/anthropics/claude-code/issues/616
https://github.com/anthropics/claude-code/issues/2958
https://github.com/anthropics/claude-code/issues/18469
https://github.com/anthropics/claude-code/issues/18670
https://github.com/anthropics/claude-code/issues/21915
https://github.com/anthropics/claude-code/issues/26413
https://github.com/anthropics/claude-code/issues/26462
https://github.com/anthropics/claude-code/issues/26486
https://github.com/anthropics/claude-code/issues/26540
https://github.com/anthropics/claude-code/issues/32778
https://github.com/anthropics/claude-code/issues/36966
Some seem to have resolutions, but all have very similar problems. Hopefully, pointing all the ones open to comments back to this one and showing the ones I couldn't add comments to will help everyone find solutions that work for them.
Confirming this on macOS 26.0.1 (build 25A362) with Claude Code 2.1.177 (CLI) — and flagging a downstream effect that I think matters more than the missing output itself.
Environment
Same core symptom: the Bash tool intermittently returns empty output (no stdout/stderr) even though the command actually executed.
Two things to add to the original report:
1. It's intermittent here, not 100%. Most Bash calls return output normally; only a fraction come back empty. That's arguably worse than a hard failure, because it's unpredictable and easy to miss.
2. The empty output induces the model to fabricate. This is the part worth highlighting. When the model receives an empty tool result on a step it expects to succeed, it tends to fill the gap with a prior — i.e. it hallucinates a plausible "success" output and keeps going. In one ~23-minute end-to-end session this cascaded: the model invented worktree-creation, env-setup, and
install-success output that never happened, then built a fully self-consistent but entirely fictional result on top of it. The same failure mode (filling missing signal with a prior) also made it "detect and refuse" a prompt-injection that did not exist in any input.So the impact isn't just "I can't see the output" — it's that the agent can silently produce confident, fabricated conclusions from a command that returned nothing.
Local mitigation (doesn't fix the root cause, just contains the blast radius): a
PostToolUsehook onBashthat detects empty stdout+stderr and injects a reminder telling the model not to assume success, and to re-verify real state with an independent command before continuing. Helpful as a stopgap, but the underlying stdio-capture bug clearly needs a real fix.Happy to provide debug logs if useful.