/jamie-superpowers:batch-cleanupfrom jamie-superpowers
Use after every release, after any worktree/branch is merged, once a change looks stable, after a batch of parallel agents, after a deploy, when free disk drops below ~10 GB, or before pausing a session - removes finished worktrees, merged branches, regenerable build output, the project's unused container images/volumes and temp files, and reports space freed
Ships in jamie-superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Agent worktrees, merged branches, build caches, container images and temp files pile up fast. Dozens of worktrees and tens of GB of images are normal after a few days of parallel work. That slows the machine, fills the disk and confuses later agents.
Core principle: clean up after every batch, only what is provably finished, only what belongs to this project.
When (do not let it pile up): after every release, every time a worktree is merged, and as soon as the work looks stable - not only at the end of a batch. Do it before starting heavy work again if the disk is low or the load is high.
"${CLAUDE_PLUGIN_ROOT}/scripts/batch-cleanup". Read every line."${CLAUDE_PLUGIN_ROOT}/scripts/batch-cleanup" --apply.| Removed | Only when |
|---|---|
| Worktrees | Clean (no changes, no untracked files) AND merged into the default branch. Never --force. |
| Local branches of removed worktrees | Merged (git branch -d, never -D) |
| Container images / volumes | Match the project's cleanup.dockerImages / cleanup.dockerVolumes globs AND unused |
| Temp files | Match the project's cleanup.tmpGlobs AND owned by the current user |
| Regenerable build output (build dirs, derived data, archives) | Listed in the project's cleanup.dirs, older than its minAgeMinutes, and no configured heavy job (build/test) is running. An entry with "ask": true is only listed (ASK), never removed |
Without a project config it only touches worktrees and branches. It never touches other projects' worktrees, containers or files, and never runs global prune commands.
The script only removes what the config names. After a release or merge also look for the following, and either add it to cleanup.dirs (regenerable) or ask the user (not regenerable):
Before removing a worktree that holds untracked reports or screenshots, copy them to an archive folder (for example _archive/worktree-leftovers-<date>/) so nothing of value is lost, then remove it.
Never touch a worktree, simulator or directory that a running agent is using; list it as KEEP.
If the project has no .jamie-superpowers.json, propose one to the user (it is committed with the project) with:
repos: sub-repositories, if the project is a multi-repo workspacecleanup.dockerImages / dockerVolumes: only patterns this project createscleanup.tmpGlobs: the project's temp prefixescleanup.dirs: regenerable build output, as {"glob": "...", "minAgeMinutes": 30, "ask": false}; relative globs apply inside every repo, absolute or ~ globs as writtenWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (thongpham95/jamie-superpowers) — no native marketplace selected
npx claudepluginhub p/thongpham95-jamie-superpowers22 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./cache-aware-dispatchUse before sending follow-up work (fixes, review findings, questions) to an existing subagent, before switching models, and before long waits - decides between resuming an agent and dispatching a fresh one based on prompt-cache age and context size/ci-watchUse after every push or merge to a branch with CI, and whenever the user reports CI failure emails or red checks - follows the run to completion, collects the COMPLETE list of failures, classifies them, and fixes root causes so they do not recur