/rootiest-ai-all:prune-itfrom rootiest-ai-all
Syncs the default branch and deletes local and remote branches that are already merged or whose remote branch is gone.
Ships in rootiest-ai-all. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Phase 5 of /ship-it. Also runs on its own.
Projects can spell out how this step runs for them. Unless /ship-it already handed you this
step's section, look for the project's ship-it instructions and use the first file that exists:
AGENTS_ship-it.md in the repo rootAGENTS/AGENTS_ship-it.mddocs/ship-it.mdRead only the ## prune-it section. Where it conflicts with the defaults in this skill, the
section wins; anything it leaves out falls back to the defaults. No file, or no ## prune-it
section, means use the defaults. Say in your report which file and section you used, or that
there were none.
Sweep up after merged work: fetch and prune the remote, fast-forward the default branch, and delete every local and remote branch whose content is already in the default branch, plus local branches whose remote branch was deleted. All of the logic lives in a bundled bash script, so the result is the same whatever shell or config the user runs.
Activate this skill when one of the following is met:
/ship-it:prune-it or /prune-it.git-clean (the Rootiest fish function this skill replaces), or to clean
up, prune, tidy, or sweep up branches, e.g. "delete merged branches", "clean up stale
branches", "get rid of old branches", "tidy up the repo after the merge"./ship-it reaches Phase 5.git clean: "git-clean" here means branch cleanup. NEVER run the built-in git clean,
which deletes untracked files in the working tree.git branch -d loops. It detects
merge-commit, fast-forward, rebase, and squash merges; plain git branch --merged misses the
last two.--force only on request: pass it only when the user explicitly asks to delete branches
that have unmerged commits. Otherwise report the kept branches and stop.git and bash.
Nothing else is required for local cleanup. To delete remote branches, the script must list open PRs, and it tries every way it knows until one works. It needs none of them in particular:
gh, gt (the Gitea CLI), or glab.curl with a token from the environment, sent only to the host the token belongs to:
GH_TOKEN/GITHUB_TOKEN/GITHUB_PERSONAL_ACCESS_TOKEN (github.com),
GITEA_TOKEN/GITEA_ACCESS_TOKEN/FORGEJO_TOKEN (the host in GITEA_HOST/GITEA_URL),
GITLAB_TOKEN/GITLAB_PRIVATE_TOKEN (GITLAB_HOST, else gitlab.com).curl, which works for public repositories.The forge is guessed from the host only to order the attempts, so self-hosted Gitea, Forgejo,
GitLab, and GitHub Enterprise work without configuration. Responses are parsed with jq, or
python3 when jq is missing. If nothing works, the script skips remote deletion and still
cleans local branches. Never print or echo a token yourself.
The same checks back the git-sweep fish function in Rootiest's fish-config, so this skill
and that function delete exactly the same branches.
| Branch | Result |
|---|---|
Local branch merged into <remote>/<default> (any merge strategy) | Deleted |
| Local branch whose remote branch is gone, content merged | Deleted |
| Local branch whose remote branch is gone, unmerged commits | Kept; deleted with --force |
Remote branch merged into <remote>/<default>, no open PR | Deleted |
| Remote branch that is the head of an open PR, and local branches tracking it | Kept |
| Any branch with unmerged commits whose remote branch still exists | Kept |
Default branch; main, master, develop, dev, trunk, staging, production, gh-pages, release/*; --keep names | Kept |
| Local branch checked out in another worktree | Kept |
| Local branch created but never committed to (no upstream) | Kept |
If the current branch is to be deleted, the script switches to the default branch first. If tracked files have uncommitted changes, it keeps the branch and doesn't switch.
| User says | Flag |
|---|---|
| "keep X", "don't delete X" | --keep X (repeatable) |
| "local only", "don't touch the remote" | --local-only |
| "force", "delete unmerged gone branches too" | --force |
A remote other than origin | --remote NAME |
The script is scripts/prune-it.sh in this skill's directory (the directory holding this
SKILL.md). Use its absolute path; it is not on PATH. Run it from inside the target repository.
bash "<skill-dir>/scripts/prune-it.sh" --dry-run [flags]
delete and keep lines. If it printed Nothing to delete., report that
and stop./ship-it invoked this skill, or the user asked
for the cleanup outright, continue without asking. Otherwise ask for confirmation first,
since remote deletions affect everyone using the repository.
bash "<skill-dir>/scripts/prune-it.sh" [flags]
| Exit | Meaning | Action |
|---|---|---|
| 0 | Cleanup complete | Report |
| 1 | A deletion failed (e.g. branch protection on the remote) | Report which, and the git error |
| 2 | Not a repo, unknown option, or no default branch | Report the error, stop |
| If the fetch fails, the script warns, skips remote deletion, and still cleans local branches | ||
| against the last fetched state. Say so in the report. |
Deleted branch <name> (was <sha>) lines, so the user can restore a local branch with
git branch <name> <sha>.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub rootiest/rootiest-ai --plugin rootiest-ai-all2 plugins in one repository ship this exact skill · first indexed Nov 15, 2026
12 skills in this plugin
/date-timeRetrieves the exact current date and time for time-sensitive queries, scheduling, duration calculations, and validating chronological context./delegate-agyDelegates a subtask to the Antigravity CLI (agy) when the user wants a second opinion, external grounded research, or needs a large multi-file audit (>500 lines) processed without bloating the current context./deploy-itDeploys what is on the default branch using the project's own deploy steps, with user approval unless the project's rules allow deploying without it, then verifies the deploy. Reports cleanly when there is nothing to deploy.