Unofficial · open source

Clean up old Claude Code plugin versions

Claude Code keeps every plugin version it has ever installed, side by side. claude-plugin-cache-prune lists the old ones and deletes the ones you pick, like npkill for your plugin cache.

One ~3 MB binary · macOS, Linux and Windows · no Node or Python needed

Claude plugin cache prune ~/.claude/plugins/cache Total 3.0 GB · reclaimable 2.6 GB · selected 12 (2.6 GB) ───────────────────────────────────────────────────────────────────────────── media-tools/video-studio 7 version(s) - 2.4.1 358.2 MB installed · in use ❯ [x] 2.4.0 356.9 MB old · orphaned 2d ago [x] 2.3.2 355.7 MB old · orphaned 6d ago [x] 2.3.0 352.1 MB old · orphaned 12d ago [x] 2.2.5 349.8 MB old · orphaned 19d ago [x] 2.2.1 346.0 MB old · orphaned 27d ago [x] 2.1.0 341.5 MB old · orphaned 34d ago community/skill-pack 4 version(s) - 1.8.0 24.4 MB installed · in use [x] 1.7.3 24.1 MB old · orphaned 3d ago [x] 1.7.0 23.6 MB old · orphaned 16d ago [x] 1.6.2 22.8 MB old · orphaned 41d ago devtools/browser-mcp 3 version(s) - 3.2.0 15.9 MB installed [x] 3.1.4 15.7 MB old · orphaned 9d ago [x] 3.0.0 15.2 MB old · orphaned 30d ago (temp) temp_subdir_1794812345678_qz7mnb.clone [x] — 349.6 MB temp · leftover temp clone ───────────────────────────────────────────────────────────────────────────── ↑↓/jk move · space select · a select old · n none · enter/d delete · q quit
The interactive list. Old versions start selected; installed and in-use versions cannot be selected.

The problem

Old versions pile up quietly

Every plugin update lands in a new folder under cache/<marketplace>/<plugin>/<version>/, and the previous one stays where it is. Claude Code has no command that collects them, and some plugins weigh hundreds of megabytes per version.

The built-in claude plugin prune does something else: it removes plugins that were installed automatically as dependencies, and leaves old cached versions in place.

One report on the Claude Code issue tracker measured 4.77 GB of cached plugins. Read the issue

~/.claude/plugins/cache
media-tools/└─ video-studio/ ├─ 2.1.0/ 341.5 MB old ├─ 2.2.1/ 346.0 MB old ├─ 2.2.5/ 349.8 MB old ├─ 2.3.0/ 352.1 MB old ├─ 2.3.2/ 355.7 MB old ├─ 2.4.0/ 356.9 MB old └─ 2.4.1/ 358.2 MB installed
6 old versions of one plugin2.1 GB

Features

Careful about what it deletes

Never touches what you use

The version listed in installed_plugins.json is never offered for deletion.

Knows what is running

A version locked by a live Claude Code process (.in_use/<pid>) is protected unless you pass --force.

Orders versions correctly

Semver ordering, so 1.10.0 is newer than 1.2.0. Hash versions fall back to modification time.

Checks again before each delete

Right before removing a folder it re-reads the install list and the lock files, and refuses any path outside the cache.

Interactive or scripted

A keyboard-driven list like npkill, or --dry-run, --yes and --json for scripts.

One file, nothing else to install

A static binary per platform. The installer checks its SHA-256 checksum and asks before it edits your PATH.

How it decides

Every version gets a status

The cache layout is cache/<marketplace>/<plugin>/<version>/. Each version folder is classified before anything is suggested.

StatusMeaningDeleted
installedPath listed in plugins/installed_plugins.jsonNever
in useLocked by a live Claude Code processOnly with --force
oldAny other version of an installed pluginYes, selected by default
not installedNewest version of a plugin you removedWith -u
tempLeftover temp_* clone at the cache rootIf older than 1 hour

If installed_plugins.json cannot be read, the newest version of every plugin is kept.

Install

One command to install

curl -fsSL https://raw.githubusercontent.com/J2TEAM/claude-plugin-cache-prune/main/install.sh | sh

Picks the binary for your CPU, verifies its checksum and installs it to ~/.local/bin. If that folder is not on your PATH, it asks before adding it to your shell startup file. Set ADD_TO_PATH=yes or ADD_TO_PATH=no to answer in advance.

Or download a binary from the Releases page

Usage

Open the list, pick, delete

claude-plugin-cache-prune # interactive listclaude-plugin-cache-prune --dry-run # print what would be deletedclaude-plugin-cache-prune --yes # delete every suggested version

Options

-l, --dry-run
List only, delete nothing
-y, --yes
Delete suggested versions without asking
-u, --include-uninstalled
Also suggest the last version of plugins you removed
-f, --force
Allow deleting versions a running session holds
-d, --dir <path>
Use another cache folder
--json
Print the scan as JSON

Keys in the interactive list

↑↓jk
Move
PgUpPgDnHomeEnd
Jump
space
Select or unselect a version
an
Select all suggested, or none
enterd
Delete the selection, after a y/N prompt
qesc
Quit

Old versions are selected when the list opens.

FAQ

Questions

Something else? Open an issue on GitHub

Is this the same as claude plugin prune?

No. That built-in command removes plugins that were installed automatically as dependencies. It leaves old cached versions in place, and those are what this tool cleans.

Can I run it while Claude Code is open?

Yes. A version an open session is using is marked in use and cannot be selected. Use --force only if you know no session needs it any more.

Does it send any data?

No. The tool reads and deletes folders in your plugin cache and makes no network requests. Only the install script downloads, from GitHub Releases.

Where does it look?

In $CLAUDE_CONFIG_DIR/plugins/cache, or ~/.claude/plugins/cache when that variable is not set. Pass --dir to point it somewhere else.

Is it made by Anthropic?

No. It is an unofficial, community-made tool and is not affiliated with or endorsed by Anthropic.

Start with a dry run

--dry-run lists what would be deleted and touches nothing. The interactive list also asks y/N before every delete.

claude-plugin-cache-prune --dry-run
Install