Audit and reclaim explicitly scoped Git worktrees and disposable simulator state while preserving active and uncommitted work.
Pro scans all 2 files and shows the line behind each finding
Scanned 10/1/2026
npx -y skills add williamwue/oh-my-stack --skill worktree-cleanup --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Worktree Cleanup?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/williamwue-worktree-cleanup-be423b48)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
name: worktree-cleanup
description: Audit and reclaim explicitly scoped Git worktrees and disposable simulator state while preserving active and uncommitted work.
---
# Worktree cleanup
Inventory exact paths from the repository's worktree listing, plus disk size,
branch/commit, merge or PR state, tracked/untracked/ignored changes, and active
task ownership. A classification script is advice, not deletion authority.
Cross-check pinned or running tasks and sibling worktrees those tasks spawned.
Do not infer inactivity from an old directory timestamp alone.
Classify each target: active, uncommitted, clean recoverable, or uncertain.
Never force-remove a worktree with tracked or untracked user work based on a
`safe` label. Show the exact dirty paths and request a disposition before
irreversible loss. For clean merged/abandoned paths explicitly within the
cleanup request, use the native worktree removal operation without force;
record retained branch refs. If ignored data prevents removal, inspect and
name it before deciding whether it is disposable.
Simulator clones and runtime caches are separate targets. Enumerate each one,
check whether a running task needs it, and use the provider's targeted delete
operation. Do not use broad recursive deletion against a home, workspace,
repository root, or unresolved glob. Preserve captures and evidence whose
retention is still needed.
Re-list worktrees and disk usage afterward. Report exact paths removed,
reclaimed space, remaining refs, and held targets with reasons. State whether
removed data is recoverable from a branch or backup. If task state is not
observable, stop deletion of that candidate and explain the uncertainty.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!