cleaning-up-branches

cleaning-up-branches is a skill for Claude Code from joaquimscosta/arkhe-claude-plugins. It costs 61 tokens per session (2,766 once invoked), scanned A, original, MIT.

A Git branch cleanup workflow that removes merged local branches and, when requested, remote branches. It reports inactive branches separately instead of deleting them automatically.

In plain words
What is it for?
Use it to delete merged branches, inspect old inactive branches, include remote branches, or preview cleanup with a dry run.
Why use it?
It reduces clutter from branches that are no longer needed while avoiding accidental deletion of unmerged work. A preview mode and confirmation are available before destructive actions.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: model in frontmatter; positional $N argument.

Good fit Use it to delete merged branches, inspect old inactive branches, include remote branches, or preview cleanup with a dry run.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add joaquimscosta/arkhe-claude-plugins --skill cleaning-up-branches
Clone the repo
git clone --depth 1 https://github.com/joaquimscosta/arkhe-claude-plugins

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleaning-up-branches

README.md
[![agentmods](https://agentmods.dev/badge/skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches/github.svg)](https://agentmods.dev/skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches)
Your own site
<a href="https://agentmods.dev/skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches"><img src="https://agentmods.dev/badge/skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cleaning-up-branches

Your own site · 80×15
<a href="https://agentmods.dev/skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches"><img src="https://agentmods.dev/badge/skills/joaquimscosta/arkhe-claude-plugins/cleaning-up-branches.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,766 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00061 $0.02766
Opus 5.5 $0.00024 $0.01106
Sonnet 5.5 $0.00012 $0.00553
Haiku 4.5 $0.00006 $0.00277

Measured today against content hash 088c98811e37, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cleaning-up-branches scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/git/skills/cleaning-up-branches/SKILL.md · 292 lines

How it starts

The opening of the file, as written. The whole thing — 292 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Branch Cleanup

Delete merged branches (local and optionally remote) with explicit user confirmation, and flag stale unmerged branches for manual review.

Auto-Invoke Triggers

This skill activates when:

  1. Keywords: "cleanup branches", "delete merged branches", "prune old branches", "remove stale branches", "branch cleanup", "remove dead branches"
  2. Command: /cleanup-branches

Arguments

  • --base <branch> — Base branch for merge check (default: main)
  • --threshold <months> — Inactivity threshold for stale detection (default: 3)
  • --remote — Include remote branch deletion
  • --dry-run — Show what would be deleted without acting

Safety Model

  • Merged branches: Deletable after explicit user confirmation
  • Unmerged branches: Never auto-deleted — reported with manual commands only
  • Dry-run: Available via --dry-run flag to preview actions
  • Confirmation: Before each destructive step, list branches and ask the user

Workflow

Execute each step below using the Bash tool.

Step 1: Validate Git Repository

git rev-parse --is-inside-work-tree 2>/dev/null || echo "NOT_A_GIT_REPO"

If not a git repo, stop and inform the user.

Step 2: Parse Arguments

Parse $ARGUMENTS for:

  • --base BRANCH → set BASE_BRANCH=BRANCH (default: main)
  • --threshold N → set THRESHOLD_MONTHS=N (default: 3)
  • --remote → set INCLUDE_REMOTE=true (default: false)
  • --dry-run → set DRY_RUN=true (default: false)

Verify the base branch exists:

git rev-parse --verify "$BASE_BRANCH" 2>/dev/null || echo "BASE_BRANCH_NOT_FOUND"

If the base branch doesn't exist, try master as fallback. If neither exists, stop and inform the user.

Step 3: Fetch Latest Remote State

if ! git fetch --prune 2>/dev/null; then
  echo "Warning: Could not reach remote. Remote branch data may be stale."
fi

Step 4: Display Branch Status Summary

current_branch=$(git branch --show-current)
total_local=$(git branch | wc -l | tr -d ' ')
total_remote=$(git branch -r | grep -v HEAD | wc -l | tr -d ' ')
remote=$(git config --get "branch.$BASE_BRANCH.remote" 2>/dev/null || echo "origin")
merged_local=$(git branch --merged "$BASE_BRANCH" | grep -v "^\*" | grep -vw "$BASE_BRANCH" | wc -l | tr -d ' ')
merged_remote=$(git branch -r --merged "$remote/$BASE_BRANCH" | grep -v "$remote/$BASE_BRANCH" | grep -v "$remote/HEAD" | wc -l | tr -d ' ')

echo "=== BRANCH STATUS ==="
echo "Current branch: $current_branch"
echo "Base branch: $BASE_BRANCH"
echo "Local branches: $total_local ($merged_local merged into $BASE_BRANCH)"
echo "Remote branches: $total_remote ($merged_remote merged into $BASE_BRANCH)"

Read the full file on GitHub · 292 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 292 lines · 61 tokens per session scan A 088c98811e37

Subscribe to this mod's changes

cleaning-up-branches is a skill published in the GitHub repository joaquimscosta/arkhe-claude-plugins (21 stars, last pushed today), licensed MIT. It adds 61 tokens to every session and 2,766 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-16.