Preflight Checklist
What's Wrong?
Title: [Windows] Plugin marketplace install fails with EPERM on rename — path resolution collapses username + .claude into single token
Labels: bug, windows, plugin-marketplace
Environment
| Field |
Value |
| Claude Code version |
v2.1.117 → reproduced on v2.1.118 |
| OS |
Windows 11, Build 26200 |
| Install method |
native installer |
Description
On Windows, when a username contains no dots, Claude Code incorrectly resolves the config path by collapsing C:\Users\username and \.claude into C:\Users\username.claude\ — treating .claude as a suffix to the username rather than a subdirectory.
This manifests as an EPERM: operation not permitted, rename error when the marketplace installer attempts to atomically rename a temp directory to the final destination, because the resolved path is invalid/unexpected.
This happens even when CLAUDE_CONFIG_DIR is set to the right folder C:\Users\username.claude AND a symlink from C:\Users\username.claude -> C:\Users\username.claude exists.
Similar issue reported in #45432 but that is related to the username having accented characters.
Steps to Reproduce
- Fresh Windows install of Claude Code (native, non-WSL)
- Run
/plugin marketplace add https://github.com/affaan-m/everything-claude-code
- Observe failure
Error Output
Error: Failed to finalize marketplace cache. Please manually delete the directory at
C:\Users\username.claude\plugins\marketplaces\everything-claude-code if it exists and try again.
Technical details: EPERM: operation not permitted, rename
'C:\Users\username.claude\plugins\marketplaces\temp_1776882015473' ->
'C:\Users\username.claude\plugins\marketplaces\everything-claude-code'
Root Cause Analysis
Two distinct bugs appear to be present:
Bug 1 — Path resolution: ~\.claude is being resolved by stripping the separator, producing username.claude as a directory name rather than username\.claude as a subdirectory. The splash screen displays ~\.claude correctly, but the runtime path is wrong.
Bug 2 — Atomic rename: fs.rename() on Windows fails with EPERM when the destination directory already exists (from a prior failed attempt). Unlike POSIX, Windows does not support atomic directory rename-over-existing. The installer has no fallback for this case.
Attempted Workarounds — All Unsuccessful
| Workaround |
Result |
Set CLAUDE_CONFIG_DIR=C:\Users\username\.claude (User env var) |
Fixes config dir but plugins path resolved independently — no effect on marketplace |
NTFS junction: username.claude → username\.claude |
Junction already existed; EPERM on rename still occurs |
Manual deletion of temp_* and everything-claude-code dirs before retry |
Temp dir recreated on next attempt, rename fails again |
Manual git clone into target path |
Workaround only — does not fix the underlying issue |
Expected Behavior
~\.claude resolves to C:\Users\username\.claude (subdirectory)
- Marketplace installer handles pre-existing destination directory gracefully (delete-then-rename or copy-then-delete fallback)
CLAUDE_CONFIG_DIR controls all path resolution including plugins, not just config
Additional Notes
The EPERM on rename is a known Windows limitation with Node.js fs.rename() across certain directory states. The fix is either fs.rm() on the destination before rename, or using a copy+delete strategy instead of atomic rename on Windows.
What Should Happen?
Expected Behavior
~\.claude resolves to C:\Users\username\.claude (subdirectory)
- Marketplace installer handles pre-existing destination directory gracefully (delete-then-rename or copy-then-delete fallback)
CLAUDE_CONFIG_DIR controls all path resolution including plugins, not just config
Error Messages/Logs
### Error Output
Error: Failed to finalize marketplace cache. Please manually delete the directory at
C:\Users\username.claude\plugins\marketplaces\everything-claude-code if it exists and try again.
Technical details: EPERM: operation not permitted, rename
'C:\Users\username.claude\plugins\marketplaces\temp_1776882015473' ->
'C:\Users\username.claude\plugins\marketplaces\everything-claude-code'
Steps to Reproduce
Steps to Reproduce
- Fresh Windows install of Claude Code (native, non-WSL)
- Run
/plugin marketplace add https://github.com/affaan-m/everything-claude-code
- Observe failure
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.118
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
No response
Preflight Checklist
What's Wrong?
Title:
[Windows] Plugin marketplace install fails with EPERM on rename — path resolution collapses username + .claude into single tokenLabels:
bug,windows,plugin-marketplaceEnvironment
11, Build26200native installerDescription
On Windows, when a username contains no dots, Claude Code incorrectly resolves the config path by collapsing
C:\Users\usernameand\.claudeintoC:\Users\username.claude\— treating.claudeas a suffix to the username rather than a subdirectory.This manifests as an
EPERM: operation not permitted, renameerror when the marketplace installer attempts to atomically rename a temp directory to the final destination, because the resolved path is invalid/unexpected.This happens even when CLAUDE_CONFIG_DIR is set to the right folder C:\Users\username.claude AND a symlink from C:\Users\username.claude -> C:\Users\username.claude exists.
Similar issue reported in #45432 but that is related to the username having accented characters.
Steps to Reproduce
/plugin marketplace add https://github.com/affaan-m/everything-claude-codeError Output
Root Cause Analysis
Two distinct bugs appear to be present:
Bug 1 — Path resolution:
~\.claudeis being resolved by stripping the separator, producingusername.claudeas a directory name rather thanusername\.claudeas a subdirectory. The splash screen displays~\.claudecorrectly, but the runtime path is wrong.Bug 2 — Atomic rename:
fs.rename()on Windows fails withEPERMwhen the destination directory already exists (from a prior failed attempt). Unlike POSIX, Windows does not support atomic directory rename-over-existing. The installer has no fallback for this case.Attempted Workarounds — All Unsuccessful
CLAUDE_CONFIG_DIR=C:\Users\username\.claude(User env var)username.claude→username\.claudetemp_*andeverything-claude-codedirs before retrygit cloneinto target pathExpected Behavior
~\.clauderesolves toC:\Users\username\.claude(subdirectory)CLAUDE_CONFIG_DIRcontrols all path resolution including plugins, not just configAdditional Notes
The
EPERMon rename is a known Windows limitation with Node.jsfs.rename()across certain directory states. The fix is eitherfs.rm()on the destination before rename, or using a copy+delete strategy instead of atomic rename on Windows.What Should Happen?
Expected Behavior
~\.clauderesolves toC:\Users\username\.claude(subdirectory)CLAUDE_CONFIG_DIRcontrols all path resolution including plugins, not just configError Messages/Logs
Steps to Reproduce
Steps to Reproduce
/plugin marketplace add https://github.com/affaan-m/everything-claude-codeClaude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.118
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
No response