Airbag for coding agents
Snapshots before every tool call — shell commands included — for Claude Code, Codex, Gemini CLI, Cursor, Copilot CLI, OpenHands, OpenCode, Cline and Devin. vcr undo brings it all back.
Open source · Python 3.9–3.13
Undo anything your coding agent did — even rm -rf. Record and rewind your own agents. Replay verified runs without another model call.
pip install ai-agent-vcr
Agents do more than return text.
A trace can explain the failure. Agent VCR gives you a boundary you can actually restore.
One recovery layer
Use the recorder alone, or combine it with workspace rollback, replay, and CI as your agent becomes more consequential.
Snapshots before every tool call — shell commands included — for Claude Code, Codex, Gemini CLI, Cursor, Copilot CLI, OpenHands, OpenCode, Cline and Devin. vcr undo brings it all back.
Capture every step as JSONL frames, jump to any one, fork and resume — and roll back state and files together with ACID savepoints, .env included.
Return reviewed outputs on a complete identity match, then compare candidate recordings against versioned expectations before merge.
Replay and CI guideThe hard part is the filesystem
Agent VCR creates an isolated Git branch for the transaction and pairs every savepoint with a private local-file snapshot.
.git/vcr-escrow, outside Git objects and VCR recordings..., and resolved-parent symlink escapes are rejected.from agent_vcr.integrations.openhands import ACIDWorkspace
tx = ACIDWorkspace("/repo")
tx.begin("task-42")
tx.savepoint(
{"plan": "refactor auth"},
node_name="planner",
)
# Agent edits code and local files.
tx.rollback(to_frame_index=0)
# Or accept all final work, including
# changes after the last savepoint.
tx.commit()
A tighter debugging loop
Create a portable execution artifact while the agent runs.
Return memory and workspace state to the selected boundary.
Patch the prompt, context, tool output, code, or policy.
Reuse verified work only when the full identity still matches.
Compare the candidate recording with reviewed expectations in CI.
Meet agents where they run
Start with your current framework. For custom runtimes, map lifecycle events to the recorder boundary.
Clear boundary
Agent VCR restores your project — files, .env, local SQLite and .git — and recorded agent state. It cannot undo email, payments, server-side database writes, or cloud deletions; the airbag spots those commands and makes a human confirm first.
Start local
No hosted account or model key is required for the core recorder, player, workspace rollback, or CI gate.
pip install ai-agent-vcr
vcr airbag install
python examples/basic_usage.py
vcr tui .vcr/<session-id>.vcr