[BUG] Plugin cache not cleaning up old version folders on update
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?
Bug 1: /plugin update doesn't rebuild the cache
When running /plugin update, the plugin system fetches the latest code from GitHub into ~/.claude/plugins/marketplaces/<plugin>/ correctly, but doesn't rebuild the cache at ~/.claude/plugins/cache/<plugin>/ or update the gitCommitSha in installed_plugins.json. As a result, /reload-plugins sees no change and continues loading the stale cache.
Bug 2: Old version folders are not cleaned up after an update
When a plugin updates to a new version (e.g. 1.0.0 → 1.0.1), a new versioned folder is created in ~/.claude/plugins/cache/<plugin>/ but the old one is never deleted. Over time, every version bump accumulates a stale folder in cache, which will grow indefinitely.
What Should Happen?
Workaround for Bug 1: bumping the version in .claude-plugin/plugin.json forces a cache rebuild.
Expected behavior for Bug 2: when a new version folder is created, the previous version folder should be deleted automatically.
Error Messages/Logs
Steps to Reproduce
-
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.116
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗