[BUG] Claude Code hangs on startup when Windows username contains spaces (EEXIST error)

Resolved 💬 5 comments Opened Mar 6, 2026 by mcat1965 Closed Apr 3, 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?

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

  1. Have a Windows user account with a space in the username (e.g. "John Doe")
  2. Install Claude Code: npm install -g @anthropic-ai/claude-code
  3. Run "claude" from cmd or PowerShell
  4. 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:

  1. Create C:\ClaudeHome (path without spaces)
  2. Copy .claude folder from original home to C:\ClaudeHome
  3. 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" %*

  1. Add C:\ClaudeHome to system PATH

Debug log location: %USERPROFILE%\.claude\debug\
Windows version: 10.0.26200.7922
Node.js version: 24.14.0

View original on GitHub ↗

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