git-cleanup

git-cleanup is a skill for Claude Code from ao92265/claude-code-playbook. It costs 72 tokens per session (556 once invoked), scanned A, original, MIT.

A guided process for finding stale or already-merged Git branches and outdated remote references. Git branches are separate lines of code history used for development work.

In plain words
What is it for?
Use it to inspect merged branches, find branches inactive for 90 days, preview cleanup candidates, and remove confirmed local branches or stale remote references.
Why use it?
It helps tidy a repository while identifying unmerged work and requesting confirmation before anything is deleted.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the playbook plugin — 82 skills, 4 commands, 9 agents, 4 hooks shipped together

Good fit Use it to inspect merged branches, find branches inactive for 90 days, preview cleanup candidates, and remove confirmed local branches or stale remote references.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ao92265/claude-code-playbook/git-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 ao92265/claude-code-playbook --skill git-cleanup
Clone the repo
git clone --depth 1 https://github.com/ao92265/claude-code-playbook

Made for: Claude Code.

Or install playbook, the plugin that ships this one along with the rest of its 82 skills, 4 commands, 9 agents, 4 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/ao92265/claude-code-playbook/git-cleanup/github.svg)](https://agentmods.dev/skills/ao92265/claude-code-playbook/git-cleanup)
Your own site
<a href="https://agentmods.dev/skills/ao92265/claude-code-playbook/git-cleanup"><img src="https://agentmods.dev/badge/skills/ao92265/claude-code-playbook/git-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 git-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/ao92265/claude-code-playbook/git-cleanup"><img src="https://agentmods.dev/badge/skills/ao92265/claude-code-playbook/git-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 556 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.00072 $0.00556
Opus 5.5 $0.00029 $0.00222
Sonnet 5.5 $0.00014 $0.00111
Haiku 4.5 $0.00007 $0.00056

Measured 3mo ago against content hash dffca669311f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-cleanup 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 3mo 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.

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.

skills/git-cleanup/SKILL.md · 61 lines

What it actually says

Git Cleanup

Tidy up your git repository by removing stale branches and pruning remotes.

Steps

  1. Survey current state:

    • git branch -a — list all local and remote branches
    • git remote prune origin --dry-run — show stale remote references
    • Count: local branches, remote branches, stale references
  2. Identify merged branches:

    • git branch --merged main — local branches already merged into main
    • Exclude: main, master, develop, and the current branch
    • List candidates for deletion with their last commit date
  3. Identify stale branches:

    • Find branches with no commits in the last 90 days
    • Show the last commit message and author for each
    • Mark as "safe to delete" or "review needed"
  4. Show the plan:

    • List branches to delete (merged + stale)
    • List branches to keep (unmerged with recent activity)
    • List branches that need human review
    • ASK the user for confirmation before deleting anything
  5. Execute cleanup (with permission):

    • Delete confirmed local branches: git branch -d <branch>
    • Prune stale remote references: git remote prune origin
    • Only use -D (force delete) if the user explicitly approves for unmerged branches
  6. Post-cleanup report:

    • Branches deleted: X local, Y remote references pruned
    • Branches kept: Z
    • Disk space recovered (if significant): git gc --aggressive suggestion

Important

  • NEVER delete unmerged branches without explicit user approval.
  • NEVER force-delete (-D) without confirmation — unmerged work could be lost.
  • Don't touch main, master, or develop branches.
  • Show what will be deleted before doing it — cleanup is easier to review than to undo.
  • Remote branch deletion requires extra confirmation — git push origin --delete affects others.
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. 3mo ago First seen · 61 lines · 72 tokens per session scan A dffca669311f

Subscribe to this mod's changes

git-cleanup is a skill published in the GitHub repository ao92265/claude-code-playbook (13 stars, last pushed 18d ago), licensed MIT. It adds 72 tokens to every session and 556 once invoked, about $0.0003 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-08-31.

Related

git-cleanup compared with skills from other repositories

git-cleanup next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-cleanupao92265/claude-code-playbookSkill1318d agoMITA72Claude Code
github-actions-expertroedyrustam/vibes-plugSkill1322d agoMITA35Cursor
launchsimota/agent-skillsSkill107todayMITA40Claude Code, Codex
monorepo-architectroedyrustam/vibes-plugSkill1322d agoMITA42Cursor
gearsimota/agent-skillsSkill107todayMITA32Claude Code, Codex
guardiansimota/agent-skillsSkill107todayMITA62Claude Code, Codex
trailsimota/agent-skillsSkill107todayMITA33Claude Code, Codex