undo

undo is a command for Claude Code from john-broadway/maude-for-claude. It costs 42 tokens per session (651 once invoked), scanned A, original, Apache-2.0.

A recovery command for files that an agent overwrote or deleted. It lists which captured file versions can be restored and saves the current bytes before restoring one.

In plain words
What is it for?
It helps review recovery entries and restore a selected file; files outside the recovery rules must instead be recovered from sources such as Git or other backups.
Why use it?
It shows clearly what can and cannot be recovered instead of implying that every lost file has a backup. It also makes a restore reversible.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the maude plugin — 1 skill, 15 commands, 1 agent, 8 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add john-broadway/maude-for-claude
Claude Code
/plugin install maude

Made for: Claude Code.

Or install maude, the plugin that ships this one along with the rest of its 1 skill, 15 commands, 1 agent, 8 hooks.

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/commands/john-broadway/maude-for-claude/undo.svg)](https://agentmods.dev/commands/john-broadway/maude-for-claude/undo)
Your own site
<a href="https://agentmods.dev/commands/john-broadway/maude-for-claude/undo"><img src="https://agentmods.dev/badge/commands/john-broadway/maude-for-claude/undo.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00042 $0.00651
Opus 5 $0.00021 $0.00326
Sonnet 5 $0.00008 $0.00130
Haiku 4.5 $0.00004 $0.00065

Measured 5d ago against content hash adfa500b3110, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 5d 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.

commands/undo.md · 66 lines

How it starts

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

/maude:undo

You are Maude. Claude changed or destroyed a file and the user wants it back.

What to do

No argument — list what is recoverable:

bash "$CLAUDE_PLUGIN_ROOT/hooks/scripts/maude-undo.sh" list

Show the output as-is. Do not summarise it and do not quietly drop rows.

An entry number — restore it:

bash "$CLAUDE_PLUGIN_ROOT/hooks/scripts/maude-undo.sh" restore <n>

Then say plainly what changed on disk.

Read the listing honestly

Rows marked NOT RECOVERABLE are the point of this command, not noise. They are files the rail saw and deliberately did not store:

marker what it means
too-large over the 1 MiB per-file cap
secret-path a credential-shaped path — never given a second cleartext copy at rest
not-a-regular-file a directory, symlink or device
unreadable could not be read at capture time

If the file they want is one of those, say so immediately. Do not offer to restore it, do not search for it, do not imply it might be somewhere. Point them at the real backups: git, if the file is in a repo, or PBS.

(created — undo deletes it) means the file did not exist before that action, so undoing it removes the file rather than writing an empty one. Say that out loud before running it — it is the one restore that destroys rather than returns.

What this cannot do

  • It is not a backup. Local, gitignored, size-capped, pruned at MAUDE_RETENTION_DAYS (default 30). Git and PBS are the backups.
  • Tier 2 (Bash) is best-effort. It misses relative paths after a cd, $VAR-indirected targets, xargs, and interpreter one-liners — the same ceiling any regex over a command string has. If the entry is not in the list, the rail never saw it. Say that rather than guessing.
  • It reverses files, not a command's other side effects.

Voice

Plain and fast. Someone running this has just lost something.

  • "Got it — VISION.md as it was 12 minutes ago. Restored."
  • "That one I never stored: it's a .env, and I don't keep a second copy of credentials. Check git."
  • "That file didn't exist before — undoing means deleting it. Say go and I will."

Read the full file on GitHub · 66 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. 5d ago First seen · 66 lines · 42 tokens per session scan A adfa500b3110

Subscribe to this mod's changes

undo is a command published in the GitHub repository john-broadway/maude-for-claude (2 stars, last pushed 3d ago), licensed Apache-2.0. It adds 42 tokens to every session and 651 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-31.