bash.exe.stackdump files left behind in working directories on Windows (Git Bash / MSYS2)
Description
Claude Code leaves bash.exe.stackdump files in the working directory after sessions. These files are MSYS2 crash dump artifacts generated when the bash process terminates abnormally. They accumulate across every directory where Claude Code has been active, cluttering repositories and requiring manual cleanup.
Reproduction
- Open Claude Code on Windows with Git Bash as the shell
- Work normally in any project directory (run commands, use the Bash tool, etc.)
- After the session (or even during), check the working directory
- A
bash.exe.stackdumpfile is present
This happens consistently across sessions and directories. No specific command or interaction triggers it — it appears to be caused by how Claude Code spawns and terminates bash subprocesses.
Evidence
On my machine, I found 6 stackdump files across different repositories, all with identical content and size (1196 bytes). They span multiple days, confirming this is a persistent recurring issue, not a one-off crash:
-rw-r--r-- 1196 Mar 23 14:43 project-A/bash.exe.stackdump
-rw-r--r-- 1196 Mar 23 14:01 project-B/bash.exe.stackdump
-rw-r--r-- 1196 Mar 23 12:23 project-C/bash.exe.stackdump
-rw-r--r-- 1196 Mar 23 11:13 project-D/bash.exe.stackdump
-rw-r--r-- 1196 Mar 23 10:59 project-E/bash.exe.stackdump
-rw-r--r-- 1196 Mar 20 17:16 project-F/bash.exe.stackdump
Stack trace content
Every file has the same crash signature — a fault inside msys-2.0.dll:
Stack trace:
Frame Function Args
0007FFFFB740 00021005FE8E (000210285F68, 00021026AB6E, 0007FFFFB740, 0007FFFFA640) msys-2.0.dll+0x1FE8E
0007FFFFB740 0002100467F9 (000000000000, 000000000000, 000000000000, 0007FFFFBA18) msys-2.0.dll+0x67F9
0007FFFFB740 000210046832 (000210286019, 0007FFFFB5F8, 0007FFFFB740, 000000000000) msys-2.0.dll+0x6832
0007FFFFB740 000210068CF6 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x28CF6
0007FFFFB740 000210068E24 (0007FFFFB750, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x28E24
0007FFFFBA20 00021006A225 (0007FFFFB750, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x2A225
End of stack trace
Expected behavior
Claude Code should either:
- Clean up
bash.exe.stackdumpfiles after they are generated, or - Prevent the crash that generates them (e.g., graceful subprocess termination), or
- Configure the MSYS2 environment to suppress stackdump generation (via
set MSYS=error_startorexport CYGWIN=nodumps)
Environment
- OS: Windows 11 Pro (10.0.26200)
- Shell: Git Bash (MINGW64)
- Bash version: GNU bash 5.2.26(1)-release (x86_64-pc-msys)
- MSYS2 runtime: msys-2.0.dll (3.4.10-87d57229, 2024-02-14)
- Claude Code version: 2.1.81
Additional context
- The crash occurs inside
msys-2.0.dll, not in bash itself, suggesting the MSYS2 runtime is receiving an unexpected signal during subprocess teardown. - All stackdump files are identical (same size, same trace), pointing to a single reproducible crash path rather than random failures.
- The files are not
.gitignored by default, so they can accidentally be committed if users aren't careful. - Setting
MSYS=error_start:(empty value) as an environment variable before launching bash suppresses stackdump file creation entirely. This could be a quick fix on Claude Code's side when spawning bash processes on Windows.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗