Help us improve
Share bugs, ideas, or general feedback.
npx claudepluginhub kosmoche/git-commandHow 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.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
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