/plugin marketplace add: failed clone pollutes local cache and blocks retries
Summary
When /plugin marketplace add <owner>/<repo> fails during the initial clone (transient network error, DNS blip, interrupted download, partial tar extraction), Claude Code leaves a broken clone cached under ~/.claude/plugins/marketplaces/<owner>-<repo>/. Every subsequent /plugin marketplace add call short-circuits on the cache entry and fails with the same error, even after the upstream repo is fixed and pushed. The only recovery is a manual rm -rf of the cache directory — there is no user-visible indicator that the cache is the source of the failure.
Impact
Blocker-class UX issue for first-time plugin installers. Users who hit a flaky network on their very first /plugin marketplace add are stuck in a silent retry loop until they know to clear the cache manually.
Repro
- Start
/plugin marketplace add some-org/some-repoon a flaky connection (or pull the network cable mid-clone). - Observe the failure.
- Fix the network and retry
/plugin marketplace add some-org/some-repo. - Observe: the retry fails identically, even though the remote is now reachable.
- Run
rm -rf ~/.claude/plugins/marketplaces/some-org-some-repo/and retry. - Observe: the add now succeeds.
Requested behaviour
Either of the following would fix this:
- Re-fetch on failed parse — if the cached marketplace manifest fails to parse on a subsequent
addcall, invalidate the cache and re-clone from the remote. - Clean up cache on failure — if the initial clone / extraction fails, delete the partial cache entry before returning the error so the next retry starts from a clean slate.
Option (2) is simpler and matches the user's mental model ("I failed, so nothing got cached"). Option (1) is more forgiving for users whose first attempt partially succeeded.
Workaround
Document the manual recovery recipe in your README:
rm -rf ~/.claude/plugins/marketplaces/<org>-<repo>/
/plugin marketplace add <org>/<repo>
We have added this to both our public and enterprise marketplace READMEs and shipped an automated recovery helper script (plugin-cache-recovery.sh), but it would be better fixed upstream.
Environment
- Claude Code CLI 2.1.109
- macOS 15 / Linux (observed on both)
Reference
Originally surfaced in GAIA Framework story E28-S25.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗