File checkpoint and recovery - save snapshots, diff changes, restore safely

version
1.0.0
GitHub stars
80

Install

/plugin install claude-vigil@claude-emporium

Run it inside Claude Code after adding the marketplace with /plugin marketplace add Vvkmnn/claude-emporium.

Contents

Discovered from source

Skills 1

Vigil Plugin

File recovery. Saves checkpoints before dangerous operations, diffs changes, restores files safely.

Hooks

HookWhenAction
PreToolUse(Bash)Destructive command detectedAuto-quicksaves affected files (rm, mv, git reset, etc.)

Token cost: 0 on safe commands, ~30-50 on destructive. The regex matches: rm, rmdir, mv, sed -i, perl -i, git checkout/reset/clean/restore, output redirects.

Commands

CommandDescription
/save-vigil <name> [files]Create a named file checkpoint
/restore-vigil [name]Restore files from a checkpoint

Workflows

Checkpoint (standalone)

  1. vigil_save(name: "before-refactor", files: ["src/auth.ts", "src/middleware.ts"])
  2. Make changes safely
  3. If something breaks: vigil_restore(name: "before-refactor")

Checkpoint (with siblings)

  1. vigil_save(name: "before-refactor", files: [...])
  2. If praetorian active: also praetorian_compact(type: "decisions", ...) to save the reasoning
  3. Make changes — both files and context are now protected
  4. If something breaks:
    • vigil_restore(name: "before-refactor") — restore files
    • praetorian_restore("before-refactor") — restore context

Recovery (standalone)

  1. vigil_list() — see available checkpoints
  2. vigil_diff(name: "checkpoint") — preview what would change
  3. vigil_restore(name: "checkpoint") — restore files
  4. Optionally: vigil_delete(name: "checkpoint") — clean up

Recovery (with siblings)

  1. vigil_list() — see available checkpoints
  2. vigil_diff(name: "checkpoint") — preview changes
  3. If historian active: find_file_context("filename") to understand what changed and why
  4. vigil_restore(name: "checkpoint") — restore files
  5. If praetorian active: restore matching compaction for context

Sibling Synergy

SiblingValueHow
PraetorianContext saved alongside filesPair vigil checkpoints with praetorian compactions for full state recovery
HistorianFile change context from historyfind_file_context() explains what happened between checkpoint and now

MCP Tools Reference

ToolPurpose
vigil_saveCreate named checkpoint (SHA-256 + gzip dedup)
vigil_listList available checkpoints with metadata
vigil_diffPreview changes since checkpoint
vigil_restoreRestore files from checkpoint
vigil_deleteRemove a checkpoint and free storage

Storage

Content-addressable at .claude/vigil/. 3 named slots + 1 rotating ~quicksave.

Requires

claude mcp add vigil -- npx claude-vigil-mcp

Commands 2

/restore-vigil

Restore files from a previously saved checkpoint.

Usage

  • /restore-vigil - List available checkpoints
  • /restore-vigil auth-refactor - Restore specific checkpoint

Action

  1. Call vigil_list() to show available checkpoints
  2. Optionally call vigil_diff(name: "<name>") to preview changes
  3. Call vigil_restore(name: "<name>") to restore

Example

> vigil_list()
Checkpoints:
  1. "before-auth-rewrite" (2 files, 3m ago)
  2. "~quicksave" (1 file, 30s ago)

> vigil_diff(name: "before-auth-rewrite")
src/auth/handler.ts: 12 lines changed

> vigil_restore(name: "before-auth-rewrite")
Restored 2 files from "before-auth-rewrite"

/save-vigil

Create a named checkpoint of files for later recovery.

Usage

  • /save-vigil auth-refactor - Save with a name
  • /save-vigil pre-migration src/db/** - Save specific files

Action

Call vigil_save(name: "<name>", files: [<paths>]) with:

  • name: Descriptive checkpoint name
  • files: Array of file paths to snapshot (defaults to recently modified files)

Slots

3 named slots + 1 rotating ~quicksave (auto-managed by hooks). Named saves persist until explicitly deleted.

Example

vigil_save(
  name: "before-auth-rewrite",
  files: ["src/auth/handler.ts", "src/middleware/session.ts"]
)

Hooks 1

MCP servers 1

Sponsors

Details

Marketplace
Vvkmnn/claude-emporium
Source
plugins/claude-vigil
Author
vvkmnn
Category
Productivity

More from Vvkmnn/claude-emporium

All 6