Branch Cleanup Command
Safely cleans up Git branches and worktrees with PR-aware filtering and dry-run previews.
/plugin marketplace add jleechanorg/claude-commands/plugin install claude-commands@claude-commands-marketplaceWhen this command is invoked, YOU (Claude) must execute these steps immediately: This is NOT documentation - these are COMMANDS to execute right now. Use TodoWrite to track progress through multi-phase workflows.
Action Steps:
Purpose: Safe cleanup of Git branches and worktrees with comprehensive safety features
Action: Execute the enhanced branch-cleanup.sh script with worktree cleanup functionality
Usage: /bclean [options]
--dry-run - Preview what would be cleaned without making changes--force - Skip confirmation prompts (use with caution)--days N - Age threshold for worktree cleanup (default: 2 days)--help - Show detailed help and examplesâ Branch Cleanup: Safely removes local branches without open PRs â Worktree Cleanup: Removes stale worktrees based on commit age â PR-Aware: Preserves branches with active GitHub PRs â Safety First: Never deletes uncommitted work or current branch â Configurable: Adjustable age thresholds for worktree cleanup
When /bclean is used, Claude should execute the enhanced branch-cleanup.sh script:
Action: Execute ./claude_command_scripts/commands/branch-cleanup.sh with any provided arguments
This provides:
Safety Features:
/bclean --dry-run - Preview cleanup without changes/bclean - Interactive cleanup with confirmations/bclean --days 7 - Clean worktrees older than 7 days/bclean --help - Show detailed usage informationCommand executes the enhanced script with all provided arguments for full functionality.