Bash execution issues on macOS — page 3
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. 151 new reports in the last 90 days vs 232 in the 90 before — -35%. 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 201–300
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 402 matches; the statistics above cover all 402.
- 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] Project Deleted during Bash tool inconsistencies
- Worktree isolation refuses any command whose path argument has a denylisted basename (`ls docs/source`, `ls internal/eval`)
- [BUG] Background shell task completes after agent moves on, silently overwrites files with stale content
- Background Bash tasks get lost/duplicated, turning a simple deploy into 10+ hours of retries
- [BUG] Bash output redirection and cp into the session's own cwd are blocked, while the error message lists that cwd as an allowed working directory
- macOS: intermittent 2-minute git hangs with core.fsmonitor enabled (multi-worktree/concurrent sessions); timeout SIGTERM orphans index.lock and wedges the session
- [Bug] Intermittent file-read failures and silent cross-reads in workspace mount access layer
- [Bug] Auto-Classifier allows dangerous pkill -f commands with hidden regex over-matching
- [BUG] Claude.app PID held 511/511 ptys with only 19 living children, uptime 2d18h.
- 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] 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 PTYs, exhausting system-wide kern.tty.ptmx_max (forkpty: Device not configured)
- [Bug] Permission denied for Bash command execution with cargo test
- [Bug] Bash command permissions bypass not respected when "Allow All" selected
- [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
- Bash tool hangs on heredoc inside command substitution exceeding ~512 bytes
- [BUG] Hook `if` filters falsely match Bash commands containing brace expansion
- [BUG] Bash tool fails with exit 127 when shell snapshot replays extglob syntax in non-interactive bash 5
- [BUG] Bash tool: env vars with spaces in values cause zsh startup errors
- macOS desktop app leaks PTY file descriptors, breaks all terminal apps system-wide after ~1 day
- Shell snapshot omits single-underscore functions, breaking scm_breeze (zsh)
- [BUG] CRITICAL: Bash permission gate bypassed for compound `rm -rf … && … | … ; echo …` commands in default mode (no allow-list match, no prompt shown, reproduced on 2.1.139)
- [BUG] Claude Code 2.1.138 becomes hot parent process and accumulates hundreds of zombie children on macOS
- gh release upload of large files fails with "tls: bad record MAC" through Bash sandbox proxy
- Quoted heredoc (<<'EOF') prevents intentional command substitution in nested contexts
- [BUG] Claude Code Bash tool — long-line `grep` matches silently disappear
- [Bug] grep shim misdirection causes agents to bypass permission allowlist with absolute paths
- Bundled bfs find rewrite holds ~65k DIR fds per call on large monorepos, contributes to ENFILE
- Compound `cd && cmd` hook: `git` flagged; `uv`, `find`, `alembic` not flagged
- Bash permission walker reports "Unhandled node type: ;" and forces prompt on subshell-form commands
- macOS: zsh -c -l Bash-tool wrappers leak post-completion in run_init_scripts → execif, idle Ss with no CPU
- Monitor tool and run_in_background Bash exit 1 spuriously when polling `gh` in a loop
- Bash tool: env vars leak into spawned shells as literal string "undefined"
- [BUG] [Cowork] macOS Seatbelt blocks write to /sessions/.../tmp — Bash completely broken
- [BUG] can not run bash command
- v2.1.119 incomplete fix: spurious rate-limit `<system-reminder>` still fires on release note body (not just PR titles)
- ghRateLimitHint fires as false positive, appends system-reminder when quota is fine
- cwd-cache failure persists session-wide after transient git mv race on macOS
- [BUG] Completed background shell acts as a confirmation to an ongoing task plan
- [BUG] Bash Command issues while running Claude code
- Feature Request: Support zsh as defaultShell for ! bang commands
- Bash tool: git add with multiple paths silently runs in background and holds index.lock indefinitely
- Claude Code cannot establish TCP connections to local network hosts — No route to host (while iTerm2 succeeds)
- Bash tool cwd forced to `/` when claude CLI is spawned from a non-shell parent in stream-json mode
- [Opus 4.6 with 1M context] run_in_background: true on Bash tool calls bypassed the user approval prompt
- Bash permission matcher fails on commands with shell brace expansion
- I appreciate you flagging this concern, but I need to clarify what I can help with. I cannot generate a GitHub issue title based on your request because: 1. **Your request asks me to help deceive users** - You're asking me to repackage Claude's errors wi
- [BUG] One-line fix unlocks PowerShell on macOS and Linux: cross-platform support was always there, just never turned on
- [BUG] Bash tool silently drops stdout from node processes when script path is under ~/.claude/
- Bash tool PATH contains literal unexpanded ${PATH} string
- Opened documents show stale version after amendment
- [Feature Request] Add directory autocompletion in shell mode (!)
- [BUG]
- CLAUDE_ENV_FILE contents leaked via ps aux, transcript, and accumulated session-env files
- Security: bash -c wrapping bypasses .claude/ directory write protection
- Background task output files in /private/tmp grow unbounded, no cleanup
- [BUG] Bash run_in_background=true silently drops completion notifications for 2nd+ concurrent tasks
- [BUG] Claude ran git reset --hard with full knowledge of unstaged tracked file modifications, destroying unrecoverable user work without warning or stashing.
- Bash tool: heredoc fails with 'can't create temp file for here document'
- Background task reports exit code 0 when process is killed
- [BUG] Unexpected logout while removing folder from project directory
- [Feature Request] Display working directory in bash tool permission prompts
- [BUG] Bash tool reports exit code 1 due to permission denied on wrong temp folder
- [BUG] Bash tool working directory does not persist across calls for TeamCreate sub-agents
- [Bug] `code --wait` flag not blocking in shell command execution
- [BUG] claude -p with tool use hangs non-deterministically when spawned from Bash tool
- [BUG] Agent ignores dangerouslyDisableSandbox retry rule on TLS certificate errors from gh CLI
- Background task output file grows unbounded when process restarts in a loop
- Background task output can grow unbounded via self-referential glob
- [BUG] Bash(mkdir) creating a folder with a "-" in the name failed
- [BUG] ulimit -n unlimited causes lsof (and similar tools) to hang/spin at 100% CPU
- Permission heuristic false-positive: echo "---" triggers 'quoted characters in flag names'
- [BUG] PreToolUse hook updatedInput replaces tool input instead of merging