[BUG] /plugin update does not invalidate plugin cache
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
-
Add a private marketplace hosted on GitLab:
/plugin marketplace add [email protected]:your-org/your-marketplace.git -
Install a plugin from the marketplace:
/plugin install your-plugin@your-marketplace -
Make changes to the plugin in the marketplace repository (e.g., update commands or agents)
-
Run
/plugin update -
Check cache directory - files remain outdated:
ls -la ~/.claude/plugins/cache/ -
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 🤖
is there a workaround until it gets fixed? which files should be removed
+1
@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.
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
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:
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
We ran into this issue and created a "one and done" solution for our gopher-ai marketplace.
Our approach:
git fetch && reset --hard origin/mainon the marketplace repo (updates source)- Clear the plugin cache (forces reinstall)
- Remove ALL
*@gopher-aiplugin entries frominstalled_plugins.jsonusing 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 --hardinstead 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-pluginsClaude 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!
+1. It looks like I can only reinstall; the "update" function isn't well yet.