EEXIST: file already exists, mkdir - startup hang when home directory has ReadOnly attribute on Windows
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
- On Windows, have a home directory with ReadOnly attribute:
````
attrib C:\Users\<username>
# Shows: R D A C:\Users\<username>
- Run
claudeorclaude auth loginfrom any terminal (PowerShell 5.1, PowerShell 7, Git Bash) - Interactive
claudehangs indefinitely with blank screen claude auth loginprints the OAuth URL then fails withEEXIST: file already exists, mkdir 'C:\Users\<username>'claude auth logoutalso fails withFailed to log out.
What Works
claude --versionworks (exits before hitting the mkdir path)- Downgrading to v2.1.68 resolves the issue completely
- Renaming
~/.claudedoes 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.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗