[BUG] update fails with EEXIST on directories from the existing install (native Windows)
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?
Title: claude update fails with EEXIST on directories from the existing install (native Windows)
Version: 2.1.118 → attempting update to 2.1.218
Platform: Windows 10 (native install, not npm)
Description:
claude update fails immediately with EEXIST: file already exists on mkdir calls targeting directories that are expected to already exist from the current install — e.g. .local/share/claude/versions, which holds the currently-installed binary (versions/2.1.118). The updater appears to attempt to create these directories unconditionally rather than checking whether they already exist, so the failure recurs on every retry.
Steps observed:
Ran claude update on an existing native install — failed with EEXIST on .cache/claude/staging.
Removed the (empty) staging directory, retried — failed with EEXIST on .local/state/claude/locks.
Removed the (empty) locks directory, retried — failed with EEXIST on .local/share/claude/versions, which contains the real installed binary and can't be safely deleted.
Update remains blocked; the underlying binary/install is otherwise fully functional.
Additional context: The install's home directory happened to be a OneDrive-synced path at install time ($HOME resolved differently between Git Bash and native Windows processes). Unlinking OneDrive entirely and retrying produced the identical error on the identical path, ruling out OneDrive sync/file-locking as the cause — this looks like a genuine defect in the updater's directory-creation logic rather than an environment-specific issue.
What Should Happen?
Claude should update successfully.
Error Messages/Logs
Error output:
Error: Failed to install native update
Error: EEXIST: file already exists, mkdir '<path>\.local\share\claude\versions'
Steps to Reproduce
Asked Claude to update itself (autoUpdates are turned off)
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.118 (cannot upgrade to 2.1.218 - latest)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_