/git-workflow:branch-cleanupfrom git-workflow
Cleans up local and remote git branches after working on multiple PRs. Analyzes merged, gone-remote, and protected branches, then deletes them with user confirmation.
Ships in git-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Perform a complete cleanup of local and remote branches after working on multiple PRs.
Default branch: !git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"
Current branch: !git branch --show-current
Fetch latest: !git fetch --all --prune 2>&1
Local branches with tracking status:
!git branch --format='%(refname:short) %(upstream:track)' | sort
Recent branches by activity:
!git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short) - %(committerdate:relative)'
Remote branches:
!git branch -r --format='%(refname:short)' | grep -v HEAD | sort
Merged into default branch: !git branch --merged
Branches with gone remotes:
!git branch -vv | grep ': gone]' | awk '{print $1}' | sort
Never delete branches matching these patterns:
main, master, develop, staging, productionrelease/* branches (unless explicitly confirmed)renovate/* branches (managed by Renovate bot)Review the branch inventory above. Categorize branches:
release/* branches, branches with unpushed commitsPresent the cleanup plan and ask the user to select scope:
If "Review each" is selected, iterate through candidates asking per-branch confirmation.
After confirmation, execute in order:
git remote prune origingit branch -d <branch>git branch -D <branch>Record each branch name and SHA before deleting: git rev-parse <branch>
If deletion fails, ask user: Force delete, Skip, or Abort.
Ask whether to delete corresponding remote branches on origin.
Report:
git checkout -b <branch> <sha>What SKILL.md sets; muted values are Claude Code's defaults
general-purpose), in the backgroundThree short reads, in order
npx claudepluginhub basher83/lunar-claude --plugin git-workflow5 skills in this plugin
/generate-changelogGenerate changelog using git-cliff, optionally bump version tag/git-commitRun hooks and create clean, logical commits via the commit-craft agent./git-statusSummarize the current state of the git repository/git-workflowBest practices for git workflow automation including atomic commits, branch naming, conventional commit format, and changelog generation.Other plugins' skills for the same job