Bash execution issues on Windows
Issues the maintainers labelled both platform:windows and area:bash.
335 issues · 100 open · 235 resolved (70%) · first seen Feb 23, 2026
Is this getting better or worse?
This class of problem is holding steady. 110 new reports in the last 90 days vs 125 in the 90 before — -12%. The open backlog peaked at 100 in 2026-10 and sits at 100 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
210 of these reports name the Claude Code build they were running, spanning 102 releases. Heaviest reporters:
- Claude Code v2.1.53
- Claude Code v2.1.286
- Claude Code v2.1.281
- Claude Code v2.1.259
- Claude Code v2.1.81
- Claude Code v2.1.251
- Claude Code v2.1.111
- Claude Code v2.1.278
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 34 days across 235 closures. Of the 235 closures with a recorded reason, 23% were closed as completed and 182 as not-planned or duplicate. The most recent completed fix landed in 2026-10.
Workarounds reported by the community
139 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] Bash cd-compound-read guard prompts on absolute cd targets whenever a Read() deny rule exists (Windows Git Bash, 2.1.257-2.1.259)
- …ing the 2.1.259 changelog entry added. One more note on the workaround: removing the deny rules is not something the agent can do for you when is in effect. Both the Bash edit and the Edit tool call on are refused by the…
Found in the thread of #91650 · 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 - 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
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). Listing the top 300 of 335 matches; the statistics above cover all 335.
- [BUG] Permission prompt incorrectly triggers on cd instead of the actual command in compound bash statements
- [BUG] Bash cd-compound-read guard prompts on absolute cd targets whenever a Read() deny rule exists (Windows Git Bash, 2.1.257-2.1.259)
- [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
- bypassPermissions mode now prompts on `cd DIR && grep …` when a Read() deny rule is configured (regression in 2.1.259)
- [Bug] Bash tool execution failing or non-functional
- Permission system UX: compound command blocking, rule accumulation, undiscoverable Bash(*) fix
- [Bug] EINVAL on Windows: Bash commands fail - cannot open task output file
- Bash Read() deny rules prompt on cd compounds even when the cd target is a literal path (2.1.259)
- Windows/Git Bash: Bash tool silently halves backslashes in commands (MSVCRT vs MSYS2 command-line encoding mismatch)
- [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)
- Windows: Bash/PowerShell tool calls flash visible conhost window
- 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
- 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)
- Bash tool silently collapses `\\` to `\` in command text, corrupting regex and paths
- 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] v2.1.121 Windows: Claude Code REPL silently exits inside PowerShell host during long-running agent + dense Bash subprocess chain
- [BUG] Windows: Bash commands >8KB silently truncated, backslash pairs silently collapsed (argv transport to MSYS2 bash)
- [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] Claude Code `-EncodedCommand` PowerShell Execution Blocked by EDR/AV — No Opt-Out Available
- [BUG] EEXIST: mkdir 'session-env/<UUID>' when .claude is a symlink to OneDrive-synced folder (Windows)
- [Bug] Bash tool silently strips backslashes on Windows/Git Bash
- Windows: Git Bash shell-snapshot embeds raw Windows PATH unconverted, breaking short-name command resolution
- [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] 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
- Bash tool unescapes backslashes inside a quoted heredoc
- [Bug] Linux sandbox unavailable: bash hard failure preventing tool execution
- [Bug] Error: Contains backslash-escaped whitespace validation too strict
- [BUG] Windows: Bash tool commands are silently truncated at ~8,181 chars of the bash.exe -c argument, and every \\ is halved
- [BUG] Windows: PowerShell tool absent from schema when Git Bash is on PATH, despite pwsh.exe being present and detectable
- 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)
- Compound-command permission prompting makes multi-session orchestration unusable (700+ prompts on non-mutating chains)
- 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] Auto mode regression: unnecessary compound command permission prompts on Windows
- [BUG] Unacceptable File Access
- [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
- Bash/PowerShell tool fails instantly on Windows — exit code 1, zero stdout/stderr, every command
- [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
- [BUG] Windows/Git Bash: shell snapshot silently writes the raw Windows PATH when the PATH probe times out, so ls/grep/date are "command not found" for the whole session
- Windows/Git Bash: Bash tool command line truncated at ~8175 chars, and backslash runs halved by MSYS2 argv parsing
- grep -r and cp -r still bypass Read() deny rules on 2.1.259 (changelog fix does not reproduce; Windows/VS Code extension)
- [BUG] Shell snapshot silently truncated at ~7.2KB on Windows (Desktop) - every Bash call fails with unexpected EOF
- [Windows] Bash tool permanently wedged: hook env (CLAUDE_ENV_FILE) grows on every compact, torn export line fails every command with "line 182: e: command not found" (exit 127)
- 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)
- Windows: per-second statusLine bash spawns turn the MSYS add_item/errno 1 race into a permanent outage of every Bash call
- [BUG] Plugin `bin/` entries are added to PATH with no existence check — 74% of PATH becomes dead dirs, pushing the inlined shell snapshot past the Windows 8191-char limit
- Claude Code deleted ~600GB: unprompted `rm -rf` on a substitution that resolved to a drive root
- [BUG] «PowerShell tool в Code tab всегда возвращает Exit code 1 без вывода на любую команду (даже Write-Output test), при этом PowerShell в системе работает нормально
- Read() deny rule on a root file makes every `grep -r .` prompt under bypassPermissions (2.1.257 reader-command rule, untouched by the 2.1.260 revert)
- [BUG] Windows: all shell output capture fails on VMware App Volumes — `stat` by path and `fstat` by handle report different `dev` for every local path
- Background-task cleanup leaves orphaned find.exe processes on Windows (Git Bash/MSYS)
- [BUG] Hanging find.exe
- Bash tool leaks orphaned child processes on Windows timeout (runaway ind / scans accumulate for hours)
- Windows: PowerShell/Bash tool-call windows pop up and steal focus, especially during scheduled/background task execution
- [BUG] Bash tool broken on Windows: /usr/bin/bash: -c: line 26: unexpected EOF while looking for matching backtick
- [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] 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)
- Bash tool on Windows Git Bash cannot find common binaries (git, task, ls) after 2.1.x update
- [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