git:branch-cleanup

slash command claude_code
Created by Prasham Trivedi

Copy This Prompt

---
allowed-tools: Bash(git:*)
description: Clean up merged and stale branches with safety checks
---

# Clean up merged and stale branches

Remove merged branches and identify stale branches for cleanup.

## Process

1. List branches merged into main/master
2. Identify branches older than $ARGUMENTS days (default: 30)
3. Show current worktrees to avoid deletion
4. Interactive deletion with confirmation
5. Clean up remote tracking branches
6. Update .git/config if needed

## Safety

- Never delete current branch or main/master
- Skip branches with worktrees
- Provide restore commands for each deletion
Slash Command Analysis
  • Requires arguments: No
  • Agent references: None
  • Skill references: None
  • Analysis version: 1.0
Re-analyzes command for arguments and references

Convert to Different Formats

Actions

(Clears cached conversions and forces re-processing)
← Back to List