Agent skill
clean-all
Delete all non-main branches (local + remote) and prune stale refs
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/clean-all
SKILL.md
Clean up all branches except main, locally and remotely.
- Run
git remote prune originto remove stale remote tracking refs. - Delete all local branches except
main:git branch | grep -v "main" | xargs git branch -D - Delete all remote branches except
main:git branch -r | grep -v "origin/main\|origin/HEAD" | sed 's|origin/||' | xargs -I{} git push origin --delete {} - Remove any
.claude/worktrees/*directories:git worktree removeeach, then delete leftover empty dirs. - Verify with
git branch -aandls .claude/worktrees/— onlymainshould remain. - Report summary: how many local branches, remote branches, and worktrees were cleaned up.
If everything is already clean, just say so.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?