claude-code - 💡(How to fix) Fix [BUG] Bash tool unexpectedly runs all commands in background mode on macOS CLI, output never returned [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#60449Fetched 2026-05-20 03:58:18
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Fix Action

Fix / Workaround

Additional context:

  • Commands DO execute successfully (git commits/pushes ran correctly)
  • Only Bash is affected — Read, Write, Edit, Glob, Grep, MCP tools all work normally
  • Related to #19663 but different symptom (background task ID vs "(No content)")
  • Workaround: user manually runs commands in terminal

Code Example

Command running in background with ID: bxxxxxxxx. Output is being written to: /private/tmp/claude-501/<project-path>/tasks/bxxxxxxxx.output
RAW_BUFFERClick to expand / collapse

Environment:

  • macOS 15 Sequoia (Darwin 24.6.0)
  • Claude Code CLI v2.1.114
  • Model: claude-opus-4-7

Describe the bug: All Bash tool calls return a background task ID instead of executing inline and returning output. This happens without setting run_in_background: true, and persists even when using dangerouslyDisableSandbox: true.

Response from every Bash call:

Command running in background with ID: bxxxxxxxx. Output is being written to: /private/tmp/claude-501/<project-path>/tasks/bxxxxxxxx.output

Steps to reproduce:

  1. Open Claude Code CLI on macOS
  2. Ask Claude to run any Bash command (e.g. git status, date, ls)
  3. All commands return a background task ID — output is written to /private/tmp/ but never surfaced back to the model

Expected behavior: Bash commands execute inline and return output directly to the model.

Actual behavior: All commands run as background tasks. The output file is written to disk but the model never receives the content, causing a complete loss of Bash tool functionality.

Additional context:

  • Commands DO execute successfully (git commits/pushes ran correctly)
  • Only Bash is affected — Read, Write, Edit, Glob, Grep, MCP tools all work normally
  • Related to #19663 but different symptom (background task ID vs "(No content)")
  • Workaround: user manually runs commands in terminal

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