Show HN: Do-over, undo for AI agent shell commands
doover is a transaction log for AI agent shell commands that provides true undo capability for destructive operations, filling a critical gap left by existing safety mechanisms It works by snapshotting files before agent commands execute via Claude Code's PreToolUse/PostToolUse hooks, with minimal overhead of just a few milliseconds per command Unlike git or sandboxes, doover protects untracked files, ignored files (.env, local databases), and directories outside version control that other tools
Analysis
TL;DR
- doover is a transaction log for AI agent shell commands that provides true undo capability for destructive operations, filling a critical gap left by existing safety mechanisms
- It works by snapshotting files before agent commands execute via Claude Code's PreToolUse/PostToolUse hooks, with minimal overhead of just a few milliseconds per command
- Unlike git or sandboxes, doover protects untracked files, ignored files (.env, local databases), and directories outside version control that other tools cannot recover
- The tool is open-source, written in Rust, supports macOS/Linux/WSL, and provides commands for log, undo, redo, diff, status, garbage collection, and pinning of actions
- Undo operations are conflict-checked, idempotent, append-only, and themselves journaled—ensuring history is never silently rewritten
Why It Matters
AI coding agents increasingly execute shell commands autonomously, but destructive operations like rm -rf have historically been irreversible, creating significant risk for production workflows. doover addresses this by providing a safety net that doesn't block agent capabilities but makes dangerous commands reversible, which is essential for anyone deploying autonomous agents in real development environments.
Technical Details
- Architecture: doover integrates with Claude Code through PreToolUse and PostToolUse hooks, automatically snapshotting files before destructive commands execute and logging a transaction journal
- Snapshot strategy: Whole-tree snapshots intelligently skip build directories (target/, node_modules/, .venv/) only when git already ignores them, avoiding wasted time budget on recreatable artifacts while still capturing source files
- Undo mechanics: Undo is conflict-checked (refuses with exit code 3 if files changed after the target action), idempotent (double-undo is a no-op), and trusts the disk over its own records; undoing an undo enables redo via append-only journaling
- Implementation: Written in Rust (requires 1.85+), installable via Cargo (
--lockedfor audited dependencies), Homebrew, or prebuilt binaries with SHA256 verification; stores snapshots in~/.doover - Scope: Handles files outside the project directory and untracked/ignored files that git cannot protect, including cases where the agent itself runs
git checkout .orgit clean -fdto destroy uncommitted work
Industry Insight
- The rise of autonomous coding agents demands reversible shell execution as a baseline safety feature; doover's approach of non-blocking interception rather than permission-gating represents a pragmatic model for agent safety tooling that preserves productivity while reducing risk
- As AI agents gain broader access to system operations, transaction-log-style safeguards like doover will likely become standard infrastructure, similar to how database transaction logs became essential for data integrity
- Developers should adopt doover or equivalent tools immediately when working with agents on projects containing untracked sensitive data (local databases, .env files, test data), since existing safeguards like sandboxes and git checkpoints leave critical gaps in protection
Disclaimer: The above content is generated by AI and is for reference only.