بنقرة واحدة
pcl
Delete stale git branches (local + remote) that have no open PR, and prune worktrees.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Delete stale git branches (local + remote) that have no open PR, and prune worktrees.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
SPA (Spawn's Personal Agent) — Slack bot that pipes threads into Claude Code sessions
Create child cloud VMs with AI coding agents using the spawn CLI
Update agent team services with latest configuration from setup-agent-team and restart them
| name | pcl |
| description | Delete stale git branches (local + remote) that have no open PR, and prune worktrees. |
| argument-hint | [--dry-run] |
| allowed-tools | Bash |
Delete local and remote git branches that no longer have an open PR, and prune stale worktrees.
--dry-run — List what would be deleted without actually deleting anything.$ARGUMENTS
Switch to main and update to latest:
git checkout main
git pull --rebase origin main
Critical: This ensures we're not on a branch that's about to be deleted, and that we're working from the latest main.
git fetch --prune origin
List all remote branches except main and HEAD:
git branch -r --format='%(refname:short) %(committerdate:relative)' | grep -v 'origin/main\|origin/HEAD\|^origin '
gh pr list --repo OpenRouterLabs/spawn --state open --json headRefName --jq '.[].headRefName'
Any branch with an open PR MUST be skipped. Never delete a branch that has an open PR.
For each remote branch that is NOT in the open PR list:
git push origin --delete BRANCH_NAME
If --dry-run was passed, print [dry-run] would delete origin/BRANCH_NAME instead.
List local branches (excluding the current branch and main):
git branch --list | grep -v '^\*' | grep -v '^ *main$' | tr -d ' '
For each, check if it's already merged into main or has no remote:
git branch -d BRANCH_NAME 2>/dev/null || git branch -D BRANCH_NAME
If --dry-run, print [dry-run] would delete local BRANCH_NAME instead.
git worktree prune
Remove any leftover worktree directories:
rm -rf /tmp/spawn-worktrees 2>/dev/null || true
Ensure we're on main branch:
git branch --show-current
Should output: main
Print a summary: