Windows: Bash tool fails repeatedly with EEXIST on session-env mkdir after first use
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Version: Claude Code 2.1.114 (native Windows install)
OS: Windows 11 Pro build 23H2.22631
On Windows, the Bash tool starts failing partway through a session with:
EEXIST: file already exists, mkdir 'C:\Users\<user>\.claude\session-env\<uuid>'
Once it starts, every subsequent Bash invocation in the session returns the same error.
Other tools (Read, Edit, Write, Grep, Glob) continue to work normally.
Workarounds that only clear it temporarily:
- Manually deleting the session-env/<uuid> directory — fails again within minutes
- Starting a new Claude Code session — fails again within minutes
- Restarting VS Code — same
It looks like the bash session-env setup is using a non-idempotent mkdir that throws
instead of no-op'ing when the directory already exists. The UUID in the path appears
stable per session, so after the first bash call the directory exists and every
subsequent call collides with it.
What Should Happen?
Bash tool should reuse the existing session-env directory, or use a recursive/idempotent
mkdir that silently succeeds when the directory already exists. The error should not
occur repeatedly within a stable session.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code on Windows 11 (standalone CLI, installed via install.ps1 to %USERPROFILE%\.local\bin\claude.exe)
- Start a normal coding session — use Bash tool a few times (git, ls, curl, etc.)
- After some minutes of use, Bash invocations start returning:
EEXIST: file already exists, mkdir 'C:\Users\<user>\.claude\session-env\<uuid>'
- Every subsequent Bash call in the same session fails with the same error.
- Deleting the offending directory or starting a new session resolves it briefly,
but the error recurs.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.114
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
- Install method: PowerShell installer (irm https://claude.ai/install.ps1 | iex)
- Binary: C:\Users\<user>\.local\bin\claude.exe (245 MB, native Windows build)
- Tried
claude update— reports "up to date" at 2.1.114. - Error is reproducible across multiple fresh sessions, not tied to a specific repository.
- Bug persists whether launched from PowerShell or from VS Code's Claude Code extension.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗