Every interface has undo except the terminal — where you can do the most damage. oops fixes that.
The installer handles everything — downloads the binary, adds the shell hook, and sets up the backup directory. Just answer y/n.
~ $ rm -rf src/ ▲ rm -r ~/project/src ~ $ oops ✓ Undid: rm -r ~/project/src ↩ restored ~/project/src
oops intercepts destructive commands before they run and silently backs up the affected files. Non-destructive commands pass through with zero overhead.
| Command | What oops does | Undo |
|---|---|---|
| rm / rm -rf | Copies files to trash before deletion | restore |
| mv a b | Backs up the overwrite target | restore b |
| > file.txt | Snapshots file before redirect overwrites it | restore |
| sed -i | Copies file before in-place edit | restore |
| chmod / chown | Records original permissions | restore |
| git reset --hard | Creates a stash before reset | stash apply |
| git checkout . | Creates a stash | stash apply |
| git branch -D | Logs the branch SHA before deletion | recreate |
| git clean -fd | Stashes untracked files | stash apply |
Claude Code, Cursor, Aider, Codex — any tool that runs shell commands in your terminal goes through the same hook.
AI coding agents are getting more autonomy. They run rm, git reset --hard, and mv on your behalf — and sometimes they get it wrong. oops catches these the same way it catches your commands. If an agent deletes something it shouldn't have, type oops and it's back.
# AI agent runs a destructive command ~ $ git reset --hard HEAD~3 ▲ git reset --hard # you notice it wiped your uncommitted work ~ $ oops ✓ Undid: git reset --hard Applied stash: stash@{0}
One command. The installer handles the binary, shell hook, and backup directory.
| Command | Description |
|---|---|
| oops | Undo the last destructive action |
| oops 2 | Undo the second-to-last action |
| oops log | Show undo history |
| oops size | Show backup disk usage |
| oops clean | Remove old backups (--all for everything) |
| oops config | View or change settings |
| oops doctor | Check installation health |
| oops uninstall | Remove oops from your system |
Single binary, written in Go, no dependencies. ~10ms backup overhead. Auto-cleanup after 7 days. Read the docs.