Bash tool fails with EEXIST when session-env path resolves through a reparse point (OneDrive Files-On-Demand)

Resolved 💬 2 comments Opened Apr 21, 2026 by charliewhitfield Closed Apr 21, 2026

Summary

On Windows, every Bash tool invocation fails with EEXIST: file already exists, mkdir ... when the per-session directory at ~/.claude/session-env/<session-id> resolves through a reparse point — specifically a OneDrive Files-On-Demand cloud placeholder inside a OneDrive-synced .claude folder. PowerShell is unaffected, so the session keeps working but every command hits a permission prompt.

Environment

  • OS: Windows 11 Home (10.0.26200)
  • Claude Code: running in CLI; .claude folder is symlinked into OneDrive via a junction
  • OneDrive Files-On-Demand is enabled
  • Inside the OneDrive-synced .claude, the session-env subfolder and per-session UUID subfolders exist as OneDrive cloud placeholders

Error

EEXIST: file already exists, mkdir 'C:\Users\<user>\.claude\session-env\<session-uuid>'

Suggested fix

Treat the per-session mkdir as idempotent, e.g. fs.mkdirSync(path, { recursive: true }), so an existing directory (symlink or cloud placeholder) doesn't abort setup.

Workaround

Rewire session-env out of OneDrive:

rd /s /q "C:\Users\<user>\OneDrive\Documents\_symbolic_links\.claude\session-env"
mkdir "C:\Users\<user>\AppData\Local\Claude\session-env"
mklink /D "C:\Users\<user>\OneDrive\Documents\_symbolic_links\.claude\session-env" "C:\Users\<user>\AppData\Local\Claude\session-env"

View original on GitHub ↗

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