Ctrl+Z
for your terminal.
Every interface has undo except the terminal — where you can do the most damage. oops fixes that. Also catches destructive commands from AI agents like Claude Code and Cursor.
"Sweet! I could have used this years ago!" — David S.
macOS and Linux · zsh, bash, fish · zero overhead for safe commands, ~10ms for destructive ones
A safety net for AI agents
Works with CLI-based agents that run commands in your terminal — Claude Code, Cursor, Aider, and similar tools.
Run oops agent-mode on to intercept destructive commands at the PATH level. This catches rm, git reset --hard, mv, and more from any CLI tool that runs shell commands — even in non-interactive shells. If an agent deletes something it shouldn't have, type oops and it's back.
Note: agent mode works with tools that run commands through your system shell (Claude Code, Cursor, Aider, etc). Sandboxed environments like Claude Desktop run in isolation and can't be intercepted.
# 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}
What it catches
A shell hook intercepts destructive commands before they run and backs up the affected files using hard links — instant, no extra disk space.
| Command | What oops does | Undo |
|---|---|---|
| rm / rm -rf | Backs up files before deletion | restore |
| mv a b | Backs up the overwrite target | restore b |
| sed -i | Copies file before in-place edit | 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 | recreate |
| > file.txt | Snapshots before redirect | restore |
| chmod / chown | Records original permissions | restore |
| git clean -fd | Stashes untracked files | stash apply |
Install
One command. The installer handles the binary, shell hook, and backup directory. Open a new tab to activate.
| Command | Description |
|---|---|
| oops | Undo the last destructive action |
| oops 2 | Undo the second-to-last action |
| oops log | Show undo history |
| oops clean | Remove old backups (--all for everything) |
| oops tutorial | Interactive walkthrough |
| oops doctor | Check installation health |
| oops --upgrade | Upgrade to the latest version |
Type oops. Get your files back.
Single Go binary, no dependencies. Backups use hard links (instant, zero extra disk). Auto-cleanup after 7 days.