Git Worktree Cleanup At Scale

Identify and remove stale git worktrees blocking branch deletion in multi-repo environments

vamseeachanta b83f973 678 B Updated

File contents

Git Worktree Cleanup at Scale

Worktrees are lightweight working directories sharing a .git store, useful for parallel agent work. However, stale worktrees block branch deletion and consume disk space. List active worktrees with git worktree list, identify ones on merged/obsolete branches, then remove with git worktree remove <path> before deleting the branch. This is especially critical in automation-heavy repos where agent sessions leave behind worktrees. Implement automated cleanup hooks to prevent accumulation.

vamseeachanta/workspace-hub/tree/main/.agents/skills/workspace-hub/learned/git-worktree-cleanup-at-scale commit b83f973043

Frequently asked questions

npx skillmds@latest add vamseeachanta/git-worktree-cleanup-at-scale