clean-worktrees — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited clean-worktrees (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Remove worktree directories and orphaned worktree-agent-* branches left behind by agent isolation mode.
Based on community patterns from claude-codex-settings and claude-code-ultimate-guide, adapted for Claude Code's agent worktree pattern.
Related upstream issue: anthropics/claude-code#26725
Run these commands and report counts:
# Count worktree directories
WORKTREE_DIRS=$(find .claude/worktrees -maxdepth 1 -type d -name 'agent-*' 2>/dev/null | wc -l | tr -d ' ')
# Count git worktree registrations (excluding main)
GIT_WORKTREES=$(git worktree list 2>/dev/null | grep 'worktree-agent-' | wc -l | tr -d ' ')
# Count orphaned branches
ORPHANED_BRANCHES=$(git branch --list 'worktree-agent-*' 2>/dev/null | wc -l | tr -d ' ')Report:
## Worktree Inventory
- Worktree directories: {WORKTREE_DIRS}
- Git worktree registrations: {GIT_WORKTREES}
- Orphaned branches: {ORPHANED_BRANCHES}If all counts are 0: report "No stale worktrees found." and stop.
If $ARGUMENTS contains --dry-run: report the inventory and stop. Do not delete anything.
Run in this order:
# Prune stale git worktree references
git worktree prune
# Remove registered worktrees that match agent pattern
git worktree list | grep 'worktree-agent-' | awk '{print $1}' | while read wt; do
git worktree remove --force "$wt"
done
# Delete orphaned branches (allowed by block-git-commit.sh for worktree-agent-* only)
git branch --list 'worktree-agent-*' | xargs git branch -D## Cleanup Complete
- Removed {N} worktree directories
- Deleted {N} orphaned branches
- Pruned git worktree references~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.