EEXIST: file already exists, mkdir - startup hang when home directory has ReadOnly attribute on Windows

Resolved 💬 7 comments Opened Mar 5, 2026 by orlinkata Closed Mar 5, 2026

Bug Description

Claude Code v2.1.69 fails to start (hangs indefinitely) and claude auth login fails with:

Login failed: EEXIST: file already exists, mkdir 'C:\Users\<username>'

The root cause is that the user's home directory has the ReadOnly attribute set (common in corporate/enterprise Windows environments managed by Group Policy). Claude Code's mkdir with recursive: true throws EEXIST instead of succeeding when the target directory already exists but has the ReadOnly flag.

This is a regression — v2.1.68 works correctly on the same system.

Steps to Reproduce

  1. On Windows, have a home directory with ReadOnly attribute:

``
attrib C:\Users\<username>
# Shows: R D A C:\Users\<username>
``

  1. Run claude or claude auth login from any terminal (PowerShell 5.1, PowerShell 7, Git Bash)
  2. Interactive claude hangs indefinitely with blank screen
  3. claude auth login prints the OAuth URL then fails with EEXIST: file already exists, mkdir 'C:\Users\<username>'
  4. claude auth logout also fails with Failed to log out.

What Works

  • claude --version works (exits before hitting the mkdir path)
  • Downgrading to v2.1.68 resolves the issue completely
  • Renaming ~/.claude does not help — the error is on the home directory itself, not .claude
  • Clearing ~/.claude/debug/ does not help

Environment

  • OS: Windows 11
  • Claude Code version: 2.1.69 (broken), 2.1.68 (works)
  • Install method: native (claude.exe)
  • Shell: Tested in Git Bash (MINGW64), PowerShell 5.1, and PowerShell 7
  • Home directory attributes: ReadOnly, Directory, Archive (set by corporate Group Policy)

Expected Behavior

mkdir with recursive: true should handle existing directories with the ReadOnly attribute gracefully, the same as it handles normal existing directories. This worked in v2.1.68.

Workaround

Downgrade to v2.1.68:

npm install -g @anthropic-ai/claude-code@2.1.68

Removing the ReadOnly attribute (attrib -R) from the home directory would also fix it, but is not acceptable in managed corporate environments where this attribute is set by Group Policy.

View original on GitHub ↗

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