Agent Worktree Cleanup
Automates the removal of finished agent worktrees and prunes merged branches to maintain repository hygiene.
The cleanup-worktrees skill is an essential utility for developers using multi-agent Claude Code workflows. It manages the lifecycle of git worktrees created during agent sessions by classifying them as merged, open PR, dirty, or stale. By safely deleting only the completed environments and flagging branches that require manual review, this skill prevents workspace clutter and ensures that the Team Lead agent can maintain a high-performance, production-grade development environment without manual git house-keeping.
주요 기능
01Comprehensive reporting of removed, kept, and review-required paths
02Automated worktree classification (Merged, Open PR, Dirty, Stale)
03Stale branch identification for worktrees older than 14 days
04Safe branch deletion using standard git protocols to prevent data loss
05Detection of uncommitted changes to protect in-flight agent work
063 GitHub stars
사용 사례
01Pruning metadata and merged branches to keep git history and local storage optimized
02Performing weekly repository hygiene to identify abandoned agent spikes
03Cleaning up local environments after a multi-agent feature implementation session