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.

Terminal demo: deleting a file with rm and restoring it with oops

"Sweet! I could have used this years ago!" — David S.

$ curl -fsSL oops-cli.com/install.sh | bash

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.

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.

CommandWhat oops doesUndo
rm / rm -rfBacks up files before deletionrestore
mv a bBacks up the overwrite targetrestore b
sed -iCopies file before in-place editrestore
git reset --hardCreates a stash before resetstash apply
git checkout .Creates a stashstash apply
git branch -DLogs the branch SHArecreate
> file.txtSnapshots before redirectrestore
chmod / chownRecords original permissionsrestore
git clean -fdStashes untracked filesstash apply

Install

One command. The installer handles the binary, shell hook, and backup directory. Open a new tab to activate.

curl -fsSL oops-cli.com/install.sh | bash
CommandDescription
oopsUndo the last destructive action
oops 2Undo the second-to-last action
oops logShow undo history
oops cleanRemove old backups (--all for everything)
oops tutorialInteractive walkthrough
oops doctorCheck installation health
oops --upgradeUpgrade 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.

$ curl -fsSL oops-cli.com/install.sh | bash

Star on GitHub · Read the docs · FAQ