Bash execution issues on Windows
Issues the maintainers labelled both platform:windows and area:bash.
254 issues · 54 open · 200 resolved (79%) · first seen Feb 23, 2026
Is this getting better or worse?
This class of problem is converging. 84 new reports in the last 90 days vs 130 in the 90 before — -35%. The open backlog peaked at 61 in 2026-04 and sits at 54 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
145 of these reports name the Claude Code build they were running, spanning 75 releases. Heaviest reporters:
- Claude Code v2.1.53
- Claude Code v2.1.81
- Claude Code v2.1.111
- Claude Code v2.1.143
- Claude Code v2.1.112
- Claude Code v2.1.63
- Claude Code v2.1.69
- Claude Code v2.1.233
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 200 closures. Of the 200 closures with a recorded reason, 24% were closed as completed and 152 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
112 of these issues post a workaround someone says worked. The highest-engagement ones:
- [BUG] Permission prompt incorrectly triggers on cd instead of the actual command in compound bash statements
- I'm having some success with the following very explicit workaround in :
Found in the thread of #28240 · still open - [BUG] Unnecessary "cd" prepended to Bash commands on Windows due to path format mismatch
- …ermission system matches the instead of the actual command. Workaround — PreToolUse hook to auto-approve cd-prefixed commands: includes a hook that handles this pattern while still blocking dangerous commands in the chai…
Found in the thread of #30524 · resolved - [BUG] Stale .git/index.lock left behind after Bash tool git commands on Windows
- …to it exists, even if the process has logically completed. Workaround Manually delete the lock file: Environment - OS: Windows 11 Enterprise 10.0.26200 - Shell: Git Bash - Claude Code: Latest (CLI) - Related: 11005 (clo…
Found in the description of #28546 · still open - [Bug] Bash tool execution failing or non-functional
- …fine to the same directory. Rolling back to 2.1.52 per the workaround.
Found in the thread of #28333 · resolved - [Bug] EINVAL on Windows: Bash commands fail - cannot open task output file
- Still reproducible on v2.1.56 — workaround found Environment: - Claude Code v2.1.56 (native install) - Windows 11 Pro Build 26200 - Git Bash (C:\Program Files\Git\bin\bash.exe) Finding: The v2.1.55 fix is incomplete. The…
Found in the thread of #28364 · 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 1–100
Ranked by community engagement (reactions weighted over comments).
- [BUG] Permission prompt incorrectly triggers on cd instead of the actual command in compound bash statements
- [BUG] Unnecessary "cd" prepended to Bash commands on Windows due to path format mismatch
- [BUG] Stale .git/index.lock left behind after Bash tool git commands on Windows
- [Bug] Bash tool execution failing or non-functional
- [Bug] EINVAL on Windows: Bash commands fail - cannot open task output file
- Permission system UX: compound command blocking, rule accumulation, undiscoverable Bash(*) fix
- [BUG] GitHub Issue: Bash tool EINVAL on Windows
- [BUG] Windows Git Bash: static analysis false-positives on read-only cd-compound commands cause constant, unsuppressable permission prompts (since 2.1.232 / auto-mode rollout)
- session-env dir locks and requires manual rmdir to unstick Bash tool on Windows
- [BUG] [Windows] Bash tool EINVAL error due to 8.3 short path in temp directory
- [BUG] Bash tool EINVAL on Windows persists in v2.1.53 — stdio fd regression from v2.1.45 not fully fixed
- Windows: Bash/PowerShell tool calls flash visible conhost window
- v2.1.53: EINVAL on every Bash command when launched from PowerShell on Windows
- Windows Git Bash: multiple recurring command issues (nul, python, paths, flags, eval escaping)
- Command runner false-positives: echo string with hyphens flagged as flag, glob patterns blocked in safe contexts
- [MODEL] Uses PowerShell here-string (@'...'@) inside the Bash tool on Windows, silently corrupting a git commit message
- [BUG] Bash tool EINVAL on Windows when project path generates long temp directory name
- Windows: Bash commands spawn visible black console windows
- CLAUDE_ENV_FILE written but not sourced for Bash tool calls on Windows
- [BUG] Windows + Git Bash: tengu_cobalt_ridge experiment silently force-enables the PowerShell tool & "Shell: PowerShell", causing wrong-shell retries (token waste)
- [BUG] Claude Code `-EncodedCommand` PowerShell Execution Blocked by EDR/AV — No Opt-Out Available
- [Bug] v2.1.121 Windows: Claude Code REPL silently exits inside PowerShell host during long-running agent + dense Bash subprocess chain
- [BUG] EEXIST: mkdir 'session-env/<UUID>' when .claude is a symlink to OneDrive-synced folder (Windows)
- [BUG] claude deleted all my files, need to have a refund of claude code max x20
- [BUG] Bash tool fails on Windows when user profile path contains apostrophe
- [BUG] Windows: Bash tool (grand)children survive command completion/kill as unkillable orphans — no per-command Job Object, and `SILENT_BREAKAWAY_OK` defeats the one that exists
- [BUG] - Windows: PowerShell tool pre-validation intermittently fails with pwsh exited with code 1: the command line is too long / pwsh timed out after 5000ms, blocking shell commands behind approval-prompt loops
- [Bug] Linux sandbox unavailable: bash hard failure preventing tool execution
- [Bug] Error: Contains backslash-escaped whitespace validation too strict
- Unhandled node type: string in Bash tool confirmation dialog
- [BUG] Cowork (Windows): Claude Code child process exits with code 1 immediately on spawn; misleading CLAUDE_CODE_GIT_BASH_PATH warning
- [BUG] Claude code windows app ssh connection not working
- [BUG] Bash tool bypasses settings.json path deny rules — shell commands not subject to file tool access controls
- Shell snapshot generates invalid bash: empty if/then/fi when rg is already installed
- Bash tool fails with EINVAL on Windows (v2.1.53)
- [BUG] `EINVAL: invalid argument` on Bash tool - output file creation fails on Windows (non-C: drive)
- [BUG] Windows: PowerShell tool absent from schema when Git Bash is on PATH, despite pwsh.exe being present and detectable
- Background bash children survive session close; task-output files have no size cap (4.86 TB runaway on Windows)
- [BUG] Windows: bash non-functional inside auto-created worktrees — unrecoverable deadlock
- [BUG] Bash tool output silently empty on Windows (Git Bash) in long sessions
- [Bug] Bash tool fails on Windows 11 with EINVAL when writing temp output files
- [BUG] Bash tool fails with EINVAL on Windows - cannot open task output file
- [BUG] tasks/ directory not created automatically on Windows (v2.1.53)
- [BUG] Claude Code Desktop for Windows always starts Powershell
- [Bug] PowerShell commands executed through bash instead of PowerShell
- bash.exe.stackdump files left behind in working directories on Windows (Git Bash / MSYS2)
- Shell snapshot captures base64-encoded functions from git-completion.bash, breaking all Bash commands on Windows
- [BUG] Critical Bug: Claude Code executed 'rm -rf' and deleted project files unexpectedly
- [Bug] Auto mode regression: unnecessary compound command permission prompts on Windows
- Compound-command permission prompting makes multi-session orchestration unusable (700+ prompts on non-mutating chains)
- [BUG] Unacceptable File Access
- [BUG] Cygwin: CWD temp file path missing /cygdrive prefix
- Claude defaults to bash/Unix syntax on Windows instead of PowerShell
- [BUG] Git Bash detection regression in versions after 2.1.69 (and native binary) and latest
- [BUG] Bash tool breaks single-quoted heredocs containing single quotes — unexpected EOF while looking for matching error
- Bash tool silently collapses `\\` to `\` in command text, corrupting regex and paths
- Windows: PowerShell commands incorrectly routed to Bash tool, causing crash
- [BUG] Claude Code repeatedly generates invalid tool invocations
- [BUG] Windows: ENOENT mkdir 'E:\claude-tmp\...\tasks' — all Bash tool calls fail
- [BUG] Bash calls fail when Windows PATH environment variable contains parentheses
- [BUG] claude should not be allowed to start claude. (Denial of service vulnerability: exploit with prompt: "sessions")
- Bash(*) wildcard in permissions.allow doesn't match all Bash commands
- [BUG] [Windows] rm -rf on pnpm project deleted entire C:\Users via NTFS junction traversal — Claude Code v2.1.51
- [BUG] Bash tool EINVAL on task output file open — regression in v2.1.45+ (Windows 11, native)
- [BUG] Bash tool returns EINVAL on all commands for specific project directory (Windows)
- [BUG] Crash: undefined is not an object (evaluating 'H.command') in isSearchOrReadCommand on Windows
- Claude killed 31 user browser processes without consent (Stop-Process -Force on Brave)
- [BUG]
- [BUG] Claude carelessly deletes uncommited work by dropping git stash that failed to pop (commonly repeating pattern)
- [Data Loss] Claude Code executed rm -rf and permanently deleted ~1500 files / ~50GB
- [BUG] Bash fork fails with STATUS_DLL_INIT_FAILED (0xC0000142) on Windows 11
- [BUG] Claude Code executed rm -rf /* on production VPS due to SSH variable escaping error
- [BUG] rm -rf with unexpanded ${LOCALAPPDATA} in bypassPermissions deletes real system directory
- [BUG] No Bash output - Claude Code v2.1.74 (desktop app)
- Windows: /exit does not terminate child bash.exe processes — orphaned shells cause system-wide slowdown
- [BUG] VSCode extension: Bash tool does not capture stdout (commands run in popup terminal window)
- [BUG] Claude Code repeatedly uses Bash syntax (extglob) on Windows PowerShell and fails to adapt
- [Bug] Shell tool fails with EINVAL error on Windows temp directory access in v2.1.53
- Windows/Git Bash: Bash tool silently halves backslashes in commands (MSVCRT vs MSYS2 command-line encoding mismatch)
- [BUG] Hanging find.exe
- Windows: PowerShell/Bash tool-call windows pop up and steal focus, especially during scheduled/background task execution
- [Bug] Opus 4.8: parallel Bash siblings stuck on Waiting… and render out of order behind a long-running call
- [BUG] Bash commands produce no output on Windows 11
- [BUG] Claude Desktop (MSIX) bundled bash leaks TEMP=/tmp into child JVMs, breaking Gradle and any Java Selector.open() on Windows
- [BUG] Bash tool hangs indefinitely when 2>&1 combined with pipe — regression in 2.1.x, high frequency with non-Anthropic backends
- [BUG] [Windows] Bash tool causes BSOD (SYSTEM_SERVICE_EXCEPTION) on Windows 11 with HVCI enabled
- [FEATURE] Support explicitly specifying location of pwsh.exe
- [Bug] Sub-agent recursive delete via typo'd path destroys codebase on NTFS
- [BUG]
- [BUG] Windows: pwsh.exe stdout/stderr not captured by PowerShell tool or via Bash tool, both via app alias and direct path; powershell.exe works fine in same session.
- [BUG] STACK DUMP
- [BUG] Claude constructs &&-chained command with ||-tolerant loop + trailing rm -rf, swallowing failures and wiping working tree
- [FEATURE] Powershell default to 5.1 or add option to use 5.1
- [BUG] SSHFS/network drive mounts fail directory validation in v2.1.82+ (regression from v2.1.81)
- Bash tool non-functional on Windows: no executables found in PATH
- [Bug] Permission allow rules not applied for Bash(mkdir) in skill contexts and default mode
- [BUG] Windows 11 ARM64: CLAUDE_CODE_GIT_BASH_PATH not recognized with ARM64 Git for Windows, space-free path
- [BUG] Bash deny rules appear non-recursive for nested execution contexts ($(), backticks, subshell, eval, PowerShell wrapper)
- [Feature Request] Shell command tab completion for ! prefix commands
- [BUG] VS Code extension crashes with exit code 1 on every Bash tool invocation (Windows)