Worktree Cleanup
Description
Remove worktrees and branches that have been merged: $ARGUMENTS
Installation
claude install-skill https://github.com/davila7/claude-code-templates README
allowed-tools: Bash(git:*), Bash(rm:*), Bash(ls:*), Bash(pwd:*), Bash(grep:*) argument-hint: --all | --branch wt/name | --dry-run description: Clean up merged worktrees and their branches
Worktree Cleanup
Remove worktrees and branches that have been merged: $ARGUMENTS
Instructions
You are in the **main repository** (not a worktree). Clean up finished worktrees.
Step 1: Validate Environment
- undefined
Step 2: Parse Arguments
Parse `$ARGUMENTS` for options:
- undefined
Step 3: Identify Worktrees
- undefined
Step 4: Display Status
Show a table of all `wt/*` worktrees/branches:
| Branch | Worktree Path | Merged? | Action |
|--------|--------------|---------|--------|
| wt/login-page | ../worktrees/repo/wt-login-page | Yes | Will remove |
| wt/auth-bug | ../worktrees/repo/wt-auth-bug | No | Skipped (not merged) |
Step 5: Confirm and Execute
If `--dry-run` was specified, show the table and stop.
Otherwise, use AskUserQuestion to confirm cleanup (unless `--all` was specified with only merged branches).
For each **merged** worktree/branch to clean up:
- undefined
Step 6: Prune
After all removals:
git worktree prune
Step 7: Summary
Show what was cleaned up:
Cleanup Complete
──────────────────────────────────
Removed: worktree(s)
Deleted: local branch(es)
Deleted: remote branch(es)
Skipped: unmerged branch(es)
──────────────────────────────────
If any unmerged branches were skipped, list them and suggest:
- undefined
Related Skills
next.js
| The React Framework | 138360 | 1503 | 1 |
Development community sharing-skills
skill for guidance.
Development community root-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger.
Development community Template Skill
Minimal skeleton for a new skill project structure.
Development community Third-party Notices
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THIS PRODUCT. ---
Development official Claude API
When code imports anthropic/@anthropic-ai/sdk/claude_agent_sdk, or user asks to use Claude APIBuild apps with the Claude API or Anthropic SDK
Development official Related Agents
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
Contributing to nanobot
Thank you for being here. nanobot is built with a simple belief: good tools should feel calm, clear, and humane. We care deeply about useful features, but we also believe in achieving more with less:
Key exports from each phase
for summary in .planning/phases/*/*-SUMMARY.md; do echo "=== $summary ===" grep -A 10 "Key Files\|Exports\|Provides" "$summary" 2>/dev/null done