Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/RedHatProductSecurity/prodsec-skillsnpx agentmods add skills/redhatproductsecurity/prodsec-skills/git-cleanupWrote 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/redhatproductsecurity/prodsec-skills/git-cleanup)<a href="https://agentmods.dev/skills/redhatproductsecurity/prodsec-skills/git-cleanup"><img src="https://agentmods.dev/badge/skills/redhatproductsecurity/prodsec-skills/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.
<a href="https://agentmods.dev/skills/redhatproductsecurity/prodsec-skills/git-cleanup"><img src="https://agentmods.dev/badge/skills/redhatproductsecurity/prodsec-skills/git-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00042 | $0.03061 |
| Opus 5.5 | $0.00017 | $0.01224 |
| Sonnet 5.5 | $0.00008 | $0.00612 |
| Haiku 4.5 | $0.00004 | $0.00306 |
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 2mo 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- git-cleanup — 97% identical, 17 lines differ
How it starts
The opening of the file, as written. The whole thing — 364 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Cleanup
Safely clean up accumulated git worktrees and local branches by categorizing them into: safely deletable (merged), potentially related (similar themes), and active work (keep).
When to Use
- When the user has accumulated many local branches and worktrees
- When branches have been merged but not cleaned up locally
- When remote branches have been deleted but local tracking branches remain
When NOT to Use
- Do not use for remote branch management (this is local cleanup only)
- Do not use for repository maintenance tasks like gc or prune
- Not designed for headless or non-interactive automation (requires user confirmations at two gates)
Core Principle: SAFETY FIRST
Never delete anything without explicit user confirmation. This skill uses a gated workflow where users must approve each step before any destructive action.
Critical Implementation Notes
Squash-Merged Branches Require Force Delete
IMPORTANT: git branch -d will ALWAYS fail for squash-merged branches because git cannot detect that the work was incorporated. This is expected behavior, not an error.
When you identify a branch as squash-merged:
- Plan to use
git branch -D(force delete) from the start - Do NOT try
git branch -dfirst and then ask again for-D- this wastes user confirmations - In the confirmation step, show
git branch -Dfor squash-merged branches
Group Related Branches BEFORE Categorization
MANDATORY: Before categorizing individual branches, group them by name prefix:
# Extract common prefixes from branch names
# e.g., feature/auth-*, feature/api-*, fix/login-*
Branches sharing a prefix (e.g., feature/api, feature/api-v2, feature/api-refactor) are almost certainly related iterations. Analyze them as a group:
- Find the oldest and newest by commit date
- Check if newer branches contain commits from older ones
- Check which PRs merged work from each
- Determine if older branches are superseded
Present related branches together with a clear recommendation, not scattered across categories.
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.
- 2mo ago First seen · 364 lines · 42 tokens per session scan A 48808cb18f13
git-cleanup is a skill published in the GitHub repository RedHatProductSecurity/prodsec-skills (207 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 42 tokens to every session and 3,061 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-09-03.
git-cleanup compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git-cleanupRedHatProductSecurity/prodsec-skills | Skill | 207 | 4mo ago | Apache-2.0 | A | 42 | Claude Code |
| create-prprisma/orm | Skill | 48k | today | Apache-2.0 | A | 47 | Claude Code, Codex |
| git-commitThinkInAIXYZ/deepchat | Skill | 6.4k | today | Apache-2.0 | A | 15 | Claude Code, Codex |
| engineer-bot-opsmakecindy/cindy | Skill | 11k | today | Apache-2.0 | A | 57 | Claude Code, Codex |
| mcore-split-prNVIDIA/skills | Skill | 4.2k | today | Apache-2.0 | A | 25 | Claude Code |
| contributingHugoRCD/evlog | Skill | 2.0k | yesterday | MIT | A | 68 | Claude Code, Codex |
| git-commit-writermergisi/awesome-openclaw-agents | Skill | 4.1k | 26d ago | MIT | A | 53 | Claude Code, Codex |