{"slug": "claude-code-s-checkpoints-don-t-cover-shell-commands-so-i-built-undo-for-them", "title": "Claude Code's checkpoints don't cover shell commands. So I built undo for them", "summary": "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.", "body_md": "AI coding agents are fast. They're also fast at breaking things.\n\nClaude 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.\n\nSo I built **undoagent**: a small CLI that turns every prompt into a checkpoint, whatever the agent used to change your files.\n\nI asked Claude Code to \"remove the notes folder using rm -rf and convert app.js to ES modules\". It did exactly that. Then:\n\n``` bash\n$ undoagent list\n   #  time         files  what\n   1  17:44          4   Clean up this project: remove the notes folder using rm -rf…\n\n$ undoagent diff --stat\n app.js             | 2 +-\n notes/decisions.md | 1 -\n notes/todo.md      | 2 --\n package.json       | 3 +++\n\n$ undoagent undo\n✓ Undid #1: Clean up this project: remove the notes folder using rm -rf…\n    ~ app.js\n    + notes/decisions.md\n    + notes/todo.md\n    - package.json\n```\n\nThe deleted folder is back, `app.js` is restored, and the `package.json` the agent added is gone.\n\n`undoagent undo 3` reverts only turn 3.`undoagent rewind 3`.\n\n```\nyou submit a prompt  →  snapshot A\nthe agent works      →  edits, shell commands, scripts…\nthe agent finishes   →  snapshot B\n                         one turn = the difference between A and B\n```\n\n`~/.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.\nInside Claude Code, as a plugin:\n\n```\n/plugin install undoagent --marketplace Ahmed-Manai/undoagent\n```\n\nThat adds `/undoagent:list`, `/undoagent:undo`, `/undoagent:redo`, `/undoagent:diff` and `/undoagent:rewind`.\n\nOr from a terminal:\n\n```\nnpm install -g undoagent\ncd your-project\nundoagent init\n```\n\nThen use Claude Code (or Codex, or Gemini CLI) as usual, and run `undoagent list` whenever you want to see or undo what it did.\n\nThe code is MIT-licensed on [GitHub](https://github.com/Ahmed-Manai/undoagent). Issues and ideas are very welcome.\n\n**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.", "url": "https://wpnews.pro/news/claude-code-s-checkpoints-don-t-cover-shell-commands-so-i-built-undo-for-them", "canonical_source": "https://dev.to/ahmed_manai/claude-codes-checkpoints-dont-cover-shell-commands-so-i-built-undo-for-them-2p13", "published_at": "2026-12-02 09:08:09+00:00", "updated_at": "2026-12-02 09:16:23.840261+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Claude Code", "undoagent", "Ahmed-Manai", "GitHub", "Codex", "Gemini CLI", "Anthropic"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/claude-code-s-checkpoints-don-t-cover-shell-commands-so-i-built-undo-for-them", "markdown": "https://wpnews.pro/news/claude-code-s-checkpoints-don-t-cover-shell-commands-so-i-built-undo-for-them.md", "text": "https://wpnews.pro/news/claude-code-s-checkpoints-don-t-cover-shell-commands-so-i-built-undo-for-them.txt", "jsonld": "https://wpnews.pro/news/claude-code-s-checkpoints-don-t-cover-shell-commands-so-i-built-undo-for-them.jsonld"}}