prune
Clean up merged and stale git branches, prune old local and remote branches safely. Use for cleaning up old branches or pruning stale remotes.
- License 许可
- MIT
- 所属仓库
- drn/dots
- 最近更新
- 2026-11-11
- Stars
- ★ 23
- Forks
- 4
01 前言 Front Matter
- name
- prune
- description
- Clean up merged and stale git branches, prune old local and remote branches safely. Use for cleaning up old branches or pruning stale remotes.
- allowed-tools
- Bash(bash ~/.claude/skills/prune/scripts/prune.sh:*), Bash(bash agents/skills/prune/scripts/prune.sh:*)
- disable-model-invocation
- true
02 资源文件 1
- 脚本scripts/prune.sh6.4 KB
03 SKILL.md 正文
Branch Cleanup
Delete merged and stale local branches safely, with preview and confirmation.
Arguments
$ARGUMENTS- Optional:--stale-days <N>to override the 30-day stale threshold,--remoteto also delete remote branches
Context
- Current branch: !
git branch --show-current - Remote: !
git remote 2>/dev/null | head -5
Instructions
Resolve the script path — use the first that exists:
~/.claude/skills/prune/scripts/prune.sh(deployed via symlink)agents/skills/prune/scripts/prune.sh(repo-relative, for development/workspaces)
Step 1: Preview branches
Run the preview command, forwarding any --stale-days argument:
bash <script-path> preview [--stale-days N]
Handle the exit code:
- Exit 0 — Present the output as a formatted table (see format below). Proceed to Step 2.
- Exit 3 — Tell the user: "All branches are current — nothing to prune." and stop.
- Exit 1 — Report the error from stderr.
Format the preview output as:
## Branch Cleanup Preview
### Merged (safe to delete)
| Branch | Last Commit | Merged Into |
|--------|------------|-------------|
| <branch> | <date> | <default> |
### Stale (no commits in N days)
| Branch | Last Commit |
|--------|------------|
| <branch> | <date> |
### Skipped
| Branch | Reason |
|--------|--------|
| <branch> | <reason> |
Step 2: Confirm and delete
Ask the user which branches to delete. Accept "all", specific branch names, or "none".
For confirmed branches, run the delete command:
bash <script-path> delete [--remote] <branch1> [branch2 ...]
Include --remote only if the user passed it in $ARGUMENTS.
Handle the exit code:
- Exit 0 — Show the output block verbatim as your final response.
- Exit 1 — Report the error from stderr.
04 同仓库更多 Skills
batch-pr-review
Review a batch of pull requests together, describe every change in plain language, and build a private Claude artifact that eases human review, with a severity-tagged and verified findings list. Use when asked to review several PRs, a stack of PRs, PRs listed in a Slack thread or message, or to summarize a batch of PRs for a reviewer.
plannotator-setup-goal
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.
plannotator-annotate
Open Plannotator's annotation UI for a markdown file, converted HTML file, URL, or folder and then respond to the returned annotations.
write-skill
Create or improve a Claude Code skill/slash command with best practices for structure, dynamic context, and safety. Use for creating new skills, improving existing ones, or learning skill authoring.
wrapup
End-of-session checklist that detects loose ends — uncommitted changes, unmerged branches, learnings to capture, handoffs needed — and routes to the right skills. Use for session closeout, wrapping up, end of day, or "anything else to capture".
tts
Read text aloud using text-to-speech. Use when the user says "speak to me", "read to me", "read this aloud", "say this", "speak the summary", or asks to hear something spoken.