Plugin marketplace: /plugin & /reload-plugins wipe marketplace dir and fail to re-clone (owner-prefixed path mismatch with CLI) → all plugins + MCP servers fail to load

Status Closed — not planned
Reported on v2.1.195
Maintainer reply ✓ Yes — bcherny
Activity 6 comments · opened Jun 28, 2026 · closed Aug 24, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Summary

The in-app plugin loader (/plugin, /reload-plugins, and startup) and the CLI (claude plugin marketplace …) disagree on the marketplace install path. The in-app loader empties the marketplace directory and then fails to re-clone, leaving 0 plugins · 21 errors and taking down every plugin — including plugin-provided MCP servers (e.g. sentry, supabase, posthog). The CLI can repopulate it, but the very next /plugin or /reload-plugins wipes it again, so there is no way to recover from the UI.

Environment

  • Claude Code 2.1.195
  • macOS (darwin 25.5.0)
  • Marketplace: claude-plugins-official (anthropics/claude-plugins-official), 21 plugins installed

What happens

known_marketplaces.json records:

"installLocation": "/Users/<me>/.claude/plugins/marketplaces/claude-plugins-official"

i.e. the CLI installs to marketplaces/<repo> = claude-plugins-official.

But the in-app loader tries to clone to the owner-prefixed path marketplaces/anthropics-claude-plugins-official, and fails:

Failed to load all marketplaces. Errors: claude-plugins-official: Failed to load marketplace
"claude-plugins-official" from source (github): Failed to clone marketplace repository:
Cloning into '/Users/<me>/.claude/plugins/marketplaces/anthropics-claude-plugins-official'...
fatal: Invalid path '/Users/<me>/.claude/plugins/marketplaces/anthropics-claude-plugins-official': No such file or directory

/reload-plugins then reports:

Reloaded: 0 plugins · 0 skills · 25 agents · 0 hooks · 0 plugin MCP servers · 0 plugin LSP servers
21 errors during load. Run /doctor for details.

and /doctor lists all 21 plugins as Marketplace claude-plugins-official failed to load: cache-miss.

Most importantly: after each /plugin or /reload-plugins, ~/.claude/plugins/marketplaces/claude-plugins-official/ is left empty (the loader appears to clear the directory before the clone, and the clone fails, so nothing is restored).

Workaround (partial)

From a shell:

claude plugin marketplace update claude-plugins-official

re-clones successfully into marketplaces/claude-plugins-official and claude plugin list shows all plugins enabled. But the next time /plugin or /reload-plugins runs (including, presumably, at the next session start), the in-app loader empties the dir again and the plugins/MCP servers disappear. Adding a symlink anthropics-claude-plugins-official -> claude-plugins-official did not help — the loader still wiped the real dir.

The plugin caches under ~/.claude/plugins/cache/claude-plugins-official/<plugin>/<version>/ remain intact throughout; only the marketplaces/ checkout is destroyed.

Steps to reproduce

  1. Have claude-plugins-official installed via CLI (populates marketplaces/claude-plugins-official).
  2. Run /reload-plugins (or open /plugin).
  3. Observe 0 plugins · 21 errors, and that marketplaces/claude-plugins-official/ is now empty.
  4. Run claude plugin marketplace update claude-plugins-official — repopulates, CLI sees plugins again.
  5. Run /reload-plugins again — wiped again. Loop.

Suggested fixes

  1. Reconcile the two path conventions. The in-app loader should read installLocation from known_marketplaces.json rather than deriving an <owner>-<repo> path that the CLI never writes.
  2. Never destroy the existing checkout before a successful clone/pull. Clone to a temp dir and swap on success, so a failed clone can't leave the marketplace empty and brick every plugin.
  3. Investigate the fatal: Invalid path … No such file or directory clone failure (looks like the parent path/target isn't created before git clone).

View original on GitHub ↗

5 Comments

github-actions[bot] · 2 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/40153
  2. https://github.com/anthropics/claude-code/issues/35924

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

yurukusa · 2 months ago

Your root-cause is the useful part: the in-app loader looks for the owner-prefixed path (marketplaces/anthropics-claude-plugins-official) while the CLI populates the repo-only path (marketplaces/claude-plugins-official). That mismatch is what makes the loader empty-then-fail. Two things that help until it's patched:
Break the wipe loop — give the loader its own populated directory at the path it expects, so it stops re-cloning into a missing path:

git clone https://github.com/anthropics/claude-plugins-official \
  ~/.claude/plugins/marketplaces/anthropics-claude-plugins-official

I'd clone a separate copy rather than symlink anthropics-…claude-plugins-official: if the loader does rm -rf <expected>/* before cloning (which your "left empty" symptom suggests), a symlink would let it wipe the CLI's copy through the link. A real second directory contains the damage to the path the loader owns.
**On the "Invalid path … No such file or directory" while cloning into that path: git normally creates the target dir itself, so that error usually means the parent (~/.claude/plugins/marketplaces/) doesn't exist at clone time, or the path is being constructed with a stray component. Worth confirming the parent exists and is writable before/after a /reload-plugins.
Data-loss scope (the part that actually bites):** the marketplace dir is a plain git clone, so the wipe itself is recoverable by re-cloning — unless you hand-edited anything under it, in which case recover those before re-cloning (git -C <dir> stash list / git -C <dir> reflog, or pull from your fork). The lasting damage is runtime: every plugin-provided MCP server (sentry, supabase, posthog, …) drops mid-session.
Avoid re-triggering: until the path logic is fixed, repopulate via the claude plugin marketplace … CLI and steer clear of /plugin / /reload-plugins in the UI — those are the entry points that empty the dir.

TyShaneONeill · 2 months ago

This is the same underlying defect as #40153 and #35924 — both closed NOT_PLANNED, neither fixed. Confirming it still reproduces on v2.1.195 (macOS), so flagging that the non-atomic marketplace update is still live on current builds.

Two specifics that may help pin it down:

  • The wipe is triggered not just by auto-update/restart but directly by the in-app /plugin panel and /reload-plugins. The CLI claude plugin marketplace update <name> repopulates marketplaces/claude-plugins-official/, but the next in-app load empties it again — so the two fight each other and the UI can't self-recover.
  • The in-app loader targets an owner-prefixed path (marketplaces/anthropics-claude-plugins-official) and fails with fatal: Invalid path … No such file or directory, while the CLI + known_marketplaces.json installLocation use the un-prefixed marketplaces/claude-plugins-official. The path-convention mismatch looks like the trigger for the failed clone that then leaves the dir wiped.

Net impact: every plugin-provided MCP server (sentry, supabase, posthog, …) silently fails to load, with no UI-only recovery path.

bcherny collaborator · 14 days ago

Thanks for the detailed report — I tried to reproduce this on the current release, 2.1.233 (Linux), following your steps exactly: added anthropics/claude-plugins-official, installed a plugin, then ran /reload-plugins (twice) and /plugin in an interactive session. The marketplace directory was never wiped and plugins kept loading. I also forced the in-app loader to re-fetch from scratch (by removing the cached catalog): it cloned into marketplaces/anthropics-claude-plugins-official and then moved the result onto marketplaces/claude-plugins-official — recovering cleanly.

One clarification on the path question: the anthropics-claude-plugins-official directory isn't a conflicting install location — it's a temporary workspace used while fetching. After a successful fetch, its contents are placed at the installLocation recorded in known_marketplaces.json. The CLI and the in-app loader share this logic.

What actually failed on your machine is git itself: fatal: Invalid path …: No such file or directory during the clone, which usually points at something environmental (e.g. a git config such as init.templateDir referencing a missing path, an unusual git build on PATH, or ~/.claude on a symlinked/network volume). Also, 2.1.232 fixed a race that could silently break marketplace registration, which may explain part of what you saw on 2.1.195.

Could you retry on the latest version and, if it still fails, share: git --version and which git, the output of git config --get init.templateDir, and the relevant lines from a claude --debug session around /reload-plugins? Happy to dig back in with that.

🤖 Generated with Claude Code

github-actions[bot] · 14 days ago

We weren't able to reproduce this. Could you provide steps to trigger the issue — what you ran, what happened, and what you expected? This issue will be closed automatically if there's no activity within 7 days.

Showing cached comments. Read the full discussion on GitHub ↗