| description | argument-hint |
|---|---|
Clean up stale plugin caches from removed marketplaces |
[--dry-run] [marketplace-name] |
Clean up stale plugin artifacts (commands, agents, skills) from marketplaces that have been removed.
{{arguments}}
Analyze the plugin system state and clean up orphaned data:
Read these files to understand current state:
~/.claude/plugins/known_marketplaces.json- Active marketplaces~/.claude/plugins/installed_plugins.json- Plugin registry v1~/.claude/plugins/installed_plugins_v2.json- Plugin registry v2
List directories in:
~/.claude/plugins/cache/- Cached plugin artifacts~/.claude/plugins/marketplaces/- Downloaded marketplace repos
Compare cache directories against known_marketplaces.json:
- Any directory in
cache/NOT listed inknown_marketplaces.jsonis orphaned - Any plugin in
installed_plugins*.jsonwith@marketplacesuffix where marketplace is NOT inknown_marketplaces.jsonis orphaned
Present a summary:
Plugin Cache Analysis
=====================
Active Marketplaces:
- marketplace-name (last updated: date)
Orphaned Cache Directories:
- orphaned-marketplace/ (X plugins, Y MB)
Orphaned Plugin Entries:
- plugin-name@orphaned-marketplace
- another-plugin@orphaned-marketplace
Recommended Actions:
1. Remove cache directory: ~/.claude/plugins/cache/orphaned-marketplace/
2. Clean plugin entries from installed_plugins.json
3. Clean plugin entries from installed_plugins_v2.json
If user did NOT specify --dry-run:
-
Remove orphaned cache directories:
rm -rf ~/.claude/plugins/cache/<orphaned-marketplace>/
-
Update installed_plugins.json:
- Read current content
- Filter out plugins with
@<orphaned-marketplace>suffix - Write updated content back
-
Update installed_plugins_v2.json:
- Read current content
- Filter out plugins with
@<orphaned-marketplace>suffix - Write updated content back
-
Optionally remove orphaned marketplace repos:
- Check
~/.claude/plugins/marketplaces/for directories not in known_marketplaces.json - Remove if orphaned
- Check
After cleanup:
Cleanup Complete
================
Removed:
- Cache: ~/.claude/plugins/cache/orphaned-marketplace/ (X plugins)
- Plugin entries: Y entries removed from registries
Next Steps:
- Restart Claude Code to reload plugin registry
- Run `/plugin list` to verify cleanup
--dry-run: Only show what WOULD be cleaned, don't actually delete<marketplace-name>: Only clean specific marketplace (e.g.,makably)- No arguments: Clean ALL orphaned marketplaces
- Always show what will be deleted before deleting
- Preserve
known_marketplaces.json(source of truth) - Only delete cache/registry entries, never marketplace configs
- If in doubt, default to dry-run behavior