Try now
Edit

Repository cleanup loop

Inspect branches, worktrees, commits, and PRs; recover valuable work and remove stale state with evidence.

Engineering Matthew Berman git cleanup maintenance

Use this when repo state has become hard to trust.

  1. List local branches, remote branches, open PRs, closed PRs, and worktrees.
  2. Identify unmerged commits and owners.
  3. Recover valuable work by opening or updating PRs.
  4. Archive or delete stale branches only after confirming no useful commits remain.
  5. Prune unused worktrees and stale remotes.
  6. Summarize what was recovered, retained, and removed.

Stop when every remaining branch and PR has a clear owner or purpose.