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.
npx agentmods add skills/alexei-led/cc-thingz/cleanup-gitnpx skills add alexei-led/cc-thingz --skill cleanup-gitgit clone --depth 1 https://github.com/alexei-led/cc-thingzWrote 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.
[](https://agentmods.dev/skills/alexei-led/cc-thingz/cleanup-git)<a href="https://agentmods.dev/skills/alexei-led/cc-thingz/cleanup-git"><img src="https://agentmods.dev/badge/skills/alexei-led/cc-thingz/cleanup-git.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00070 | $0.00832 |
| Opus 5 | $0.00035 | $0.00416 |
| Sonnet 5 | $0.00014 | $0.00166 |
| Haiku 4.5 | $0.00007 | $0.00083 |
Grade A, and why
cleanup-git 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cleanup Git
Clean local git branches and worktrees after work has merged. Dry-run first. Destructive commands require user approval.
Prefer a repo-local scripts/cleanup-git.sh when the target repo ships one. If it does not, use the bundled skill script from this skill's scripts/ directory. Do not improvise destructive cleanup commands outside the script workflow.
Command
Run from anywhere inside a repository:
scripts/cleanup-git.sh
scripts/cleanup-git.sh --apply
scripts/cleanup-git.sh --apply --force
scripts/cleanup-git.sh --base <ref>
Branch Detection
The script fetches/prunes remotes, then chooses the comparison branch:
- Remote default branch from
refs/remotes/<remote>/HEAD. - Local
main,master,trunk,develop, ordev. - Remote
<remote>/{main,master,trunk,develop,dev}.
Use --base <ref> only for unusual repositories.
What It Removes
- Worktrees whose branch has a GitHub PR in
MERGEDstate, is merged into the detected base branch, or whose upstream is gone. - Local branches with the same criteria.
When gh is available, PR MERGED state is the source of truth for squash/rebase merges. Do not miss those just because git merge-base --is-ancestor fails after history rewrite. If no PR is found, or gh is unavailable, fall back to the git-based checks.
Guards
Hard guards:
- Skip the current worktree.
- Skip the current branch.
- Skip the detected base branch and common long-lived branches:
main,master,trunk,develop,dev. - Keep worktrees with uncommitted changes.
Soft guard:
- Keep items with commits ahead of the base branch.
--forceoverrides only this guard. - For merged PRs, treat only commits added after the PR head as "ahead". A squash/rebase-merged branch with no new local commits is still removable.
Workflow
- Run
scripts/cleanup-git.shand show the preview. - Read reasons literally:
remove ... (PR merged),remove ... (upstream gone),KEEP ... (dirty),KEEP ... (PR merged, N ahead — use --force). - Surface every
KEEPline as a human decision. - Ask before running
scripts/cleanup-git.sh --apply. - Use
--forceonly when the user confirms ahead commits are throwaway.
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.
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.
- 6d ago First seen · 94 lines · 70 tokens per session scan A 703b8e34acc5
cleanup-git is a skill published in the GitHub repository alexei-led/cc-thingz (35 stars, last pushed 1mo ago), licensed MIT. It adds 70 tokens to every session and 832 once invoked, about $0.0003 per session on Opus 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-30.
Other skills, from other repositories
peekaboo
Provides runtime observation and interaction for native macOS interfaces through accessibility state and screenshots. Use when the task depends on visible or interactive state in a running SwiftUI/AppKit app: what is rendered, focused, selected, enabled, reachable through menus/windows/dialogs, or experienced across a…
mobile-flows-maestro
This skill should be used when Maestro is explicitly requested or already present and the task is to author, run, or debug iOS/Android Maestro flows; use Maestro MCP; or handle Maestro selectors, system UI, permissions, Keychain, JavaScript, waits, device state, flakiness, or CI. Evidence includes a .maestro directory…
validate-mobile
Run a Maestro flow on an explicitly selected iOS or Android device and report behavioral evidence.
validate-api
Run the project's Hurl scenarios with an OIDC access token passed as a secret variable.
backend-architecture
This skill should be used for consequential backend architecture decisions: module or service boundaries; modular monoliths versus independent services; service extraction and data migration; data ownership and consistency; synchronous, event-driven, actor/stateful, or pipeline designs; failure isolation…
esp32-expert
This skill should be used for ESP32-specific hardware and runtime work in ESP-IDF, Arduino-ESP32, or PlatformIO projects: target/build detection, FreeRTOS tasks and ISRs, memory/DMA, peripherals, power, networking/security, OTA, crash diagnosis, and unattended reliability. Trigger on "debug this ESP32 crash", "review…