cleanup

cleanup is a command for Claude Code from Yassinello/claude-plugin-prd-workflow. It costs 13 tokens per session (810 once invoked), scanned A, original, MIT.

A command for removing finished Git branches, unused worktrees, and temporary development files. A worktree is an extra working folder connected to the same Git repository.

In plain words
What is it for?
Use it to find cleanup candidates, review what can be removed, run a dry run, and delete selected local or remote branches, worktrees, and temporary files.
Why use it?
It helps reduce clutter and recover disk space after development work is complete while checking that branches are merged first.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/yassinello/claude-plugin-prd-workflow/cleanup
Clone the repo
git clone --depth 1 https://github.com/Yassinello/claude-plugin-prd-workflow

Made for: Claude Code.

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/yassinello/claude-plugin-prd-workflow/cleanup.svg)](https://agentmods.dev/commands/yassinello/claude-plugin-prd-workflow/cleanup)
Your own site
<a href="https://agentmods.dev/commands/yassinello/claude-plugin-prd-workflow/cleanup"><img src="https://agentmods.dev/badge/commands/yassinello/claude-plugin-prd-workflow/cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 810 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00013 $0.00810
Opus 5 $0.00006 $0.00405
Sonnet 5 $0.00003 $0.00162
Haiku 4.5 $0.00001 $0.00081

Measured 5d ago against content hash afd4d310cd10, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

cleanup 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 5d 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.

.claude/commands/cleanup.md · 161 lines

How it starts

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

Cleanup Command

Clean up development artifacts after PRD completion.

Purpose

Maintain clean repository state:

  • Remove merged branches (local and remote)
  • Delete unused worktrees
  • Clean up temporary files
  • Free disk space
  • Maintain organized git history

Workflow

1. Scan for Cleanup Opportunities

Identify:

  • Merged branches (local)
  • Merged branches (remote)
  • Orphaned worktrees
  • Temporary files in .prds/
  • Old debug sessions

Display summary:

🧹 Cleanup Opportunities

Merged Branches (local):
• feature/PRD-003-oauth2 (merged 5 days ago)
• feature/PRD-005-dark-mode (merged 2 days ago)

Merged Branches (remote):
• origin/feature/PRD-003-oauth2

Worktrees:
• ../worktrees/PRD-003-oauth2 (orphaned)

Temp Files:
• .prds/thoughts/ (347 MB)
• .prds/debug-sessions/ (old sessions)

Total space recoverable: ~450 MB

2. Confirm Cleanup

Ask user to confirm:

  • Which categories to clean
  • Dry-run option available
  • Safety checks (won't delete unmerged work)

3. Execute Cleanup

Local branches:

git branch -d feature/PRD-XXX-name

Remote branches:

git push origin --delete feature/PRD-XXX-name

Worktrees:

git worktree remove ../worktrees/PRD-XXX-name

Temp files:

  • Keep last 30 days of debug sessions
  • Archive old thoughts to .prds/archive/

4. Report Results

✅ Cleanup Complete

Removed:
• 3 local branches
• 2 remote branches
• 1 worktree
• 120 MB temp files

Space freed: 450 MB

Your repository is now clean! 🎉

Safety Features

Protected branches:

  • main/master: Never deleted
  • develop: Never deleted
  • Current branch: Never deleted

Unmerged work:

  • Check merge status before deletion
  • Warn if branch has unmerged commits
  • Require --force flag for unmerged branches

Backup:

  • Archived files moved to .prds/archive/
  • Can be restored if needed

Flags

Dry-run (--dry-run):

  • Show what would be deleted
  • Don't actually delete anything

Read the full file on GitHub · 161 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. 5d ago First seen · 161 lines · 13 tokens per session scan A afd4d310cd10

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository Yassinello/claude-plugin-prd-workflow (12 stars, last pushed 9mo ago), licensed MIT. It adds 13 tokens to every session and 810 once invoked, about $0.0001 per session on Opus 5. 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-30.