cleanup-loose-branches

cleanup-loose-branches is a skill for Claude Code, Codex from peteromallet/Arnold. It costs 206 tokens per session (14,215 once invoked), scanned C, original, Apache-2.0.

A workflow for finding unfinished or uncommitted work scattered across a Git repository and its related work areas. Git is a version-control system, and worktrees, stashes, branches, and interrupted merges can each hold changes outside the current files.

In plain words
What is it for?
Use it to inspect untracked, uncommitted, and unpushed changes, branches, worktrees, stashes, detached checkouts, interrupted merges or rebases, submodules, and remote branches.
Why use it?
It reduces the risk of overlooking local edits, abandoned branches, saved changes, or incomplete repository operations before cleanup or handoff.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions subagents; mentions Codex.

Good fit Use it to inspect untracked, uncommitted, and unpushed changes, branches, worktrees, stashes, detached checkouts, interrupted merges or rebases, submodules, and remote branches.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/peteromallet/arnold/cleanup-loose-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 peteromallet/Arnold --skill cleanup-loose-branches
Clone the repo
git clone --depth 1 https://github.com/peteromallet/Arnold

Made for: Claude Code, Codex.

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 cleanup-loose-branches

README.md
[![agentmods](https://agentmods.dev/badge/skills/peteromallet/arnold/cleanup-loose-branches/github.svg)](https://agentmods.dev/skills/peteromallet/arnold/cleanup-loose-branches)
Your own site
<a href="https://agentmods.dev/skills/peteromallet/arnold/cleanup-loose-branches"><img src="https://agentmods.dev/badge/skills/peteromallet/arnold/cleanup-loose-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 cleanup-loose-branches

Your own site · 80×15
<a href="https://agentmods.dev/skills/peteromallet/arnold/cleanup-loose-branches"><img src="https://agentmods.dev/badge/skills/peteromallet/arnold/cleanup-loose-branches.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 206 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 14,215 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00206 $0.14215
Opus 5.5 $0.00082 $0.05686
Sonnet 5.5 $0.00041 $0.02843
Haiku 4.5 $0.00021 $0.01422

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

Security

Grade C, and why

cleanup-loose-branches scanned grade C 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 1mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

blast radius as `rm -rf` on a sibling variant.
arnold_pipelines/megaplan/skills/cleanup-loose-branches/SKILL.md · 862 lines

How it starts

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

cleanup-loose-branches

TL;DR — Survey every loose-work location read-only → fan out DeepSeek subagents to classify each as land / cherry-pick / delete / keep → write a consolidation plan → execute it (useful work onto a branch, everything else staged ready-to-delete). Nothing is deleted without your explicit per-item OK.

The four phases — do this, in order

Run these four phases in order. Lean on DeepSeek subagents in every phase — they are the cheap default for reading wide, understanding nuances, and untangling supersession, not a heavyweight escalation. Flip "should a subagent do this?" into "is there any reason it can't?" Start the survey immediately — don't ask "want me to look around?" or "should I make recommendations?"

  1. Survey (read-only). Sweep every place loose work hides — current working tree, worktrees, branches, stashes, remotes/PRs, interrupted ops, submodules, detached HEADs, sibling repos, other clones, the megaplan-cloud machine, codespaces. Produce the raw map. Subagents: fan the survey sections across DeepSeek agents so the main thread stays lean — one agent per area, read-only.
  2. Investigate & classify (DeepSeek fan-out → go/no-go). For every item with real ambiguity (supersession, "is this useful?", conflict surface, cloud-only work), fan out read-only DeepSeek briefs — one decision area per agent — to convert uncertainty into a verdict. Collapse the whole survey into a decisive table: land / cherry-pick / delete / keep. The goal of investigation is a go/no-go decision, not more notes. Subagents: the most subagent-heavy phase.
  3. Strategy (write the merge plan). Write a durable consolidation plan: where every valuable piece lands, the merge order, how to handle complex/overlapping merges (shared bases, divergent test contracts), and what's junk-ready vs. keep. The plan doc — not the chat — is the source of truth. Subagents: use DeepSeek to map supersession and conflict surfaces, and to draft the plan.
  4. Execute (run the merges). Work the plan, lowest blast-radius first. Land every useful piece onto the consolidation branch (merge/cherry-pick/PR until tests pass). Everything else is staged ready-to-delete — not deleted: deletion waits for explicit per-item approval. Subagents: hand the heavy merge/conflict/test loops to agents in parallel where the work is independent.

Read the full file on GitHub · 862 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. 1mo ago First seen · 862 lines · 206 tokens per session scan C 91a2f0fc7e4d

Subscribe to this mod's changes

cleanup-loose-branches is a skill published in the GitHub repository peteromallet/Arnold (98 stars, last pushed yesterday), licensed Apache-2.0. It adds 206 tokens to every session and 14,215 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.