Skip to content

Claude Code CLI Bug Report: Bash Tool Returns No Output on macOS 26 #19663

@randykerber

Description

@randykerber

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Use Claude Desktop's Claude Code feature (works perfectly)
  2. Use file-based tools (Read/Write/Edit/Glob/Grep) which work fine
  3. 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

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)

  1. Open Terminal.app or Warp
  2. Run: claude
  3. Execute: Run: echo "test"
  4. Result: "(No content)"

Desktop Test (Works)

  1. Open Claude Desktop app
  2. Use Claude Code feature
  3. Execute: Run: echo "test"
  4. 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)'

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions