claude-code - ✅(Solved) Fix /plugin marketplace add: failed clone pollutes local cache and blocks retries [1 pull requests, 1 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#48736Fetched 2026-04-16 06:52:24
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1cross-referenced ×1referenced ×1

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.

Error Message

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. 2. 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.

Root Cause

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.

Fix Action

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.

PR fix notes

PR #24: E28-S25: link upstream cache-pollution issue and add ATDD harness

Description (problem / solution / changelog)

E28-S25

Acceptance criteria

  • AC1: recovery rm -rf command documented in gaia-public and gaia-enterprise README install sections
  • AC2: upstream bug report filed to Anthropic (anthropics/claude-code#48736)
  • AC3: upstream issue URL captured in story Dev Notes and both READMEs
  • AC4: optional smoke-test covered by existing plugins/gaia/scripts/plugin-cache-recovery.sh (ATDD test skiped with justification)

Changes

  • README.md — extend existing Recovery from a polluted marketplace cache section with upstream issue link (anthropics/claude-code#48736) and pointer to helper script.
  • tests/atdd/e28-s25-cache-pollution.bats — new bats ATDD harness. Three active tests (AC1/AC2/AC3) all passing against grep; AC4 marked skip with justification.

Out-of-band

The gaia-enterprise README recovery section ships in a separate PR on gaiastudio-ai/gaia-enterprise (same branch name). Its URL will be appended to the story Completion Notes once merged.

Story file

docs/implementation-artifacts/E28-S25-plugin-marketplace-cache-pollution-recovery.md

Changed files

  • README.md (modified, +2/-0)
  • tests/atdd/e28-s25-cache-pollution.bats (added, +48/-0)

Code Example

rm -rf ~/.claude/plugins/marketplaces/<org>-<repo>/
/plugin marketplace add <org>/<repo>
RAW_BUFFERClick to expand / collapse

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

  1. Start /plugin marketplace add some-org/some-repo on a flaky connection (or pull the network cable mid-clone).
  2. Observe the failure.
  3. Fix the network and retry /plugin marketplace add some-org/some-repo.
  4. Observe: the retry fails identically, even though the remote is now reachable.
  5. Run rm -rf ~/.claude/plugins/marketplaces/some-org-some-repo/ and retry.
  6. Observe: the add now succeeds.

Requested behaviour

Either of the following would fix this:

  1. Re-fetch on failed parse — if the cached marketplace manifest fails to parse on a subsequent add call, invalidate the cache and re-clone from the remote.
  2. 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.

extent analysis

TL;DR

Implement a cache invalidation mechanism to handle failed plugin marketplace additions, either by re-fetching on failed parse or cleaning up the cache on failure.

Guidance

  • Consider implementing option 1: Re-fetch on failed parse, where if the cached marketplace manifest fails to parse on a subsequent add call, the cache is invalidated and re-cloned from the remote.
  • Implement option 2: Clean up cache on failure, where if the initial clone/extraction fails, delete the partial cache entry before returning the error, allowing the next retry to start from a clean slate.
  • To verify the fix, test the /plugin marketplace add command with a flaky network connection, then retry after fixing the network issue and observe if the command succeeds without manual cache removal.
  • Document the manual recovery recipe in the README, as a temporary workaround until the fix is implemented.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a design decision on how to handle cache invalidation.

Notes

The fix should be implemented in the Claude Code CLI to handle cache invalidation, and the chosen solution should be tested on both macOS and Linux environments to ensure compatibility.

Recommendation

Apply workaround: Document the manual recovery recipe in the README and implement option 2: Clean up cache on failure, as it is simpler and matches the user's mental model, until a more robust solution can be implemented.

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