Bash execution issues on macOS — page 2
Issues the maintainers labelled both platform:macos and area:bash.
402 issues · 87 open · 315 resolved (78%) · first seen May 29, 2025
Is this getting better or worse?
This class of problem is converging. 152 new reports in the last 90 days vs 232 in the 90 before — -34%. The open backlog peaked at 87 in 2026-08 and sits at 87 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
270 of these reports name the Claude Code build they were running, spanning 118 releases. Heaviest reporters:
- Claude Code v2.1.119
- Claude Code v2.1.170
- Claude Code v2.1.81
- Claude Code v2.1.71
- Claude Code v2.1.76
- Claude Code v2.1.158
- Claude Code v2.1.74
- Claude Code v2.1.156
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 32 days across 315 closures. Of the 315 closures with a recorded reason, 23% were closed as completed and 242 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
146 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 - 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 - [BUG] Claude always using cd command into current working directory in combination with Git commands, requiring approval for whitelisted commands
- …n run git commands) - it ignores this Yolo mode is the only workaround and our admins disabled it. Platform windows
Found in the thread of #30832 · resolved
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 101–200
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 402 matches; the statistics above cover all 402.
- [BUG] Cypress commands are not performing properly in the VS Code native UI
- Catastrophic data loss — autonomous `rm -rf` destroyed user home subtree despite APFS case-insensitive ambiguity and existing safeguards
- [Bug] Claude Code executed unauthorized rm -rf due to case-insensitive filesystem path resolution
- [Bug] Bash execution fails when VM disk is full
- [Bug] Shell enters broken state when CWD is deleted by rm -rf
- [BUG] Shell snapshot does not honor ZDOTDIR - aliases from redirected config silently absent
- tree-sitter-bash stubbed out in Bun single-file binary — all Bash permission checks use legacy fallback
- [BUG] Interpreting regular expressions as paths for permission checks
- [BUG] Bash tool environment has RUSTUP_TOOLCHAIN=1.80.1 set from unknown source
- [BUG] Background Bash task's process group is SIGKILLed mid-run when the command spawns a daemonizing CLI (cursor-agent) — and reported as completed (exit code 0)
- [Bug] Worktree isolation blocks all Bash commands due to parser abort in bash-command classifier
- [Bug] Sub-agent backgrounded processes orphaned/SIGHUP'd on turn-end; no auto-resume on background exit
- [Bug] Bash tool invocations render as text instead of executing intermittently
- [Bug] agent autonomously changed directory and began to write code unprompted and committed unprompted
- [BUG] Sandboxed Bash output corruption during git operations; direct git ref reads remain correct
- PTY leak: Bash tool leaks master PTY file descriptors, exhausting kern.tty.ptmx_max
- [Bug] Multiple shell snapshot processes consuming 100% CPU causing battery drain
- [BUG] Claude Code ran batch API script as background task, signaled completion while processes still running - several hundred USD in charges
- [Bug] Claude ignores user instructions to not read shell profile, exposes secrets
- Bash tool results silently lost — agent waits forever (no timeout fires); correlates with Remote Control sessions
- [Bug] Claude hangs on certain bash commands in specific repository
- [Bug] `--help` flag not recognized, causing unintended command execution
- [Bug] ripgrep default color output corrupts text, --color=never workaroundSorr
- Background job (daemon) Bash cwd overridden to ~/.claude, ignoring job's recorded cwd/originCwd
- [BUG] Bash tool routes all commands to background tasks that never complete
- v2.1.132 (Cursor): parallel agent panels share one shell, sub-agent calls reset cwd mid-run
- Shell snapshot still drops underscore-prefixed zsh helper functions in v2.1.112 (recurrence of #40602)
- Push-to-main rail in auto mode: wildcard allow rules don't override; only exact-match works
- [BUG] rm -rf command executed without asking permission during ambiguous prompting
- Regression: Bash tool permanently broken when CWD is deleted mid-session (was fixed in #21580 / #26136, returned in 2.1.119)
- Claude suggests global `docker network prune -f` as "safe" — wipes networks across unrelated projects
- Telegram channel plugin MCP connection drops after Bash tool use (macOS Intel)
- [Bug] pgrep fork bomb causing session hang with repeated command execution
- auto-mode permission-deny envelope returned without intercepting Bash dispatch (silent-bypass on git push origin main, CLI 2.1.114, Opus 4.7)
- [Bug] Subagents silently terminate long-running background shells on turn end; SendMessage resumption auto-converts to async without warning
- [Bug] Bash pattern matching not applied to sourced commands in settings.json
- [BUG] Undisclosed background command execution burning user credits without consent — Claude Sonnet 4.6
- Bash tool drops `cd` prefix from `command` parameter while text output correctly includes it
- [BUG] Long-running Bash tool (900s timeout) completes but tool_result never delivered — conversation silently rewound via isMeta synthetic message
- Feature request: Use zsh (or login shell) for Bash tool on macOS
- Desktop app ignores settings.json env block and shell profile PATH on macOS
- ! (bash mode) commands produce no output for filesystem commands
- Compound command re-prompts in same session after approval
- [BUG] Claude Code auto-backgrounds Bash commands containing cd + piped chains, causing permanent deadlocks
- [Bug] Shell builtins bypass deny patterns when invoked with absolute paths
- Issue closed - please delete
- [Bug] Agent unsafe shell execution allows destructive commands and session state corruption
- [BUG] Bash permission matcher fails when command arguments contain literal parentheses (e.g. Next.js route groups)
- [Bug] Ralph-loop: Backticks in quoted prompts passed to Bash causing command substitution error
- Bash tool loses HOME and PATH env vars in some sessions
- [BUG] PostToolUse hooks do not fire on failed Bash commands (non-zero exit code)
- [BUG] [CRITICAL] Project Directory Deletion during background task conversion with Sonnet 4.6 1mln context
- [BUG] v2.1.59: "Always allow" suggests overly broad wildcard instead of specific subcommand
- Worktree-isolation Bash guard refuses every compound command, even with no git usage at all
- Bash tool: "wc" via command substitution fails with "command not found" inside a for-loop with 2+ items
- [MODEL] Major Data loss. Agent-constructed test payload with $(...) executed for real due to bash double-quote handling — rm -rf ~ ran against live home directory
- [BUG] Shell grep shim: BRE alternation \| combined with literal ( produces 'rg: regex parse error: unclosed group'
- Permission system doesn't match Claude's natural Bash generation patterns (multi-line scripts, variable-assignment prefixes)
- Desktop app leaks PTY masters until system PTY limit (511) is exhausted — Terminal fails with 'forkpty: Device not configured'
- Pty (pseudo-terminal) fd leak exhausts macOS pool until forkpty fails system-wide
- [BUG] Claude code is hanging on every command.
- [BUG] Regression: Bash tool again escapes "!" → "\!" (regression of #32864, fixed in 2.1.87)
- 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
- Auto-backgrounded/interrupted Bash commands outlive their turn and can destructively race later commands
- [BUG] Bash command containing `python3` execute without permission prompt when no allow rules are configured and sandboxed
- [BUG] PreToolUse hook for Write/Edit can be bypassed by writing files via the Bash tool
- Regression (2.1.149 → 2.1.156): 1Password `op` CLI session broke in Bash tool calls on macOS
- 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)
- 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