oops is in beta. Report any issues on GitHub.

Ctrl+Z
for your terminal.

Every interface has undo except the terminal — where small mistakes can do real damage. oops quietly backs up risky changes and 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, git restore, rsync --delete, and more from CLI tools that run 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 copies the affected files into local trash for a reliable restore.

CommandWhat oops doesUndo
rm / rm -rfBacks up files before deletionrestore
mv a bBacks up the overwrite targetrestore b
cp a bBacks up the overwrite targetrestore b
sed -iCopies file before in-place editrestore
perl -piCopies file before in-place editrestore
git reset --hardCreates a stash before resetstash apply
git checkout / restore / switch -fCreates a stashstash apply
git branch -DLogs the branch SHArecreate
find -delete / rsync --delete / dd of=Backs up affected targetsrestore
xargs rm / fd -x rm / parallel rmBacks up the current treerestore
make clean / npm run cleanBacks up the current treerestore
git worktree removeBacks up the worktree pathrestore
> file.txtSnapshots before redirectrestore
chmod / chownRecords original permissionsrestore
git clean -fdStashes untracked filesstash apply

Install

One command. The installer downloads from GitHub Releases, verifies checksums, checks Sigstore signatures when cosign is available, adds the shell hook, lets you choose a profile with arrow keys, and runs a quick restore self-test. Open a new tab to activate.

curl -fsSL oops-cli.com/install.sh | bash
CommandDescription
oopsUndo the last destructive action
oops undo --dry-runShow what would be restored without changing files
oops restore --planShow conflicts, backup-current paths, and git actions
oops 2Undo the second-to-last action
oops statusShow current protection and trash state
oops showPreview what an undo would restore
oops diffCompare a backup with current files
oops logShow undo history
oops keepKeep a backup from auto-cleanup
oops cleanRemove old backups (--all for everything)
oops cleanup-serviceInstall or inspect hourly background cleanup
oops config preset agentApply a stricter policy preset
oops protect-pathAdd high-safety rules for important paths
oops tutorialInteractive walkthrough
oops doctorCheck installation health
oops --upgradeUpgrade to the latest version

Type oops. Get your files back.

Single Go binary, no dependencies. Local backups, verified installs, restore plans, and auto-cleanup after 2 hours.

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

Star on GitHub · Read the docs · FAQ · Guides