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
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
- Have
claude-plugins-officialinstalled via CLI (populatesmarketplaces/claude-plugins-official). - Run
/reload-plugins(or open/plugin). - Observe
0 plugins · 21 errors, and thatmarketplaces/claude-plugins-official/is now empty. - Run
claude plugin marketplace update claude-plugins-official— repopulates, CLI sees plugins again. - Run
/reload-pluginsagain — wiped again. Loop.
Suggested fixes
- Reconcile the two path conventions. The in-app loader should read
installLocationfromknown_marketplaces.jsonrather than deriving an<owner>-<repo>path that the CLI never writes. - 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.
- Investigate the
fatal: Invalid path … No such file or directoryclone failure (looks like the parent path/target isn't created beforegit clone).
Showing cached comments. Read the full discussion on GitHub ↗
5 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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:
I'd clone a separate copy rather than symlink
anthropics-…→claude-plugins-official: if the loader doesrm -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-pluginsin the UI — those are the entry points that empty the dir.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:
/pluginpanel and/reload-plugins. The CLIclaude plugin marketplace update <name>repopulatesmarketplaces/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.marketplaces/anthropics-claude-plugins-official) and fails withfatal: Invalid path … No such file or directory, while the CLI +known_marketplaces.jsoninstallLocationuse the un-prefixedmarketplaces/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.
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/pluginin 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 intomarketplaces/anthropics-claude-plugins-officialand then moved the result ontomarketplaces/claude-plugins-official— recovering cleanly.One clarification on the path question: the
anthropics-claude-plugins-officialdirectory isn't a conflicting install location — it's a temporary workspace used while fetching. After a successful fetch, its contents are placed at theinstallLocationrecorded inknown_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 directoryduring the clone, which usually points at something environmental (e.g. a git config such asinit.templateDirreferencing a missing path, an unusual git build on PATH, or~/.claudeon 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 --versionandwhich git, the output ofgit config --get init.templateDir, and the relevant lines from aclaude --debugsession around/reload-plugins? Happy to dig back in with that.🤖 Generated with Claude Code
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.