undo

undo is a skill for Claude Code, Codex from samibs/skillfoundry. It costs 8 tokens per session (2,812 once invoked), scanned A, original, MIT.

A safe undo manager that uses Git, a version-control system, to identify, preview, and revert recent changes made by an agent.

In plain words
What is it for?
It is for listing recent undoable actions, previewing rollbacks, reverting one or more actions, returning to a commit, and redoing an undone change.
Why use it?
It reduces the risk of undoing the wrong work by showing what will change and checking that the rollback can be reversed without introducing regressions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit It is for listing recent undoable actions, previewing rollbacks, reverting one or more actions, returning to a commit, and redoing an undone change.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samibs/skillfoundry/undo
Install

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.

Any agent
npx skills add samibs/skillfoundry --skill undo
Clone the repo
git clone --depth 1 https://github.com/samibs/skillfoundry

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for undo

README.md
[![agentmods](https://agentmods.dev/badge/skills/samibs/skillfoundry/undo.svg)](https://agentmods.dev/skills/samibs/skillfoundry/undo)
Your own site
<a href="https://agentmods.dev/skills/samibs/skillfoundry/undo"><img src="https://agentmods.dev/badge/skills/samibs/skillfoundry/undo.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,812 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00008 $0.02812
Opus 5 $0.00004 $0.01406
Sonnet 5 $0.00002 $0.00562
Haiku 4.5 $0.00001 $0.00281

Measured 3d ago against content hash ba600389ea5d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

undo 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 3d 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.

.agents/skills/undo/SKILL.md · 401 lines

How it starts

The opening of the file, as written. The whole thing — 401 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/undo - Safe Undo Manager

You are the Undo Manager. You identify, preview, and safely revert recent agent actions using git-based rollback. You never undo blindly -- you always show what will change, verify reversibility, and confirm no regressions are introduced afterward.

Persona: See agents/_rollback-protocol.md for rollback safety protocol. Reflection Protocol: See agents/_reflection-protocol.md for reflection requirements.


OPERATING MODE

/undo                       Undo the last reversible agent action
/undo --list                List last 10 undoable actions with status
/undo --dry-run             Preview what would be undone (no mutations)
/undo --steps=N             Undo last N actions (multi-step)
/undo --to=COMMIT           Undo back to specific commit
/undo --redo                Redo the last undone action
/undo --force               Skip confirmation (use with caution)

PHASE 1: IDENTIFY WHAT TO UNDO

1.1 Analyze Recent Actions

GATHER recent changes:
  1. git log --oneline -10      -- Last 10 commits
  2. git diff HEAD~1 --stat     -- Files changed in last commit
  3. git stash list              -- Any stashed changes
  4. .claude/state.json          -- Framework execution state
  5. logs/remediations.md        -- Recent auto-fixes

1.2 Undo Safety Matrix

Not everything can be safely undone. Classify each action:

Action Type Reversible? Method Risk Level
File creation YES git rm or delete LOW
File modification YES git restore from commit LOW
File deletion YES (if in git) git restore from history LOW
Git commit YES git revert (creates inverse commit) LOW
Multiple commits YES git revert each in reverse order MEDIUM
Database migration (up) PARTIAL Run rollback migration if exists MEDIUM
Database migration (down) NO Destructive -- data may be lost HIGH
Package install YES Remove from manifest, reinstall LOW
Package removal YES Re-add to manifest, reinstall LOW
External API call NO Cannot un-send a request CRITICAL
Published package NO Cannot unpublish (usually) CRITICAL
Deployed code NO Requires separate rollback process CRITICAL
Deleted branch PARTIAL git reflog recovery MEDIUM
Cleared state file PARTIAL May exist in backups MEDIUM

Read the full file on GitHub · 401 lines

Changes

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.

  1. 3d ago First seen · 401 lines · 8 tokens per session scan A ba600389ea5d

Subscribe to this mod's changes

undo is a skill published in the GitHub repository samibs/skillfoundry (12 stars, last pushed 2d ago), licensed MIT. It adds 8 tokens to every session and 2,812 once invoked, about $0.0000 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-09-03.

Related

Other skills, from other repositories

release-notes

Generate release notes from git history and CHANGELOG. Formats for GitHub Release, Slack, or email. Use before tagging a release.

srnichols/plan-forge · 31 tokens

gentle-ai-collab-perfect

Trigger: contributing to Gentleman-Programming/gentle-ai as an external collaborator. Strict issue-first workflow, honest PR bodies, contributor-vs-maintainer scope, chained-PR strategy, verification protocol, docstring coverage. Load whenever the active repo is Gentleman-Programming/gentle-ai and any part of the…

Gentleman-Programming/gentle-ai · 106 tokens

branch-pr

Create Gentle AI pull requests with issue-first checks. Trigger: creating, opening, or preparing PRs for review.

Gentleman-Programming/gentle-ai · 26 tokens

work-unit-commits

Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.

Gentleman-Programming/gentle-ai · 33 tokens

ring:opening-pull-requests

Open a GitHub Pull Request with automatic base branch detection, scope allowlist enforcement, PR template filling, and post-create base verification. Replaces ring:generating-pr-descriptions. Use after pushing a branch when ready to open a PR. Skip if the branch is not yet pushed or there are uncommitted changes …

LerianStudio/ring · 83 tokens

ring:generating-release-guides

Generating an internal Operations-facing update/migration guide from the git diff between two refs, documenting per-change client impact, deploy ordering, monitoring, and rollback notes in English, pt-br, or both. Use when preparing a version release or recording what changed for the Ops team. Runs read-only by…

LerianStudio/ring · 85 tokens