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.00000 | $0.02719 |
| Opus 5.5 | $0.00000 | $0.01088 |
| Sonnet 5.5 | $0.00000 | $0.00544 |
| Haiku 4.5 | $0.00000 | $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 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.
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.
- 1mo 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 (112 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,719 tokens. 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
autocommit
Toggle auto git commits on/off for this project. Run without args to see status, or with "on"/"off" to set.
worktree
Create a git worktree for isolated feature/fix work.
pull-repos
Pull all repos (parent + marketplace clones + configured project repos).
auto-claude
Invoke Auto-Claude autonomous coding framework for complex feature implementation.
branch
Show Claude Code costs per git branch / PR.
address-pr-feedback
Systematically address PR review comments. Fetches all threads, categorizes by status (acknowledged, silently fixed, unaddressed), and guides user through posting replies and implementing fixes with explicit approval.