Skip to content
Development
Skill

/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".

From plugin
claude-codex-settings
1.1k78 skills4 agents5 commands5 MCP
Install
$ npx -y skills add fcakyon/claude-codex-settings --skill clean-gone-branches --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/clean-gone-branches

Context preview

The summary Claude sees to decide when to auto-load this skill.

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".

SKILL.md

clean-gone-branches.SKILL.md
name: clean-gone-branches
description: 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".

Clean Gone Branches

Remove local git branches that have been deleted from the remote.

Process

1. **Update remote references**

  • Run `git fetch --prune`.

2. **Inspect local state**

  • Run `git branch -vv` to find branches marked as `[gone]`.
  • Run `git worktree list` to see whether any of those branches still have worktrees.

3. **Remove worktrees first**

  • For each `[gone]` branch that still has a worktree, remove the worktree before deleting the branch.

4. **Delete the gone branches**

  • Delete each local branch marked as `[gone]`.

5. **Report the result**

  • List removed worktrees and deleted branches.
  • If there are no `[gone]` branches, report that nothing needed cleanup.
Ships withclaude-codex-settings

Battle-tested Claude Code, OpenAI Codex, Cursor configs, plugins, hooks and agents with Kimi, MiniMax and GLM API support.

Get the whole plugin

Other skills on claude-codex-settings.