Varn.
Local state checkpointing and safe rollback for AI agents and automated tools. Varn captures a known state of your local filesystem, lets you observe what changed, and safely restores a previous state.
Designed for automated coding agents, refactoring scripts, and developers who want to experiment locally without worrying about destructive filesystem changes. Operates 100% offline, coexists with Git, and exposes structured JSON output for autonomous tool loops.
“An automated process changed my local environment. What exactly changed, and can I safely return to the previous state?”
Varn is not Git.
It does not implement branches, remotes, commits, rebases, merges, or Git-compatible history. Varn complements Git — Git tracks project and source history; Varn protects local state. Coexists cleanly alongside your repositories with zero network calls and automatic gitignore guards.
varn init
varn checkpoint "before changes"
# ... local edits occur or an ai agent runs ...
varn diff <checkpoint-id>
varn restore <checkpoint-id>
# unwanted restore? undo in one command:
varn undoVarn never modifies files halfway. Every restore operation executes through a deterministic, multi-phase safety sequence with layout-aware writability probes and automatic undo guards.
Compares the target snapshot with live disk, enumerates changes, and flags conflicts.
Requires explicit interactive confirmation or the --yes flag for automated agents.
Captures a safety checkpoint, then writes contents, links, permissions, and mtimes atomically.
Re-scans disk to ensure the restored tree matches the snapshot byte-for-byte.
Initialize a .varn repository. In Git projects, automatically adds an ignore guard to keep checkpoint objects out of git stages.
varn init
varn init --gitignoreCapture the complete filesystem state. Hashes files with SHA-256, deduplicates objects, and records symlinks, hardlinks, permissions, and mtimes.
varn checkpoint "before autonomous agent execution"Display all available checkpoints with creation timestamps, commit messages, and entry counts.
varn listCompare current disk against a checkpoint, or compare two historical checkpoints directly without scanning disk.
varn diff a91f
varn diff a91f b72cRestore files to a checkpoint state through a 4-phase atomic pipeline. Automatically creates a safety checkpoint before modifying anything.
varn restore a91f
varn restore a91f --yesRevert the last restore operation. Restores the pre-restore state via its safety checkpoint, and creates a new safety checkpoint so undo can be undone.
varn undoRemove checkpoint references by ID or retention rule. Unreferenced objects can then be reclaimed with gc.
varn delete a91f
varn delete --keep-last 10 --yesGarbage-collect unreferenced content-addressed objects from .varn/store to reclaim disk space.
varn gc
varn gc --dry-runEmit structured machine-readable JSON for automated AI agents and tool scripts.
varn --json checkpoint "auto-save"
varn --json restore a91f --yes