se-clean-gone-branches
Clean up local branches whose remote tracking branch is gone.
Skill by simonwjackson
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/simonwjackson-se-clean-gone-branches
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/se-clean-gone-branches
Tools it pre-approves 1
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
bash
What's inside
- Skill name
se-clean-gone-branches- Description
- Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated worktrees for branches that have them.
- License
- MIT
- Compatibility
- git
- Allowed tools
- bash
- Instructions
- 63 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- clean-gone · scripts/
SKILL.md (first lines)
**Pi-native path:** call the `se_clean_gone` tool with `{ dryRun, includeWorktrees }`. The tool wraps this skill's `scripts/clean-gone` and adds typed dryRun handling, structured results, and per-branch failure reporting. Prefer the tool over bash invocation of the script.
# Clean Gone Branches
Delete local branches whose remote tracking branch has been deleted, including any associated worktrees.
## Workflow
### Step 1: Discover gone branches
Run the discovery script to fetch the latest remote state and identify gone branches:
```bash
bash scripts/clean-gone
```
[scripts/clean-gone](./scripts/clean-gone)
The script runs `git fetch --prune` first, then parses `git branch -vv` for branches marked `: gone]`.
If the script outputs `__NONE__`, report that no stale branches were found and stop.
### Step 2: Present branches and ask for confirmation
Show the user the list of branches that will be deleted. Format as a simple list:
```
These local branches have been deleted from the remote:
- feature/old-thing
- bugfix/resolved-issue
- experiment/abandoned
Delete all of them? (y/n)
```
Wait for the user's answer using the platform's blocking question tool: `AskUserQuestion` in Claude Code (call `ToolSearch` with `select:AskUserQuestion` first if its schema isn't loaded), `request_user_input` in Codex, `ask_user` in Gemini, `ask_user` in Pi (requires the `pi-ask-user` extension). Fall back to presenting the list in chat only when no blocking tool exists in the harness or the call errors (e.g., Codex edit modes) — not because a schema load is required. Never silently skip the question.
This is a yes-or-no decision on the entire list -- do not offer multi-selection or per-branch choices.
### Step 3: Delete confirmed branches
If the user confirms, delete each branch. For each branch:
1. Check if it has an associated worktree (`git worktree list | grep "\\[$branch\\]"`)
2. If a worktree exists and is not the main repo root, remove it first: `git worktree remove --force "$worktree_path"`
3. Delete the branch: `git branch -D "$branch"`
Report results as you go:
```
Removed worktree: .worktrees/feature/old-thing
Deleted branch: feature/old-thing
Deleted branch: bugfix/resolved-issue
Deleted branch: experiment/abandoned
Cleaned up 3 branches.
```
If the user declines, acknowledge and stop without deleting anything.From simonwjackson/pi-software-engineering, MIT.
More from simonwjackson/pi-software-engineering
- 0.479score
se-doc-review
simonwjackson
Review requirements or plan documents using parallel persona agents that surface role-specific issues.
SkillCFreshness: CClaude Code +9 - 0.479score
se-demo-reel
simonwjackson
Capture a visual demo reel (GIF, terminal recording, screenshots) for PR descriptions.
SkillCFreshness: CClaude Code +9 - 0.479score
se-brainstorm
simonwjackson
Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation.
SkillCFreshness: CClaude Code +9 - 0.479score
se-ideate
simonwjackson
Generate and critically evaluate grounded ideas about a topic.
SkillCFreshness: CClaude Code +9 - 0.479score
se-debug
simonwjackson
Systematically find root causes and fix bugs.
SkillCFreshness: CClaude Code +9 - 0.475score
se-agent-native-architecture
simonwjackson
Build applications where agents are first-class citizens.
SkillCFreshness: CClaude Code +9 - 0.474score
se-frontend-design
simonwjackson
Build web interfaces with genuine design quality, not AI slop.
SkillCFreshness: CClaude Code +9 - 0.474score
se-challenge-plan
simonwjackson
Stress-test an implementation plan or proposed approach against project context, domain language, existing decisions, risks, sequencing, and test strategy.
SkillCFreshness: CClaude Code +9 - 0.474score
se-architecture-improvement
simonwjackson
Find deepening opportunities in a codebase using project context, established domain language, documented decisions, and public-contract test posture.
SkillCFreshness: CClaude Code +9 - 0.474score
se-backlog
simonwjackson
Ambient engineering backlog skill for capturing, reviewing, refining, promoting, and pruning durable follow-up work in a repo-local Backlog.md-style backlog.
SkillCFreshness: CClaude Code +9 - 0.473score
se-polish-beta
simonwjackson
[BETA] Start the dev server, open the feature in a browser, and iterate on improvements together.
SkillCFreshness: CClaude Code +9 - 0.470score
se-optimize
simonwjackson
Run metric-driven iterative optimization loops.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 30, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from simonwjackson
- 0.479score
se-doc-review
simonwjackson
Review requirements or plan documents using parallel persona agents that surface role-specific issues.
SkillCFreshness: CClaude Code +9 - 0.479score
se-ideate
simonwjackson
Generate and critically evaluate grounded ideas about a topic.
SkillCFreshness: CClaude Code +9 - 0.479score
se-demo-reel
simonwjackson
Capture a visual demo reel (GIF, terminal recording, screenshots) for PR descriptions.
SkillCFreshness: CClaude Code +9 - 0.479score
se-debug
simonwjackson
Systematically find root causes and fix bugs.
SkillCFreshness: CClaude Code +9 - 0.479score
se-brainstorm
simonwjackson
Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation.
SkillCFreshness: CClaude Code +9 - 0.475score
se-agent-native-architecture
simonwjackson
Build applications where agents are first-class citizens.
SkillCFreshness: CClaude Code +9
Cite this page
se-clean-gone-branches skill. Agent Mart. https://agentmart.dev/skills/simonwjackson-se-clean-gone-branches (last updated 2026-10-24)