[BUG] Claude Code hangs on startup when Windows username contains spaces (EEXIST error)
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?
Claude Code fails to start on Windows when the username contains spaces.
The startup process hangs indefinitely showing only a black screen,
with no error message visible to the user.
The debug log reveals the root cause:
EEXIST: file already exists, mkdir 'C:\Users\Mauro Catellani'
The path is being truncated at the space — Claude Code attempts to
create directory 'C:\Users\Mauro' which already exists as part of a longer path.
What Should Happen?
Claude Code should start normally and display the interactive CLI interface,
regardless of whether the Windows username contains spaces.
Error Messages/Logs
EEXIST: file already exists, mkdir 'C:\Users\Mauro Catellani'
at mkdirSync (node:fs)
at ...
Steps to Reproduce
- Have a Windows user account with a space in the username (e.g. "John Doe")
- Install Claude Code: npm install -g @anthropic-ai/claude-code
- Run "claude" from cmd or PowerShell
- Observe: process hangs indefinitely, black screen, no CLI appears
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.3 (approximately — stopped working after automatic update)
Claude Code Version
2.1.70 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Workaround that restores functionality:
- Create C:\ClaudeHome (path without spaces)
- Copy .claude folder from original home to C:\ClaudeHome
- Create wrapper script C:\ClaudeHome\claude.bat:
@echo off
set HOME=C:\ClaudeHome
set USERPROFILE=C:\ClaudeHome
"C:\Users\John Doe\AppData\Roaming\npm\claude.cmd" %*
- Add C:\ClaudeHome to system PATH
Debug log location: %USERPROFILE%\.claude\debug\
Windows version: 10.0.26200.7922
Node.js version: 24.14.0
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗