Get the FREE Ultimate OpenClaw Setup Guide →

claude-vigil

npx machina-cli add skill Vvkmnn/claude-emporium/claude-vigil --openclaw
Files (1)
SKILL.md
2.8 KB

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

Source

git clone https://github.com/Vvkmnn/claude-emporium/blob/main/plugins/claude-vigil/skills/claude-vigil/SKILL.mdView on GitHub

Overview

Claude Vigil provides file recovery by saving checkpoints before dangerous actions and enabling safe rollback. It auto-quicksaves affected files when destructive commands are detected, and you can create or restore checkpoints manually with /save-vigil and /restore-vigil. It can coordinate with Praetorian and Historian to protect context and provide deeper rollback.

How This Skill Works

A PreToolUse(Bash) hook detects destructive commands (rm, mv, git reset, etc.) and auto-quicksaves affected files. Checkpoints are stored in a content-addressable area at .claude/vigil/ with 3 named slots plus a rotating ~quicksave. Users create or restore checkpoints using vigil_save and vigil_restore, and can preview changes with vigil_diff.

When to Use It

  • Before performing refactors that involve risky file changes (e.g., src/auth.ts, src/middleware.ts).
  • Before large deletions or moves (rm, rmdir, git clean) to enable safe rollback.
  • During scripted migrations or complex edits where rollback is preferred.
  • When you want to preview potential changes with vigil_diff before restoring.
  • When using sibling tools (Praetorian or Historian) to capture context and full state recovery.

Quick Start

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

Best Practices

  • Always run vigil_save before starting risky edits to create a named checkpoint.
  • Use vigil_diff to preview what would change before restoring.
  • Restore with vigil_restore to revert to a known good state quickly.
  • Pair vigil checkpoints with Praetorian for context-aware recovery when applicable.
  • Clean up unused checkpoints with vigil_delete to free storage and keep history tidy.

Example Use Cases

  • Checkpoint before refactor: vigil_save(name: "before-refactor", files: ["src/auth.ts", "src/middleware.ts"]).
  • Rollback after breakage: vigil_restore(name: "before-refactor").
  • Paired context: if praetorian is active, also run praetorian_compact(type: "decisions", ...) and praetorian_restore("before-refactor").
  • Context-aware recovery: use historian with find_file_context("filename") to understand what changed.
  • List and diff: vigil_list() to see checkpoints, vigil_diff(name: "checkpoint") to preview changes.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers