cleanup

cleanup is a command for Claude Code from juanmhidalgo/claude-plugins. It costs 80 tokens per session (4,439 once invoked), scanned A, original, MIT.

A command for finding and deleting completed or abandoned specification and implementation-plan files from a repository.

In plain words
What is it for?
Use it to identify safe-to-remove SPEC and PLAN files and confirm their deletion before cleanup.
Why use it?
It reduces leftover planning documents while protecting files that still describe active work.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

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 feature-dev plugin — 2 skills, 7 commands, 13 agents shipped together

Good fit Use it to identify safe-to-remove SPEC and PLAN files and confirm their deletion before cleanup.

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 juanmhidalgo/claude-plugins
Claude Code
/plugin install feature-dev

Made for: Claude Code.

Or install feature-dev, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 13 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/cleanup/github.svg)](https://agentmods.dev/commands/juanmhidalgo/claude-plugins/cleanup)
Your own site
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/cleanup"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/cleanup/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

Your own site · 80×15
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/cleanup"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,439 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00080 $0.04439
Opus 5.5 $0.00032 $0.01776
Sonnet 5.5 $0.00016 $0.00888
Haiku 4.5 $0.00008 $0.00444

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

Security

Grade A, and why

cleanup scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Bash(curl -s -o /dev/null --max-time 2 http://127.0.0.1:*)
feature-dev/commands/cleanup.md · 187 lines

How it starts

The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • Repository: !git remote get-url origin
  • Current branch: !git branch --show-current
  • Feature store: each feature lives in .feature-dev/features/<slug>/, managed by ${CLAUDE_PLUGIN_ROOT}/scripts/features.py (pass --root <repo root>). Layout: artifact-locations.md.

Phase 0: Discover Features

Run ${CLAUDE_PLUGIN_ROOT}/scripts/features.py list --json --root <repo root>. Each entry has slug, status (draft, approved, planned, running, halted, implemented, invalid), plan (steps, completed, halted_at, halt_reason, or null), issue (a ref or null), artifacts (kind, path, needs_review) and, for an invalid feature, a reason. A missing .feature-dev/features/ is an empty list.

The review history, review files and server pointer of a feature live inside its folder, so one feature is one unit: nothing is matched by slug prefix, and no review data outlives its feature.

If the list is empty, STOP and tell the user: "No features found. Nothing to clean up." Do not proceed.

Phase 1: Categorize

Build three lists from the status of each entry.

Safe to delete:

  • Features with status implemented — the work is done. The features.py delete command itself removes only these, so this list and the script agree.

Active work (never offer for deletion):

  • Status running or halted — a /feature-dev:tdd run is mid-flight or resumable. Deleting one discards its plan.completed record and strands a dirty working tree with no way to tell which steps already landed.
  • Status draft, approved or planned — work in progress.

Ambiguous (do not offer by default — the user can delete manually):

  • Status invalid — a broken feature folder; surface its reason, never include it.

Phase 1a: Stale review-server pointers

While a review page is served, .feature-dev/features/<slug>/reviews/.url holds its address. For every feature that has one, other than a running or halted feature, Read it and probe <url>alive (the pointer ends in /): curl -s -o /dev/null --max-time 2 <url>alive. /alive answers without a token and without resetting the server's idle timer, so the probe never keeps a forgotten review open. Exit 7 (connection refused) means no server — the pointer is stale. Any other exit means something answers — a review in progress:

  • move the feature from Safe to delete to Active work with reason review in progress — the review's verdict is about to be applied to it;
  • say "review server running at — submit or close it, then rerun".

Read the full file on GitHub · 187 lines

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. 2d ago Changed · -40 lines · -11 tokens per session 786484ad0889
  2. 14d ago Changed · +4 lines bbe71d92795c
  3. 18d ago Changed · +13 lines 04b81a2d1aad
  4. 19d ago Changed · +97 lines · +49 tokens per session f9b64bb85caa
  5. 23d ago Changed · -4 lines 177fe43d58a4
  6. 1mo ago Changed · +1 lines e6d468288721
  7. 1mo ago First seen · 116 lines · 42 tokens per session scan A 3e8308e24c57

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository juanmhidalgo/claude-plugins (8 stars, last pushed 2d ago), licensed MIT. It adds 80 tokens to every session and 4,439 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.