Claude-codex-settings clean-gone-branches
This skill should be used when user asks to "clean gone branches", "remove deleted local branches", "prune branches removed from remote", or explicitly invokes "clean-gone-branches".
install
source · Clone the upstream repo
git clone https://github.com/fcakyon/claude-codex-settings
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/fcakyon/claude-codex-settings "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/github-dev/skills/clean-gone-branches" ~/.claude/skills/fcakyon-claude-codex-settings-clean-gone-branches && rm -rf "$T"
manifest:
plugins/github-dev/skills/clean-gone-branches/SKILL.mdsource content
Clean Gone Branches
Remove local git branches that have been deleted from the remote.
Process
-
Update remote references
- Run
.git fetch --prune
- Run
-
Inspect local state
- Run
to find branches marked asgit branch -vv
.[gone] - Run
to see whether any of those branches still have worktrees.git worktree list
- Run
-
Remove worktrees first
- For each
branch that still has a worktree, remove the worktree before deleting the branch.[gone]
- For each
-
Delete the gone branches
- Delete each local branch marked as
.[gone]
- Delete each local branch marked as
-
Report the result
- List removed worktrees and deleted branches.
- If there are no
branches, report that nothing needed cleanup.[gone]