Varn v0.1.0 — Local State Checkpointing & Rollback
What is Varn?
Varn captures a known state of your local filesystem, lets you observe what changed, and safely restores a previous state. It is designed for AI agents and automated tools operating on a local machine, but is equally useful for humans who want to safely experiment with local changes.
An automated process changed my local environment. What exactly changed, and can I safely return to the previous state?
Commands
varn init [path] Initialize Varn in a directory
varn checkpoint <desc> Capture the current filesystem state
varn list Display available checkpoints
varn diff <checkpoint> Compare current state with a checkpoint
varn restore <checkpoint> Restore a checkpoint
varn gc Remove unreferenced objects from the store
varn migrate Migrate storage format to current version
varn --json <command> Emit machine-readable JSON output
Features
- Content-addressed storage with SHA-256 hashing and deduplication
- Symlink scanning and full restoration
- Hard link detection and restoration (Unix)
- Permission, mtime, and uid/gid restoration (Unix)
- Conflict detection with explicit confirmation
- Safety checkpoint before restore (undo a bad restore)
- Idempotent checkpointing (same state = same ID, no duplicates)
- Incremental scanning with persistent mtime/size cache
- Content streaming for large files (no full file in memory)
- Ignore patterns via
.varnignore(gitignore-style syntax) - Storage format migration framework
- Garbage collection with
--dry-run --jsonoutput for AI agent integration- Linux, macOS, and Windows support
Security
- Path traversal prevention in restore paths
- Symlink escape prevention (CVE-2026-71556 / GHSA-9qw7-j9xw-fv9c class)
- Hard link target symlink bypass prevention (CVE-2026-32232 / ZeptoClaw R3)
- Object content hash verification before writing
- Predictable temp file name mitigation (process-ID suffix)
- Scan cache integrity (versioned, advisory-only trust model)
- Pre-flight object check prevents partial restores
- Full metadata verification in post-restore check
Installation
cargo install --git https://github.com/flawme/varn.gitOr build from source — see INSTALL.md for details.
Verification
- 272 tests pass
cargo fmt --checkcleancargo clippy -- -D warningscleancargo build --releaseclean- CI passing on Linux, macOS, and Windows