cd /news/ai-agents/claude-code-s-checkpoints-don-t-cove… · home › topics › ai-agents › article
[ARTICLE · art-180069] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Claude Code's checkpoints don't cover shell commands. So I built undo for them

A developer built undoagent, an MIT-licensed CLI and Claude Code plugin that snapshots a project before and after each agent prompt, so file changes made by shell commands — rm -rf, sed -i, codegen scripts and formatters — can be listed, diffed, undone or rewound. The tool fills a gap in Claude Code's built-in checkpoints, which only track edits made through its file tools. It stores snapshots in ~/.undoagent, never reads or writes the project's own .git, respects .gitignore, skips node_modules and has zero npm dependencies.

key takeaway

Claude Code's checkpoints miss files changed by shell commands, so undoagent snapshots the project before and after each prompt and lets you undo, redo or rewind any single turn without touching your .git.

by read2 min views17 publishedDec 2, 2026

AI coding agents are fast. They're also fast at breaking things.

Claude Code has checkpoints, and they're great for edits made through its file tools. But they don't track files changed by shell commands. When the agent runs rm -rf, a sed -i, a codegen script or a formatter, those changes are outside what rewind can bring back.

So I built undoagent: a small CLI that turns every prompt into a checkpoint, whatever the agent used to change your files.

I asked Claude Code to "remove the notes folder using rm -rf and convert app.js to ES modules". It did exactly that. Then:

$ undoagent list
   1  17:44          4   Clean up this project: remove the notes folder using rm -rf…

$ undoagent diff --stat
 app.js             | 2 +-
 notes/decisions.md | 1 -
 notes/todo.md      | 2 --
 package.json       | 3 +++

$ undoagent undo
✓ Undid #1: Clean up this project: remove the notes folder using rm -rf…
    ~ app.js
    + notes/decisions.md
    + notes/todo.md
    - package.json

The deleted folder is back, app.js is restored, and the package.json the agent added is gone.

undoagent undo 3 reverts only turn 3.undoagent rewind 3.

you submit a prompt  →  snapshot A
the agent works      →  edits, shell commands, scripts…
the agent finishes   →  snapshot B
                         one turn = the difference between A and B

~/.undoagent, pointed at your project folder. Your own .git is never read or written, and it works in folders that aren't git repos at all.--force..gitignore, skips node_modules, and has zero npm dependencies. Everything stays local. Inside Claude Code, as a plugin:

/plugin install undoagent --marketplace Ahmed-Manai/undoagent

That adds /undoagent:list, /undoagent:undo, /undoagent:redo, /undoagent:diff and /undoagent:rewind.

Or from a terminal:

npm install -g undoagent
cd your-project
undoagent init

Then use Claude Code (or Codex, or Gemini CLI) as usual, and run undoagent list whenever you want to see or undo what it did.

The code is MIT-licensed on GitHub. Issues and ideas are very welcome.

Has an AI agent ever destroyed work you couldn't get back? What happened, and what would have saved you? I'd love to hear the stories in the comments, because they shape what undoagent handles next.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-s-checkp…] indexed:0 read:2min 2026-12-02 · —