Not loaded · from skill-madness
Cleans up stale git worktrees whose work is already merged to main, resolving phantom modified files and cluttered git status.
Claude Code won't load this skill
It ships in skill-madness at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Systematically find and remove git worktrees whose work is already on the main branch. The core problem this solves: worktrees created during feature work persist after the branch is merged, showing "modified" files that are actually already committed — creating confusion about what's merged and what isn't.
Worktrees are created for isolation during feature work. When the branch
gets merged (squash-merge, regular merge, or cherry-pick), the worktree
doesn't disappear. It still has the branch checked out, and git status
inside it shows modifications relative to the worktree's HEAD — but those
changes are already on main. The worktree is stale but looks active.
git worktree list
Identify the main worktree (the repo root) — it must never be removed. Everything else is a candidate for cleanup.
If there's only the main worktree, report "No secondary worktrees found" and stop.
Run these checks in order. A worktree is safe to remove if ANY of these conditions is true:
git branch --merged main | grep -q <branch-name>
If the branch appears in --merged, all its commits are reachable from
main. Safe to remove.
Squash merges don't show up in --merged because git sees different
commit hashes. Check if the branch's changes are already on main by
comparing the trees:
git diff main...<branch-name> --stat
If this produces no output (empty diff), the branch's content is identical to main. Safe to remove.
If the worktree has uncommitted modifications, check whether those changes already exist on main:
# List uncommitted changes in the worktree
git -C <worktree-path> status --porcelain
# For each modified file, check if main already has those changes
git diff main -- <file-path>
If every modified file in the worktree matches what's on main, the worktree is stale. Safe to remove.
If none of the checks pass, the worktree has genuinely unmerged work. Flag it for the user's attention — don't remove it.
Show a clear summary:
Worktree cleanup scan complete.
Safe to remove (work already on main):
.claude/worktrees/heuristic-northcutt [claude/heuristic-northcutt] — branch merged
.worktrees/auth-feature [feat/auth] — squash-merged (empty diff vs main)
Needs attention (unmerged work):
.worktrees/experimental [feat/experiment] — 3 files differ from main
No secondary worktrees. (if applicable)
For each safe-to-remove entry, include the reason (branch merged, empty diff, or changes match main) so the user understands why it's safe.
For each worktree confirmed safe:
git worktree remove --force <worktree-path>
--force is necessary because git sees the worktree's branch as having
local modifications (even though those changes are on main). This is
the whole point of this skill — we've already verified the work is safe.
After removing worktrees, delete the local branches if they're merged:
git branch -d <branch-name>
Use lowercase -d (safe delete — refuses if not merged). If -d fails
because git doesn't recognize a squash-merge as "merged", and Step 2
Check B confirmed the diff is empty, use -D:
git branch -D <branch-name>
git worktree prune
This cleans up any stale worktree administrative files that reference worktrees that no longer exist on disk.
git worktree list
Report what was removed and what remains.
git branch -d first (safe), only escalate to -D when diff-against-main confirmed emptyWorktrees accumulate in several places depending on what created them:
| Creator | Typical Location |
|---|---|
| Claude Code (built-in) | .claude/worktrees/<name> |
| superpowers skill | .worktrees/<name> or worktrees/<name> |
| Manual / other tools | Anywhere (check git worktree list) |
Always use git worktree list as the source of truth — don't assume
locations.
Pairs with:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ivy00johns/skill-madness --plugin skill-madness87 skills in this plugin
/accessibility-auditAudit and fix web accessibility against WCAG 2.2 AA, Section 508 and the ADA: axe scan, keyboard, screen-reader and zoom checks, plain-language content and PDFs, source fixes, and an honest conformance report (ACR/VPAT draft). Use for any a11y review, fix or compliance question. Trigger on "accessibility audit", "is this ADA compliant", "Section 508", "WCAG", "VPAT", "a11y"./andonRun work through a live Andon board (the kanban that dispatches cards to Claude Code, Codex and Gemini on your machines): push a plan's cards with the skills each run must load, read the board, answer what needs you, administer a machine, and refresh this skill when Andon changes. Trigger on "/andon", "put this plan on andon", "what needs me on andon", "why isn't my card running".
/Other plugins' skills for the same job