[BUG] CLI Fails with ENOENT Error on Windows Due to Invalid Path
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?
Version: 2.0.14
What Should Happen?
The claude command-line tool is failing on Windows with an ENOENT: no such file or directory error. The tool was functioning correctly until yesterday, but it suddenly started throwing this error today without any noticeable changes to my system configuration or the tool's installation.
The error log shows that the application is attempting to create a directory at the path C:\Users\qlsjt\:USERPROFILE\.config\claude\debug. It appears that the :USERPROFILE token is not being expanded into the correct user home directory path. Instead, it is being treated as a literal string, which results in an invalid directory path on Windows and causes the mkdir operation to fail.
The expected behavior is for the tool to correctly resolve the home directory path and successfully create the required .config/claude/debug directory.
Error Messages/Logs
C:\Users\qlsjt>claude
node:fs:1363
const result = binding.mkdir(
^
Error: ENOENT: no such file or directory, mkdir 'C:\Users\qlsjt\:USERPROFILE\.config\claude\debug'
at Module.mkdirSync (node:fs:1363:26)
at Object.mkdirSync (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:9:1190)
at o (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:11:62)
at SA (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3417:13895)
at WqQ (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3431:1115)
at file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3440:15148
at Q (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)
at rz8 (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3576:1366)
at BC8 (file:///C:/Users/qlsjt/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3616:2709) {
errno: -4058,
code: 'ENOENT',
syscall: 'mkdir',
path: 'C:\\Users\\qlsjt\\:USERPROFILE\\.config\\claude\\debug'
}
Node.js v22.20.0
Steps to Reproduce
- On a Windows operating system, open a command prompt or terminal.
- Run the claude command.
- The command fails and outputs the ENOENT error shown below.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.14
Claude Code Version
2.0.14
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗