branch-cleanup

branch-cleanup is a skill for Claude Code from strikersam/autonomous-ai-agency. It costs 53 tokens per session (1,232 once invoked), scanned A, original, MIT.

A Git workflow skill that removes local and remote branches after their changes have been merged into the master branch. It also handles repositories where normal remote branch deletion is blocked.

In plain words
What is it for?
Use it after merges or releases to inspect branches, identify unmerged work, and delete merged local and remote branches while preserving protected branches.
Why use it?
It keeps a repository focused on active branches and reduces stale branch clutter after merges. It checks whether branches are fully merged before removing them.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Good fit Use it after merges or releases to inspect branches, identify unmerged work, and delete merged local and remote branches while preserving protected branches.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/strikersam/autonomous-ai-agency/branch-cleanup
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 strikersam/autonomous-ai-agency --skill branch-cleanup
Clone the repo
git clone --depth 1 https://github.com/strikersam/autonomous-ai-agency

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 branch-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/branch-cleanup/github.svg)](https://agentmods.dev/skills/strikersam/autonomous-ai-agency/branch-cleanup)
Your own site
<a href="https://agentmods.dev/skills/strikersam/autonomous-ai-agency/branch-cleanup"><img src="https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/branch-cleanup/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 branch-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/strikersam/autonomous-ai-agency/branch-cleanup"><img src="https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/branch-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 107
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 121
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 172
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00053 $0.01232
Opus 5 $0.00026 $0.00616
Sonnet 5 $0.00011 $0.00246
Haiku 4.5 $0.00005 $0.00123

Measured 9d ago against content hash 088b1413eb32, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

branch-cleanup scanned grade A with 1 finding 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 9d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "%{http_code}" -X DELETE \
.claude/skills/branch-cleanup/SKILL.md · 189 lines

How it starts

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

Skill: branch-cleanup

When to Use

Run this skill:

  • After merging any feature/fix branch into master
  • After a release, when multiple branches have been absorbed
  • Any time git branch -a shows branches beyond master and gh-pages

Protected branches — never delete:

  • master
  • gh-pages (GitHub Pages deployment)

Step 1 — Confirm master is up to date

git fetch origin
git status

Make sure you are on master and Your branch is up to date with 'origin/master'. If not, push first before touching branches.


Step 2 — List all remote branches

git branch -r | grep -v 'origin/master\|origin/gh-pages\|origin/HEAD'

For each branch listed, check whether it is fully merged:

git log origin/master..origin/<branch-name> --oneline
  • Empty output → fully merged, safe to delete.
  • Commits listed → unmerged work; merge it into master first (see Step 3), then return here.

Step 3 — Merge any unmerged branches (if needed)

For each branch with unmerged commits:

git merge --no-ff origin/<branch-name> -m "Merge branch '<branch-name>'"

Resolve any conflicts (keep HEAD for code files; merge both sides for docs/changelog.md). Run tests before committing the merge:

pytest -x -q

Then push:

git push origin master

Step 4 — Delete merged branches

Option A — git push (standard)

git push origin --delete <branch-name>

Repeat for every merged branch. If this returns 204 or succeeds, you are done.

Option B — GitHub API (use when git push --delete returns 403)

This happens when the git remote is proxied and lacks delete-refs permission. Requires a GitHub PAT with repo scope (or delete_head_branch permission).

curl -s -o /dev/null -w "%{http_code}" -X DELETE \
  -H "Authorization: token <GITHUB_PAT>" \
  -H "Accept: application/vnd.github+json" \
  "https://api.github.com/repos/<owner>/<repo>/git/refs/heads/<branch-name>"

Read the full file on GitHub · 189 lines

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. 9d ago First seen · 189 lines · 53 tokens per session scan A 088b1413eb32

Subscribe to this mod's changes

branch-cleanup is a skill published in the GitHub repository strikersam/autonomous-ai-agency (8 stars, last pushed today), licensed MIT. It adds 53 tokens to every session and 1,232 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.