Plugin marketplace directory deleted during failed auto-update, breaking all plugins from that marketplace

Resolved 💬 2 comments Opened Mar 28, 2026 by bhargavchippada Closed May 11, 2026

Bug Description

The plugin system's marketplace auto-update mechanism appears to delete the marketplace directory before re-cloning. If the re-clone fails (network timeout, rate limit, etc.), the directory stays deleted, breaking all plugins installed from that marketplace.

Steps to Reproduce

  1. Install plugins from a marketplace (e.g., claude-plugins-official)
  2. Wait for the marketplace auto-update cycle to trigger
  3. If the git clone/pull fails during update (network issue, rate limit, etc.), the marketplace directory is deleted
  4. All plugins from that marketplace fail with: Plugin X not found in marketplace Y

Expected Behavior

Marketplace auto-update should be atomic — either the update succeeds completely, or the old directory is preserved. The update should not leave the system in a broken state on failure.

Actual Behavior

  • known_marketplaces.json still references the marketplace with an updated lastUpdated timestamp
  • The marketplace directory under ~/.claude/plugins/marketplaces/ is deleted
  • Plugin cache (~/.claude/plugins/cache/) still has the installed copies
  • /doctor reports errors like: Plugin hookify not found in marketplace claude-plugins-official
  • /reload-plugins shows errors

Workaround

Manually re-clone the marketplace:

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

This has to be repeated every time the auto-update fails.

Environment

  • Claude Code v2.1.86
  • Linux (Ubuntu)
  • Marketplace: claude-plugins-official (anthropics/claude-plugins-official)
  • Affected plugins: hookify, ralph-loop, typescript-lsp, pyright-lsp, superpowers

Suggested Fix

Use a rename-based atomic update pattern:

  1. Clone/pull into a temporary directory (e.g., marketplace-name.tmp)
  2. Verify the clone succeeded (check for expected files)
  3. Rename old directory to marketplace-name.old
  4. Rename temp directory to marketplace-name
  5. Delete .old directory
  6. On failure at any step, preserve the original directory

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗