eval-test-skill
Git branch cleanup utility. Lists and deletes branches that have been merged to main. Use when user wants to clean up old branches, delete merged branches, or tidy up their git repository.
When & Why to Use This Skill
This Claude skill automates Git repository maintenance by identifying and deleting local branches that have already been merged into the main branch. It helps developers maintain a clean and organized workspace, reducing cognitive load and preventing branch clutter while ensuring safety through merged-only deletion logic and protected branch filters.
Use Cases
- Post-Feature Completion: Quickly remove local feature branches after they have been successfully merged into the main codebase to keep the branch list manageable.
- Routine Repository Maintenance: Periodically scan and purge stale branches to improve Git command readability and simplify branch navigation during daily development.
- Safe Bulk Deletion: Safely clean up dozens of merged branches at once using automated filters that protect critical branches like main/master and the currently active branch.
| name | eval-test-skill |
|---|---|
| description | Git branch cleanup utility. Lists and deletes branches that have been merged to main. Use when user wants to clean up old branches, delete merged branches, or tidy up their git repository. |
Git Branch Cleanup
Clean up merged git branches from local repository.
Workflow
- List merged branches - Show branches already merged to main
- Confirm deletion - Ask user which branches to delete
- Delete branches - Remove selected merged branches
Commands
List merged branches
git branch --merged main | grep -v "^\*\|main\|master"
Delete a single branch
git branch -d <branch-name>
Delete all merged branches (except main/master)
git branch --merged main | grep -v "^\*\|main\|master" | xargs -r git branch -d
Safety
- Only delete branches merged to main (use
-dnot-D) - Never delete
mainormaster - Never delete currently checked out branch
- Show list before deletion for user confirmation