Open source ยท MIT ยท Linux, macOS, Windows

Undo anything your coding agent did.

Even rm -rf. Agent VCR snapshots your project before every tool call your agent makes, shell commands included, so vcr undo brings back your files, your .env and your git history.

No API key, no account. Nothing leaves your machine.

~/code
$ vcr airbag install claude
  โœ“ Claude Code  ~/.claude/settings.json

# the agent "cleans up" and runs rm -rf ~/code/myapp
๐Ÿ›Ÿ Agent VCR airbag: snapshot #1 saved before
   `rm -rf ~/code/myapp`. Undo with `vcr undo`.

$ vcr undo --project-dir ~/code/myapp
โ†ฉ Undid: rm -rf ~/code/myapp  (claude, 12s ago)
  restored 4 files โ€” back to snapshot #1.
    + .env
    + .gitignore
    + src/billing.py
    + .git/
  Changed your mind? `vcr redo`

Quickstart

Install, arm, undo.

Python 3.9โ€“3.13. The airbag needs git on your PATH.

  1. Install

    The package is ai-agent-vcr. The similarly named agent-vcr is a different project.

    pipx install ai-agent-vcr
  2. Arm your agents

    Once, anywhere. It hooks every supported agent on your PATH, for every git project, and writes nothing into your repositories.

    vcr airbag install
  3. Undo

    Back to just before the agent's last change. vcr redo if you change your mind.

    vcr undo
  4. Rewind

    Every snapshot on a timeline. vcr rewind 12 restores snapshot #12.

    vcr rewind

No agent handy? examples/airbag_demo.sh wipes a throwaway project and brings it back.

How it works

A save point before every tool call.

Built-in agent checkpoints only track the agent's own file-edit tools. The airbag also sees the shell.

  1. 01 ยท Snapshot

    Before the agent acts

    A hook snapshots tracked, untracked and small ignored files like .env and SQLite databases into a private git store outside the project. Your own .git is never written.

    vcr airbag status
  2. 02 ยท Undo

    Go back, or forward

    Undo the last action or the last few, jump to any snapshot, and redo if you went too far. Undo and rewind are undoable themselves.

    vcr undo 3 --dry-run
  3. 03 ยท Bisect

    Find what broke the tests

    Binary-search the snapshots in temporary checkouts and get the exact command that turned the tests red. Your project is never touched.

    vcr bisect -- pytest -q

What a snapshot can't undo (remote databases, cloud resources, pushed commits, published packages, anything outside the project) is stopped so a human decides first. Check any command with vcr airbag check "terraform destroy".

Supported agents

Works with the agent you already use.

One install command per agent. Irreversible commands are stopped in whatever way that agent supports.

  • Claude Codevcr airbag install claudeIrreversible: asks you
  • OpenAI Codex CLIvcr airbag install codexIrreversible: blocked until vcr airbag allow
  • Gemini CLIvcr airbag install geminiIrreversible: asks you (0.36+)
  • Cursor (IDE + CLI)vcr airbag install cursorIrreversible: blocked until vcr airbag allow
  • GitHub Copilot CLIvcr airbag install copilotIrreversible: asks you
  • OpenHandsvcr airbag install openhandsIrreversible: blocked, or asks with confirm=True
  • OpenCode 1.xvcr airbag install opencodeIrreversible: blocked until vcr airbag allow
  • Clinevcr airbag install clineIrreversible: task stopped
  • Devin Localvcr airbag install devinIrreversible: blocked until vcr airbag allow
  • Anything elsevcr airbag run -- aiderA snapshot every 2 s, no interception

Per-agent setup and gotchas โ†’

Everything else is in the docs.

Install options, every command, and what each feature can't do.

Read the docs โ†’