- Home
- Skills
- Agents & Orchestration
- Agent Undo
Works with the AI Agents you already use
Agent Undo
by Lindi Sylqa
Git-backed undo and redo for AI agent turns, including shell and script changes, without touching your git history.
Free
Agent Undo
Example session with this skill installed
I messed up the last three messages. Show me what turns you recorded and then undo the very last one.
- Read your context and instructions
- Compiled the agent undo
Here's every turn I've checkpointed in this project, then the undo.
Recorded turns
$ node scripts/checkpoint.mjs list
#1 11/29/2026, 7:10:52 PM 2 files +6 -1
add a dark mode toggle to the header
src/Header.tsx, src/theme.ts
#2 11/29/2026, 7:10:58 PM 2 files +6 -1
install zod and validate the checkout form
package.json, src/checkout.ts
#3 11/29/2026, 7:11:02 PM 3 files +7 -5
refactor the header into smaller components
src/Header.tsx, src/header/Header.tsx, src/header/Logo.tsx
#4 11/29/2026, 7:11:08 PM no file changes [open]
I messed up the last three messages. Show me what turns you recorded and then undo the
very last one.
| Turn | Your message | Files changed |
|---|---|---|
| #1 | add a dark mode toggle to the header | src/Header.tsx, src/theme.ts |
| #2 | install zod and validate the checkout form | package.json, src/checkout.ts |
| #3 | refactor the header into smaller components | src/Header.tsx (deleted), |
src/header/Header.tsx, src/header/Logo.tsx (new) |
Turn #4 is this message. It hasn't changed anything, so "the very last one" is #3, the
header refactor.
What #3 changed
$ node scripts/checkpoint.mjs diff last --stat
src/Header.tsx | 5 -----
src/header/Header.tsx | 4 ++++
src/header/Logo.tsx | 3 +++
3 files changed, 7 insertions(+), 5 deletions(-)
Undo
$ node scripts/checkpoint.mjs undo last
Undid turn #3: the project is back to how it was before "refactor the header into smaller
components".
Redo with: checkpoint.mjs redo 3
Your src/ folder now:
src/Header.tsx <- back, with the dark mode toggle from #1
src/checkout.ts <- kept (turn #2)
src/theme.ts <- kept (turn #1)
src/header/ is gone, the original src/Header.tsx is back, and turns #1 and #2 are
untouched. Your branches, staged changes and commit history weren't touched. The
checkpoints live in a private git ref, not in your history.
Next steps
- Want the refactor back? Say "redo". It restores the exact state from before this
undo. - Undo #2 as well? Say "undo the zod turn". That removes
src/checkout.tsand puts
package.jsonback. Runnpm installafterwards sonode_modulesmatches again, since
ignored folders aren't restored. - Go back to the start? "Undo turn 1" rewinds all three, and that can be redone too.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop worrying about an AI agent breaking your project or losing track of manual changes. This skill provides a git-backed safety net that snapshots every file before and after each agent turn, capturing edits from shell commands, formatters, and scripts that standard edit-tool checkpoints miss. It works entirely within private git refs, ensuring your branches, staging area, and commit history remain untouched.
What it does
- Atomic Snapshots captures all tracked and untracked files before and after every message.
- Safe Reverts restores your project folder to the exact state it was in before a specific turn.
- Side-Effect Tracking logs changes made by
sed, build scripts, or code generators. - Private Indexing stores all data in
refs/checkpoints/to avoid polluting yourgit log. - Automatic Hooks integrates with Claude Code to manage checkpoints without manual commands.
How it works
- Setup runs
CP install-hooksto link the checkpoint system to your agent's lifecycle. - Monitor creates a
CP beginsnapshot at the start of a request andCP endwhen work finishes. - Inspect uses
CP listorCP diffto view turn history and specific file changes. - Restore executes
CP undoto roll back the workspace orCP redoto bring changes back.
Frameworks & tools
Built for Node.js 18+ and Git 2.23+. It includes native integration for Claude Code via .claude/settings.json and supports manual loops for Cursor, Codex, and Gemini.
Why this beats prompting it yourself
Prompting an agent to "revert" often results in messy manual deletions or broken code states. This skill uses the underlying filesystem via Git, guaranteeing a byte-for-byte restoration that includes untracked files and bypasses the agent's potential hallucinations about its previous actions.
Use cases
- Recovering from a regex command that accidentally corrupted multiple files.
- Comparing the output of two different prompts by toggling between checkpoints.
- Reverting automated formatting changes that violated project style guides.
- Creating a manual safety point before running risky shell migrations.
Known limitations
Does not track files in .gitignore or changes outside the project root. Requires an initialized git repository to function.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 5 days ago
- Free with an Agensi account
- Software
Node.js 18+
Git 2.23+
Run it inside a git repository; it can run git init for you. On Windows, install Git for Windows. Codex, Cursor and other agents without hooks run begin/end themselves. Ignored files like .env and node_modules are never snapshotted or restored.
Permissions
Shell: runs only node and git. Read/write files: restores and removes project files on undo, never files ignored by .gitignore. Snapshots go to refs/checkpoints/ and .git/checkpoints/, never your branches, staging area or history. install-hooks edits .claude/settings.json (or ~/.claude/settings.json with --user) after saving a .bak copy. No network access; reads only the CLAUDE_PROJECT_DIR environment variable.
What's inside
Creator
Lindi Sylqa
Frequently Asked Questions
New in Agents & Orchestration
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.