claude-code - 💡(How to fix) Fix Windows: Marketplace update permanently wedged by stale .bak directory (EPERM rename loop) [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46830Fetched 2026-04-12 13:31:57
View on GitHub
Comments
3
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3cross-referenced ×1

Error Message

  • Error: EPERM: operation not permitted, rename '...claude-plugins-official.bak' -> '...claude-plugins-official'

Root Cause

The marketplace update algorithm does a rename dance:

  1. Fetch fresh content to <name>.staging/
  2. Move current <name>/<name>.bak/
  3. Move <name>.staging/<name>/

If any step fails, rollback tries: rename <name>.bak/<name>/

On Windows, fs.rename() returns EPERM when the destination directory already exists (unlike POSIX). Once a .bak/ directory is left behind from a failed attempt, every future update fails because:

  • Step 2 can't rename live → .bak (destination exists)
  • Rollback can't rename .bak → live (live still exists since step 2 failed)
  • .staging/ gets re-fetched every session but never promoted
RAW_BUFFERClick to expand / collapse

Environment

  • Windows 10, Claude Code 2.1.101 (native), Git Bash shell

Problem

On Windows, claude plugin marketplace update gets permanently stuck after a single failed update. Every subsequent update attempt (including automatic startup syncs) fails silently, leaving all installed plugins in "failed to load" state.

Root cause

The marketplace update algorithm does a rename dance:

  1. Fetch fresh content to <name>.staging/
  2. Move current <name>/<name>.bak/
  3. Move <name>.staging/<name>/

If any step fails, rollback tries: rename <name>.bak/<name>/

On Windows, fs.rename() returns EPERM when the destination directory already exists (unlike POSIX). Once a .bak/ directory is left behind from a failed attempt, every future update fails because:

  • Step 2 can't rename live → .bak (destination exists)
  • Rollback can't rename .bak → live (live still exists since step 2 failed)
  • .staging/ gets re-fetched every session but never promoted

Symptoms

  • /doctor reports all installed plugins as "not found in marketplace"
  • claude plugin list shows all plugins as "✘ failed to load"
  • Error: EPERM: operation not permitted, rename '...claude-plugins-official.bak' -> '...claude-plugins-official'

Fix applied manually

Deleted stale .bak/ directory, then claude plugin marketplace update succeeded immediately (log even said "Found stale directory, cleaning up and re-cloning").

Suggested fix

Before the rename dance, delete any pre-existing .bak/ directory (or use a unique temp name). The .bak/ is just a rollback buffer — stale ones from prior runs have no value and should be cleaned up.

extent analysis

TL;DR

Delete any pre-existing .bak/ directory before attempting a claude plugin marketplace update to prevent the update from getting stuck due to a failed rename operation.

Guidance

  • Check for and delete any existing .bak/ directories in the plugin directory before running claude plugin marketplace update.
  • Verify that the .bak/ directory is not being used by any other process or thread to avoid potential file system conflicts.
  • Consider implementing a unique temporary directory name for the rollback buffer to prevent naming conflicts.
  • After deleting the .bak/ directory, re-run claude plugin marketplace update to test if the issue is resolved.

Example

No code snippet is provided as the issue does not require a code change, but rather a manual cleanup or a modification to the existing update algorithm to handle the .bak/ directory.

Notes

This solution assumes that the .bak/ directory is not being used for any other purpose and can be safely deleted. If the directory is being used, an alternative solution will be needed.

Recommendation

Apply workaround: delete any pre-existing .bak/ directory before running claude plugin marketplace update, as this is a simple and effective solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Windows: Marketplace update permanently wedged by stale .bak directory (EPERM rename loop) [3 comments, 2 participants]