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.
$ 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.
-
Install
The package is
ai-agent-vcr. The similarly namedagent-vcris a different project.pipx install ai-agent-vcr -
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 -
Undo
Back to just before the agent's last change.
vcr redoif you change your mind.vcr undo -
Rewind
Every snapshot on a timeline.
vcr rewind 12restores 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.
-
01 ยท Snapshot
Before the agent acts
A hook snapshots tracked, untracked and small ignored files like
.envand SQLite databases into a private git store outside the project. Your own.gitis never written.vcr airbag status -
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 -
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 Code
vcr airbag install claudeIrreversible: asks you - OpenAI Codex CLI
vcr airbag install codexIrreversible: blocked untilvcr airbag allow - Gemini CLI
vcr airbag install geminiIrreversible: asks you (0.36+) - Cursor (IDE + CLI)
vcr airbag install cursorIrreversible: blocked untilvcr airbag allow - GitHub Copilot CLI
vcr airbag install copilotIrreversible: asks you - OpenHands
vcr airbag install openhandsIrreversible: blocked, or asks withconfirm=True - OpenCode 1.x
vcr airbag install opencodeIrreversible: blocked untilvcr airbag allow - Cline
vcr airbag install clineIrreversible: task stopped - Devin Local
vcr airbag install devinIrreversible: blocked untilvcr airbag allow - Anything else
vcr airbag run -- aiderA snapshot every 2 s, no interception
More than an undo button
The rest of the toolkit.
For coding agents, and for the agents you build yourself.
Local Postgres rewind
Name a local dev database and destructive SQL gets a pg_dump first. vcr undo restores the rows with the files.
MCP server
vcr mcp gives any MCP agent the airbag as tools: check a command before running it, take a snapshot, preview an undo.
Recording and Ghost Replay
Record every step of your agent to a JSONL file. Jump to any frame, fork, resume, and replay a verified run with zero model calls.
Docs โpytest plugin
Record an agent run the first time a test runs, replay it after that. The test fails on behavior, cost, token or latency regressions.
Docs โAgent CI
Pin reviewed runs as test cases and fail a pull request when the agent drifts. Offline, with a GitHub Action included.
Docs โACID workspace
Transactions for your own agent: savepoint, rollback, commit. Files on disk and agent state roll back together.
Docs โSentinel
An AST guard for agent-written Python: syntax errors, oversized functions, and the same function pasted into two files.
Docs โDashboard
A terminal debugger, a local web UI with a live feed and token sign-in, and a self-hosted store for your team.
Docs โIntegrations
LangGraph, CrewAI, the OpenHands SDK, Claude Code session recording, or a few recorder calls in plain Python.
Docs โEverything else is in the docs.
Install options, every command, and what each feature can't do.