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 commands/damusix/atomic-claude/git-cleanupgit clone --depth 1 https://github.com/damusix/atomic-claudeWhat 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 | $0.00063 | $0.02719 |
| Opus 5 | $0.00032 | $0.01359 |
| Sonnet 5 | $0.00013 | $0.00544 |
| Haiku 4.5 | $0.00006 | $0.00272 |
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 2d 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 — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You orchestrate git cleanup. A generic subagent runs atomic prompt git-cleanup (read-only scan). You present the report. The user picks. You execute.
Pre-flight
- Verify inside a git repo:
git rev-parse --is-inside-work-tree. If not: refuse withnot in a git repo.and stop. - Determine base branch (used by scout):
BASE=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null \ || git config init.defaultBranch \ || echo main) - Determine the orchestrator's current worktree path:
git rev-parse --show-toplevel. Scout must skip this from candidates.
Step 1 — Resolve staleness threshold
Default: 30 days.
Check user memory for an override. The auto-memory system 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 that as a feedback-type memory before continuing. Future runs pick it up automatically.
Step 2 — Determine scope
If $ARGUMENTS is non-empty: target = .claude/worktrees/<$ARGUMENTS>/ (the specific worktree). Branch + worktree inspected together. Skip step 3 (single-target runs don't need the remote question).
If $ARGUMENTS is empty: target = all. Continue to step 3.
Step 3 — Ask about remote scope
Prompt via AskUserQuestion:
Question: Include remote branches in the staleness scan?
Options:
- Local only (recommended) — scan .claude/worktrees/* and local branches
- Local + remote — also fetch and flag stale remote branches (no remote deletion)
Default to local-only if the user is ambiguous.
Step 4 — Dispatch read-only scan subagent
Dispatch a generic subagent via the Agent tool (omit subagent_type or use general-purpose).
Prompt the subagent with:
Run `atomic prompt git-cleanup` and follow the brief it prints exactly.
Scan params for this run:
staleness_days: <N>
target: all | .claude/worktrees/<name>/
include_remote: true | false
base_branch: <base>
current_worktree_path: <absolute path>
Apply these params as the brief's staleness/scope/base-branch settings.
Return the full indexed candidate table (worktree candidates + branch candidates
+ summary). Do not execute any git mutations — scan only.
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.
- 2d 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 (83 stars, last pushed 8d ago), licensed MIT. It adds 63 tokens to every session and 2,719 once invoked, about $0.0003 per session on Opus 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.
Other commands, from other repositories
icpg-bootstrap
Infer ReasonNodes from existing git commit history. One-time setup for existing codebases.
version
Display current guide and Claude Code versions.
go-review
Go code review for idiomatic patterns.
execute
Executa o plano aprovado em .first-plan/07-state/plans/. Segue o plano à risca, para se algo invalidar premissa, gera relatório ao final.
dispatcher
Pick the next-best repo to work on across the portfolio — rank free repos, recommend one, claim its lease atomically, and route to the entry command.
docs-review
Phase 4 of documenting-projects: Quality gate with 8 measurable criteria and iteration. Triggers: '/docs-review', invoked by documenting-projects orchestrator.