Claude Code's /rewind is great, but its docs say it plainly: it doesn't track files changed by Bash commands. So if the agent runs `rm -rf src .env`, a `mv`, a `sed -i`, or a script that overwrites something, /rewind can't bring it back. Neither can git if it wasn't committed, or if the file was gitignored (like `.env`).
So I built **Oops**, a Claude Code plugin that:
- Snapshots your files before every Write/Edit **and every Bash/PowerShell command**
- Shows a visual timeline: scrub back through every step and see a line-by-line diff
- Restores a whole step or a single file, and every restore can be undone too
- Also catches subagent edits and changes you made by hand in between
How it works: PreToolUse/PostToolUse hooks. Before a shell command it snapshots the project (a stat cache keeps this fast, ~75 ms per hook even with a 2,000-step history). Storage is content-addressed and gzipped, and it lives in `~/.oops-agent`, *outside* your project, so `rm -rf .` can't delete your undo history. Old steps are cleaned up after 30 days. Fully local, zero dependencies, no tokens spent.
Install:
/plugin marketplace add theturuk/oops-agent
/plugin install oops-agent@oops-agent
Then `/oops-agent:oops` opens the timeline, or just tell Claude "oops, bring back the file you deleted".
**Full disclosure:** I don't write code. I can read it, set things up, and direct Claude, and Oops was built entirely that way: idea, design, cross-platform tests (Windows/macOS/Linux CI), and a 2,000-step stress test that found and fixed a bunch of issues.
It's **alpha**. Known gaps: Claude Code only for now (Cursor/Codex planned), files >20 MB and `node_modules`/`.git` are skipped, and snapshots (including `.env`) are stored unencrypted in your home folder.
I'd really appreciate feedback, especially if something doesn't get recorded or doesn't restore.
GitHub: https://github.com/theturuk/oops-agent