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.
git clone --depth 1 https://github.com/damusix/atomic-claudeWrote 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/commands/damusix/atomic-claude/git-cleanup)<a href="https://agentmods.dev/commands/damusix/atomic-claude/git-cleanup"><img src="https://agentmods.dev/badge/commands/damusix/atomic-claude/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/commands/damusix/atomic-claude/git-cleanup"><img src="https://agentmods.dev/badge/commands/damusix/atomic-claude/git-cleanup.svg" alt="Reviewed on agentmods" width="80" 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.00063 | $0.02776 |
| Opus 5.5 | $0.00025 | $0.01110 |
| Sonnet 5.5 | $0.00013 | $0.00555 |
| Haiku 4.5 | $0.00006 | $0.00278 |
Grade C, and why
git-cleanup 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 12d 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.
printf '%s\n' "$live" | grep -qx "$name" || rm -rf "$dir" How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You orchestrate git cleanup. The harness's default general agent runs atomic prompt git-cleanup (read-only scan). You present the report. The user picks. You execute.
Pre-flight
Outside a git repo the command refuses; inside one it records the two values the scout needs.
flowchart TD
G{"Inside a git repo?"} -->|no| X["Refuse"]
G -->|yes| B["Resolve base"]
B --> W["Record current<br/>worktree"]
-
Inside a git repo?:
git rev-parse --is-inside-work-tree. No:not in a git repo. -
Resolve base: used by the scout: {{ template "base-resolution" . }}
-
Record current worktree:
git rev-parse --show-toplevel. The scout must skip it from candidates.
Step 1 — Resolve staleness threshold
Default: 30 days.
Check user memory for an override. The harness's memory mechanism stores user preferences. Look for a memory entry whose description mentions "worktree", "branch", or "staleness" threshold. If found and it specifies a different value, use it. Otherwise, use 30.
If during execution the user says something like "remember N days as my staleness threshold" or "I prefer N days", save it to memory before continuing. Future runs pick it up automatically.
Step 2 — Determine scope
If arguments are given, target = the worktree that git worktree list --porcelain reports for branch $ARGUMENTS (branch + worktree inspected together; the branch alone when it has none) and skip to Step 4; otherwise target = all and continue to Step 3. Worktrees are enumerated with git worktree list, never a path glob, because their location depends on the resolved worktrees preference.
Step 3 — Ask about remote scope
Ask the user:
Question: Include remote branches in the staleness scan?
Options:
- Local only (recommended) — scan every worktree git worktree list reports, and local branches
- Local + remote — also fetch and flag stale remote branches (no remote deletion)
Default to local-only if the user is ambiguous.
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.
- 12d ago Changed · -1 lines · +63 tokens per session 3756ee995a01
- 3mo ago First seen · 241 lines · 0 tokens per session scan C 9152680fdfe3
git-cleanup is a command published in the GitHub repository damusix/atomic-claude (117 stars, last pushed 2d ago), licensed MIT. It adds 63 tokens to every session and 2,776 once invoked, about $0.0003 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-08-30.
git-cleanup compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git-cleanupdamusix/atomic-claude | Command | 117 | 2d ago | MIT | C | 63 | Claude Code |
| worktreeFlorianBruniaux/claude-code-ultimate-guide | Command | 7.6k | yesterday | CC-BY-SA-4.0 | A | 11 | Claude Code |
| agentloop-audit-queryalibaba/loongsuite-pilot | Command | 271 | yesterday | Apache-2.0 | A | 20 | Claude Code |
| pull-repostravisjneuman/.claude | Command | 115 | 2d ago | MIT | A | 13 | Claude Code |
| auto-claudetravisjneuman/.claude | Command | 115 | 2d ago | MIT | A | 10 | Claude Code |
| address-pr-feedbackaxiomantic/spellbook | Command | 13 | 6d ago | MIT | A | 43 | Claude Code |
| advanced-code-review-contextaxiomantic/spellbook | Command | 13 | 6d ago | MIT | A | 19 | Claude Code |