Bash execution issues on macOS — page 3
Issues the maintainers labelled both platform:macos and area:bash.
507 issues · 136 open · 371 resolved (73%) · first seen May 29, 2025
Is this getting better or worse?
This class of problem is holding steady. 159 new reports in the last 90 days vs 207 in the 90 before — -23%. The open backlog peaked at 136 in 2026-10 and sits at 136 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
362 of these reports name the Claude Code build they were running, spanning 157 releases. Heaviest reporters:
- Claude Code v2.1.119
- Claude Code v2.1.170
- Claude Code v2.1.81
- Claude Code v2.1.278
- Claude Code v2.1.71
- Claude Code v2.1.76
- Claude Code v2.1.158
- Claude Code v2.1.74
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 33 days across 371 closures. Of the 371 closures with a recorded reason, 20% were closed as completed and 297 as not-planned or duplicate. The most recent completed fix landed in 2026-09.
Workarounds reported by the community
177 of these issues post a workaround someone says worked. The highest-engagement ones:
- [BUG] autoAllowBashIfSandboxed bypassed for commands containing shell expansions and several other constructs
- …t's a significant workflow regression. Partial source-level workarounds: - Quote the variable AND ensure the string has literal content ( works; alone prompts). - No workaround for , brace expansion, ANSI-C strings, here…
Found in the description of #43713 · resolved - [BUG] Bash tool calls emitted as raw <invoke> text instead of executing
- …with the in-context few-shot poisoning hypothesis in 62344) Workaround that helped (not a fix) Switching to mid-session reduced the recurrence, consistent with 64774's finding that 4.7 and Sonnet 4.6 have ~0% failure rat…
Found in the thread of #63870 · still open - macOS: PTY file descriptors leaked across a long Bash-heavy session, exhausting kern.tty.ptmx_max (forkpty / posix_openpt fail with ENXIO system-wide)
- …h PTY (tmux, screen, ssh's local PTY allocation, etc.). The workaround is to quit and relaunch Claude. The 511 PTYs release on process exit and Terminal works again immediately. Environment - macOS: 26.4.1 (build 25E253)…
Found in the description of #57580 · resolved - bypassPermissions mode now prompts on `cd DIR && grep …` when a Read() deny rule is configured (regression in 2.1.259)
- …ws the mode was throughout and auto mode was never entered. Workaround Tell agents not to use prefixes or recursive grep over directories (use explicit file lists or a file-search tool). That removes the prompts but mean…
Found in the description of #91683 · still open - Task runner reports ENOSPC on subprocess output despite disk having free space
- …rsation (new UUID) does NOT durably fix it, contrary to the workaround mentioned here. A new session works for the first command or two (builtins like pass), then the next external process ( , , ) hits ENOSPC — and this…
Found in the thread of #63909 · still open
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 201–300
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 507 matches; the statistics above cover all 507.
- Bash tool: runaway child processes are memory-uncapped and outlive their parent shell's timeout — parallel sub-agents' orphaned pytest children exhausted 128 GB RAM and caused a macOS watchdog kernel panic
- [Bug] Bash tool ENOSPC error on stdout/stderr capture despite available disk space (macOS)
- [BUG] Regression: Bash tool again escapes "!" → "\!" (regression of #32864, fixed in 2.1.87)
- [BUG] Truncated shell snapshot silently drops plugin bin/ PATH entries (partial snapshot used after builder is killed)
- macOS desktop app leaks PTY masters (/dev/ptmx) until system-wide PTY exhaustion (ENXIO)
- Claude desktop app leaks /dev/ptmx master fds, exhausting the OS pty pool (forkpty: Device not configured)
- [BUG] macOS native build: shell-snapshot grep/find/rg shadowing kills bash mid-command (silent truncation); false 'temp filesystem is full (0MB free)' ENOSPC banner from broken statfs (bsize=0)
- Claude Desktop leaks pseudo-terminals (ptmx) until the macOS pty pool is exhausted, breaking Terminal.app
- [BUG] Bash security heuristic false-positives on Next.js dynamic route brackets [param] — blocks write commands despite allow rules
- Claude Code shell does not inherit AWS_REGION from user's terminal session
- [BUG] [Tool result missing due to internal error] is unattributed, undiagnostic, and hangs the agent
- PTY master fd leak in Claude desktop app exhausts macOS kern.tty.ptmx_max after ~2-3 days
- Bash tool returns "internal error" on git commit under fish + multi-step pre-commit hooks (cmd actually succeeds)
- [BUG] Bash tool: env vars with spaces in values cause zsh startup errors
- Shell output exposes sensitive environment variable values in plaintext
- [BUG] Claude Code requesting sudo in Mac OS terminal
- macOS: pty FD leak in Claude Desktop Electron parent — kern.tty.ptmx_max exhaustion blocks new terminals
- Bash deny rules are ignored and responses hallucinated consuming entire session
- Bash tool wedges into 'Stream closed' state after long-running subprocess
- Bash tool: zsh wrappers persist after pipe-truncated commands → zombie processes accumulate and block subsequent git operations
- Bash tool SIGBUS in .claude/worktrees/ via Helpers/disclaimer provenance-pid chain (Claude Desktop 1.8089.1)
- [Bug] macOS incompatible `head -n` command destroyed production database manifests
- [BUG] [Claude Desktop] Stopping Command Crash Zsh
- [MODEL] Asked why I am not allowed to remove a disk because it is still using it and deleting random files.
- [BUG] Shell snapshot captures compdef without completion state, breaking zsh functions that register completions
- Shell snapshot overrides `.zshenv`, breaking cwd-aware shell setup
- [Bug] Claude Code's bundled find replacement (ARGV0=bfs claude -S dfs ...) crawls Time Machine snapshots on macOS, leaks orphaned processes, and degrades the host
- [BUG] parallel Bash calls get cancelled when grep returns exit code 1
- Bash `sed -i` chained command silently emptied source file, wiping work
- [BUG] CLAUDE_ENV_FILE variables not available in Bash on resumed sessions (--continue/--resume)
- [BUG] Bash output renderer dumps Ink scrollback source when grep -n returns non-contiguous matches (v2.1.119, Agent Teams)
- [Bug] Embedded `bfs`/`ugrep` not exposed in `Bash` tool (native macOS build 2.1.117+)
- [Bug] Bash tool not auto-sourcing CLAUDE_ENV_FILE in shell initialization
- [BUG] Shell snapshot exports PATH with single-quoted ${PATH}, preventing expansion
- [BUG] "(Bash completed with no output)" if CLAUDE_ENV_FILE's last line is commented out
- [Bug] Bash(pattern:*) in --allowedTools/--tools does not restrict commands
- [BUG] CLI suspended with SIGTTIN after Bash tool child processes exit
- [Bug] Bash commands not executing - unclear error messaging for environment issues
- PreToolUse hook 'allow' cannot bypass Bash sensitive path ask rules (unlike Edit/Write)
- [BUG] Auto-approve patterns don't match multiline commands
- [BUG] Background bash with heredoc >512 bytes deadlocks — unix socket connections hang
- CJK (Japanese) text garbled in CLI output and gh commands when locale is ja_JP.UTF-8
- [BUG] Destructive batch rename operation caused data loss
- Shell snapshot ignores ZDOTDIR — sources hardcoded ~/.zshrc instead of $ZDOTDIR/.zshrc
- Claude Code deployed to wrong Firebase project — no confirmation safeguard for destructive deploy commands
- Shell snapshot hardcodes process.env.PATH instead of capturing shell's PATH
- Shell snapshot captures parent process PATH instead of login shell PATH (macOS, Claude Desktop, v2.1.87 regression)
- [BUG] Shell tool broken when using empty env file, bash gives syntax error, zsh swallows stdout
- Desktop app: Bash tool file writes silently revert even with sequential execution
- [BUG] All bash commands are running indefinitely
- joblib loky backend leaks memory when stdout is piped through Claude Code; tqdm progress bar broken
- [Bug] Dotnet build processes not cleaned up, causing resource exhaustion on macOS
- [BUG] ask/deny permissions bypassed when Bash command cd's outside the launch directory
- [BUG] Bash tool call drops "cd /path &&" prefix from SSH commands silently
- Kill bash session ('k' hotkey) triggers runaway spawn loop, 10+ GB memory consumption
- [Bug] Shell commands incorrectly prefixed with `cd` to current directory, breaking command whitelisting
- [BUG] FileSpiller continues writing identical content after bash process exits (480GB from 81KB of actual output)
- [BUG] cwd bug (b3 function) - spaces in directory path names
- [BUG] Claude Code isn't picking up environment variables correctly
- Background tasks report 'completed' but output files are missing or empty
- [BUG] Shell wrapper doesn't quote SSH_AUTH_SOCK — breaks with 1Password agent path containing spaces
- [BUG] Bash tool returns empty output for long-running streaming processes (totalBytes stuck at 0)
- Bash tool output duplicated on non-zero exit code
- Permission rule Bash(cd:*) allows arbitrary command execution via && chaining
- Compound commands of individually-allowed safe commands prompt with incorrect safety reason
- [BUG] Bash permissions are ignored
- [BUG] scripts/edit-issue-labels.sh crashes with unbound variable under Bash < 4.4 and exits silently on empty arguments
- [Bug] Auto mode ran `pkill -f "cat"`, which killed every GUI app on macOS ("cat" matches /Applications)
- [BUG] VS Code extension stuck on Bash polling command after the shell exited; Stop button does nothing
- Bash permission rules are quote-blind: an operator inside a quoted argument defeats a matching rule
- Cross-session message delivery kills the recipient session's in-flight background Bash tasks
- Auto-update breaks grep/find in the Bash tool for already-running sessions (silent fallback to a stale CLI)
- Bash run_in_background ignores `timeout` and a never-exiting background task produces no notification
- Bug: interrupting a running Bash tool call does not prevent its side effect, but the rejection text says nothing was written
- Worktree isolation: string-executing builtins (eval, enable) are matched in argument position — `echo eval` is refused
- Worktree-isolation refusals all carry a fixed "run without the redirect" remedy, even when there is no redirect
- [Bug] Sandbox file-read deny rule (.env*) not enforced for compound Bash commands in Agent-dispatched subagents
- Bash/Monitor tool descriptions teach unbounded wait loops; foreground timeout does not kill the process group (leaked orphan shells, 41% CPU for 2d9h)
- Withdrawn
- [BUG] Persistent EACCES on Bash tool output dir (mkdir .../tasks) with two sessions in same project
- [BUG] All Bash tool commands hang indefinitely — no child process is ever spawned (macOS, v2.1.228)
- Killed sandboxed command leaks its SOCKS socket; main thread then spins on EPIPE at 100%+ CPU
- [Bug] Bash-tool grep wrapper still silently returns nothing on text files with a stray NUL byte (2.1.220) — #56644 was auto-closed as stale, not fixed
- scripts/gh.sh fails with "FLAGS[@]: unbound variable" on flagless invocations under macOS bash 3.2
- [Bug] Claude still wraps commands in unavailable `timeout`/`gtimeout` on macOS instead of using built-in bash-timeout (re-file of locked #3361 / #10600)
- Claude Sonnet 4.6: ignored Darwin platform context, emitted GNU grep flag
- [BUG] Claude Code (Opus 4.8) repeatedly fails to use MacOS grep correctly, losing a lot of time
- Bash tool cwd does not persist across tool calls; hooks receive stale cwd instead of triggering command's actual directory
- [Bug] Terminal commands with `!` prefix now incorrectly trigger Claude analysis
- [Bug] GITHUB_TOKEN in environment shadows user's gh CLI credentials
- [BUG] For this Git hub Bug [BUG] Claude CLI wiped my Quartz Shopify theme twice in hours — first production, then dev preview. A duplicated serious incident like this is not acceptable and needs urgent attention.
- Bash tool result contains injected system-style annotation instructing model not to disclose to user
- [Bug] Unrecoverable data loss from folder deletion due to malformed command syntax
- Unguarded `rm -rf` after a silently-failed `mv` causes irreversible data loss on a cloud-sync (file-provider) mount
- [Bug] Auto-Classifier allows dangerous pkill -f commands with hidden regex over-matching
- Bash tool sets redacted/direnv-managed env vars to the literal string `"null"` instead of unsetting them
- [Bug] Script execution false confirmation followed by file deletion and error misreporting
- [BUG] Bash tool fails on every command with declare: not valid in this context: SENTRY-TRACE when launched from Claude Desktop
- Claude Desktop leaks pty devices (node-pty masters never released) → macOS hits kern.tty.ptmx_max, no terminal can spawn
- [Feature Request] Add real-time output streaming for long-running commands