Skip to content
Back to skills

Worktree Cleanup

ASecurity

Audit and reclaim scoped worktrees while preserving active work.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 1, 2026
ai-agents

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 1, 2026

npx -y skills add williamwue/oh-my-stack --skill worktree-cleanup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Worktree Cleanup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Worktree Cleanup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/williamwue-worktree-cleanup-oh-my-stack/badge)](https://www.skillsdirectory.com/skills/williamwue-worktree-cleanup-oh-my-stack)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: worktree-cleanup
description: "Audit and reclaim scoped worktrees while preserving active 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.

Files in this skill

  • SKILL.md1.6 KB
  • agents/openai.yaml244 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…