How this skill is triggered — by the user, by Claude, or both
Slash command
/git-command:clean-goneThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Clean up local branches that have been deleted from the remote (marked as `[gone]`), including associated worktrees.
Clean up local branches that have been deleted from the remote (marked as [gone]), including associated worktrees.
Fetch and prune remote tracking info
git fetch --prune
List branches to identify [gone] status
git branch -v
Note: Branches with a '+' prefix have associated worktrees.
List worktrees
git worktree list
Remove worktrees and delete [gone] branches
git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do
echo "Processing branch: $branch"
worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}')
if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then
echo " Removing worktree: $worktree"
git worktree remove --force "$worktree"
fi
echo " Deleting branch: $branch"
git branch -D "$branch"
done
If no branches are marked as [gone], report that no cleanup was needed.
$ARGUMENTS
npx claudepluginhub kosmoche/git-commandGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.