Plugin cache grows indefinitely without automatic cleanup

Resolved 💬 3 comments Opened Jan 6, 2026 by ferdousbhai Closed Jan 10, 2026

Description

The plugin cache at ~/.claude/plugins/cache/ grows indefinitely as new versions of plugins are cached. There's no automatic garbage collection or TTL-based eviction, causing the cache to accumulate stale entries over time.

Observed Behavior

Each time Claude Code resolves plugins from a marketplace (e.g., claude-plugins-official), it caches the plugin at the resolved git commit hash:

~/.claude/plugins/cache/claude-plugins-official/
├── frontend-design/
│   ├── unknown/           # Jan 3 (initial, no version)
│   ├── 6d3752c000e2/      # Jan 5
│   └── 15b07b46dab3/      # Jan 5
├── ralph-wiggum/
│   ├── unknown/           # Jan 3
│   ├── 6d3752c000e2/      # Jan 5
│   ├── 15b07b46dab3/      # Jan 6
│   └── dbc4a7733cd4/      # Jan 6
...

Over 3 days of normal usage, the cache grew to 14 entries (~436KB). While not large yet, it grows with each new upstream commit and is never pruned.

Expected Behavior

Some form of automatic cache management, such as:

  • LRU eviction (keep N most recent versions per plugin)
  • TTL-based cleanup (remove entries older than X days)
  • Reference counting (remove versions not referenced by any project)
  • A claude plugins cache clean command for manual cleanup

Environment

  • Claude Code CLI
  • Linux (Arch)
  • Multiple plugins from claude-plugins-official marketplace

Workaround

Manual cleanup works fine:

rm -rf ~/.claude/plugins/cache
# Cache rebuilds on next session

---
🤖 Generated with Claude Code

View original on GitHub ↗

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