[BUG] Bash tool fails with EEXIST on every call (Windows 11) — session-env mkdir regression

Resolved 💬 3 comments Opened Apr 17, 2026 by saskatoonsquatch Closed Apr 21, 2026

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?

Every Bash tool call fails immediately with EEXIST: file already exists, mkdir 'C:\Users\jason\.claude\session-env\{session-uuid}'. The ! prefix (terminal
shortcut for Bash) produces the same error. The error persists for the lifetime of the session. Starting a fresh session reproduces the bug with a new
UUID. Complete loss of Bash tool functionality for the entire session duration.

What Should Happen?

Bash tool calls should execute normally. The mkdir of the session-env directory should either succeed when the directory doesn't exist, or be idempotent
when it already exists (as fs.mkdirSync with { recursive: true } would be). The session-env directory is created at session start; subsequent Bash calls
should not attempt to re-create it non-idempotently.

Error Messages/Logs

EEXIST: file already exists, mkdir 'C:\Users\jason\.claude\session-env\0cd9e1a6-fe1e-4875-9d2e-d47cd9987115'

Steps to Reproduce

  1. Start a new Claude Code session on Windows 11.
  2. Attempt any Bash tool call (e.g., echo "test" or any Agent/Task tool use that requires Bash).
  3. Observe the EEXIST error. The command does not execute.

The error persists for the lifetime of the session. Starting a fresh session reproduces with a new UUID. The error also fires when using the ! prefix in
the prompt. Updating from v2.1.111 to v2.1.112 did not fix it.

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown exactly — worked prior to v2.1.111 (April 16, 2026)

Claude Code Version

2.1.112

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Related existing issues (similar EEXIST patterns in different code paths): #27791, #31460, #37306.

Root cause appears to be fs.mkdirSync called without { recursive: true } on a directory that already exists. The session-env directory is created at
session startup; every subsequent Bash call attempts to recreate it, throwing EEXIST.

Workarounds attempted: none successful. Restarting session doesn't help (new UUID, same bug). Using ! prefix doesn't help (same code path). v2.1.111 →
v2.1.112 update didn't address it.

Impact: complete loss of Bash tool functionality for session duration. All agents using Bash-dependent tooling (Python execution, testing scripts,
deployment) affected simultaneously.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗