claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] /plugin update does not invalidate plugin cache

Open shohei-sawaguchi opened this issue 2 weeks ago • 8 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When running /plugin update, the marketplace git repository is updated correctly, but the plugin cache in ~/.claude/plugins/cache/ is not cleared or updated. The installed_plugins.json file also retains the old gitCommitSha.

This means updated plugin files are not reflected until the cache is manually deleted.

What Should Happen?

Plugin cache should be invalidated or updated when /plugin update is run, so that changes in the marketplace are reflected immediately.

Error Messages/Logs

No error messages - the command reports success but cache remains stale.

Evidence:
- ~/.claude/plugins/marketplaces/ - Updated (git pull works) ✓
- ~/.claude/plugins/cache/ - Not updated (old files remain) ✗
- ~/.claude/plugins/installed_plugins.json - gitCommitSha not updated ✗

Steps to Reproduce

  1. Add a private marketplace hosted on GitLab: /plugin marketplace add [email protected]:your-org/your-marketplace.git

  2. Install a plugin from the marketplace: /plugin install your-plugin@your-marketplace

  3. Make changes to the plugin in the marketplace repository (e.g., update commands or agents)

  4. Run /plugin update

  5. Check cache directory - files remain outdated:

    ls -la ~/.claude/plugins/cache/
    
    
  6. Compare with marketplace directory - this is updated: cd ~/.claude/plugins/marketplaces/your-marketplace && git log -1

Workaround: Manually delete cache directory: rm -rf ~/.claude/plugins/cache/

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.69 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Windows Terminal

Additional Information

Reporter: Claude Code 2.0.69 🤖

shohei-sawaguchi avatar Dec 15 '25 16:12 shohei-sawaguchi

is there a workaround until it gets fixed? which files should be removed

nikitakot avatar Dec 17 '25 10:12 nikitakot

+1

MariusWilsch avatar Dec 18 '25 18:12 MariusWilsch

@nikitakot Deleting the stale plugin cache resolves the issue:

# Clear cache for a specific marketplace
rm -rf ~/.claude/plugins/cache/<marketplace>/

# Or clear all cached plugins
rm -rf ~/.claude/plugins/cache/

After clearing, restart Claude Code and the plugins will be reinstalled from the updated marketplace repo.

Note: Even with "autoUpdate": true set in ~/.claude/plugins/known_marketplaces.json, the cache is not invalidated when the marketplace repo is updated via git pull.

mavam avatar Dec 19 '25 09:12 mavam

I'd add that the workaround submitted by the OP doesn't address the entries that remain in ~/.claude/plugins/installed_plugins.json. At least for me, it doesn't appear to cause any error messages, but it also seems that a "clean" update would account for this

pgiles avatar Dec 19 '25 19:12 pgiles

This bug is still present in Claude v2.0.74

  • I run /plugin
  • Select the plugin I want to update
  • Click on "Update Now"
  • The plugin view disappears, and I see this (no content) message:
Image

In the meantime, I wrote my own helper script for manually updating plugins using git: update_plugins.py. A preview:

python3 ./helpers/update_plugins.py
🗑️  Deleting cache directory...
   ✅ Cache deleted

🔄 Updating claude-plugins-official...
   ✅ Updated to 6d3752c (main)
🔄 Updating playwright-skill...
   ✅ Updated to bb7e920 (main)
🔄 Updating sablier-plugins...
   ✅ Updated to d31fcec (main)

📝 Updated known_marketplaces.json
📝 Updated installed_plugins.json

✅ All 3 marketplaces updated successfully

PaulRBerg avatar Dec 20 '25 08:12 PaulRBerg

We ran into this issue and created a "one and done" solution for our gopher-ai marketplace.

Our approach:

  1. git fetch && reset --hard origin/main on the marketplace repo (updates source)
  2. Clear the plugin cache (forces reinstall)
  3. Remove ALL *@gopher-ai plugin entries from installed_plugins.json using jq

After running, just restart Claude Code - no need to re-add the marketplace. Plugins are automatically reinstalled from the updated marketplace.json.

Key differences from other approaches:

  • Uses git reset --hard instead of deleting/re-cloning (always works, even if local diverged)
  • Dynamic plugin removal via jq filter - handles renamed/removed/added plugins automatically
  • Standard Unix tools only (no Python required)
  • Also available as a /refresh-plugins Claude Code command

Script: refresh-plugins.sh

One-liner:

curl -fsSL https://raw.githubusercontent.com/gopherguides/gopher-ai/main/scripts/refresh-plugins.sh | bash

You can adapt this for your own marketplace by changing the marketplace name in the script. The jq filter endswith("@your-marketplace") makes it easy to target any marketplace.

Hope this helps!

corylanou avatar Dec 20 '25 16:12 corylanou

+1. It looks like I can only reinstall; the "update" function isn't well yet.

SAIL-Fang avatar Dec 22 '25 10:12 SAIL-Fang