Perform a comprehensive analysis of the git repository to identify branches and worktrees that can be cleaned up. This is a READ-ONLY analysis - no deletions will be performed.
Analyzes git repository to identify branches and worktrees for cleanup.
/plugin marketplace add bengous/claude-code-plugins/plugin install git-tools@bengous-pluginsPerform a comprehensive analysis of the git repository to identify branches and worktrees that can be cleaned up. This is a READ-ONLY analysis - no deletions will be performed.
Run the following command to identify branches whose remote tracking branches no longer exist:
git branch -v
Look for branches marked with [gone] status. These are local branches whose remote counterparts have been deleted.
Run the following command to list all worktrees:
git worktree list
Identify any worktrees marked as "prunable" - these can be safely removed.
git fetch --prune
gh pr list --state all --limit 100 --json number,title,state,headRefName --jq '.[] | select(.headRefName | startswith("dependabot/")) | "PR #\(.number): \(.headRefName) - \(.state)"'
git branch -r | grep 'dependabot/'
Cross-reference to find dependabot branches with CLOSED or MERGED PRs that still have remote branches.
List all local and remote branches to identify any other stale branches:
git branch
git branch -r
Create a comprehensive summary report with:
Format the report clearly with counts and specific branch names.
End with: "Run /git-tools:cleanup-git to perform the cleanup operations."
/git-tools:cleanup-git