cleanup-cache

cleanup-cache is a command for Claude Code from CNaught-Inc/claude-code-plugins. It costs 0 tokens per session (219 once invoked), scanned A, original, Apache-2.0.

A cleanup command for removing old cached versions of a plugin while keeping the current version and the newest previous version.

In plain words
What is it for?
Use it to remove stale cached plugin versions and see which versions were kept or deleted.
Why use it?
Old plugin copies can accumulate and use disk space even when they are no longer needed.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the carbonlog plugin — 2 skills, 9 commands, 2 hooks shipped together

Good fit Use it to remove stale cached plugin versions and see which versions were kept or deleted.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add CNaught-Inc/claude-code-plugins
Claude Code
/plugin install carbonlog

Made for: Claude Code.

Or install carbonlog, the plugin that ships this one along with the rest of its 2 skills, 9 commands, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleanup-cache

README.md
[![agentmods](https://agentmods.dev/badge/commands/cnaught-inc/claude-code-plugins/cleanup-cache/github.svg)](https://agentmods.dev/commands/cnaught-inc/claude-code-plugins/cleanup-cache)
Your own site
<a href="https://agentmods.dev/commands/cnaught-inc/claude-code-plugins/cleanup-cache"><img src="https://agentmods.dev/badge/commands/cnaught-inc/claude-code-plugins/cleanup-cache/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cleanup-cache

Your own site · 80×15
<a href="https://agentmods.dev/commands/cnaught-inc/claude-code-plugins/cleanup-cache"><img src="https://agentmods.dev/badge/commands/cnaught-inc/claude-code-plugins/cleanup-cache.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 219 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00219
Opus 5.5 $0.00000 $0.00088
Sonnet 5.5 $0.00000 $0.00044
Haiku 4.5 $0.00000 $0.00022

Measured 2mo ago against content hash 4818c530dbe4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cleanup-cache scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/carbonlog/commands/cleanup-cache.md · 26 lines

What it actually says

/carbonlog:cleanup-cache

Clean up old cached plugin versions to free disk space.

Background

Claude Code downloads each plugin version into a separate directory at ~/.claude/plugins/cache/ but never removes old versions. Over time this accumulates stale copies that waste disk space.

This is a known issue:

What it does

Removes old cached versions of this plugin, keeping:

  • The current version (in use by this session)
  • The most recent prior version (may still be referenced by another session's statusline)

Script

npx -y bun ${CLAUDE_PLUGIN_ROOT}/src/scripts/carbonlog-cleanup-cache.ts ${CLAUDE_PLUGIN_ROOT}

Display the results to the user. The script outputs JSON with removed (count), kept (version list), and deleted (version list) fields.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 26 lines · 0 tokens per session scan A 4818c530dbe4

Subscribe to this mod's changes

cleanup-cache is a command published in the GitHub repository CNaught-Inc/claude-code-plugins (6 stars, last pushed 7mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 219 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

cleanup-cache compared with commands from other repositories

cleanup-cache next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cleanup-cacheCNaught-Inc/claude-code-pluginsCommand67mo agoApache-2.0A0Claude Code
wsdanielmiessler/LifeOSCommand20kyesterdayMITA0Claude Code
cancel-ralphanthropics/claude-plugins-officialCommand46ktodayApache-2.0A4Claude Code
engage.actionshypnguyen1209/offensive-claudeCommand41216d agoMITA11Claude Code
focusData-Wise/claude-pluginsCommand72d agoMITA0Claude Code
stuckData-Wise/claude-pluginsCommand72d agoMITA0Claude Code
quickstartorq-ai/assistant-pluginsCommand62d agoMITA23Claude Code