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/undo-commitgit 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.00031 | $0.00708 |
| Opus 5 | $0.00015 | $0.00354 |
| Sonnet 5 | $0.00006 | $0.00142 |
| Haiku 4.5 | $0.00003 | $0.00071 |
Grade A, and why
undo-commit 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 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.
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 — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Reverses one commit without losing the work. Equivalent to git reset --soft HEAD~1 with safety guards.
Pre-flight
git rev-parse --is-inside-work-tree
If not in a git repo, stop:
not a git repo. /undo-commit requires a git repository.
Verify HEAD has a parent (can't undo the initial commit):
git rev-parse HEAD^ 2>/dev/null
If this fails: refused: HEAD is the initial commit. nothing to undo.
Verify HEAD is not a merge commit (undoing a merge is destructive in a non-obvious way — bounce to the user):
git rev-list --parents -n 1 HEAD | awk '{print NF-1}'
If output >= 2: refused: HEAD is a merge commit. use git reset --hard ORIG_HEAD manually if you understand the consequences.
Verify HEAD is not already on the remote (cannot soft-undo a published commit without rewriting public history):
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
If a tracking branch exists, check whether HEAD is reachable from upstream:
git merge-base --is-ancestor HEAD @{u}
If exit 0 (HEAD already on remote): refused: HEAD is already pushed to <upstream>. /undo-commit only undoes local commits. use git revert <sha> for a published commit.
Confirm
Show what's about to be undone:
git log -n 1 --format=' %h %s%n %an, %ar%n%n Files:%n' HEAD
git diff --stat HEAD^..HEAD
Ask via AskUserQuestion:
Undo this commit? Changes will be moved back to the staging area.
- Yes, undo
- No, keep it
On No: print kept. and stop. No action.
Action
On Yes:
git reset --soft HEAD~1
Report
Print:
undone. HEAD now at <new-sha-short>.
prior commit's changes are staged. inspect with: git status, git diff --cached
to re-commit: /commit
to discard: git restore --staged <paths> then git restore <paths>
Rules
--softonly. Never--mixed, never--hard. The user's work stays in the index where it's visible and recoverable.- Refuse on initial commit, merge commit, or pushed HEAD. These cases need human judgment.
- One commit per invocation. To undo multiple, run again — the per-invocation confirm forces deliberate steps.
- Print every git command before running it.
- Do not stage, do not commit, do not push. After
git reset --soft, control returns to the user. - This is the only command that mutates history. Treat it as destructive (axiom 3) — never act without the per-item Yes.
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 · 131 lines · 31 tokens per session scan A 1fc57693e90c
undo-commit is a command published in the GitHub repository damusix/atomic-claude (83 stars, last pushed 8d ago), licensed MIT. It adds 31 tokens to every session and 708 once invoked, about $0.0002 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 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.