Skip to content
/

claude-snapshot

claude-snapshot · adhenawer/claude-snapshot · ★ 2 · last commit 2026-04-19

Primitive shape 4 total
Commands 4
00

Summary

claude-snapshot — Summary

claude-snapshot is a Claude Code plugin that exports the complete ~/.claude/ setup (settings, CLAUDE.md files, plugins, hooks, MCP server configs, marketplace registrations) as a portable .tar.gz archive and applies it to another machine in under 2 minutes. It solves three concrete problems: multi-machine sync (personal ↔ work), OS reinstall recovery (backup before format), and team onboarding (share a snapshot with new team members). The plugin ships 4 Claude Code slash commands (/snapshot:export, /snapshot:inspect, /snapshot:diff, /snapshot:apply) backed by a Node.js core script (src/snapshot.mjs) that handles all file operations. Design principles are explicitly numbered (P1–P5): Minimal Blast Radius (no daemon, no background watch), Allowlist Over Denylist (explicit artifact list rather than wholesale capture), No Network Ever (local-only), Diff Before Destroy (preview before apply with .bak backup), and Cross-Platform First-Class (Node.js rather than bash). An npx -y claude-snapshot path allows use without plugin installation. Among seeds, there is no direct parallel — claude-snapshot is not a workflow methodology but a machine migration utility for Claude Code's configuration layer, most similar to agent-os in that it manages the ~/.claude/ directory, but unlike agent-os it manages existing configurations rather than authoring new conventions.

01

Overview

claude-snapshot — Overview

Origin

Created by Rodolfo Moraes (adhenawer on GitHub). Published as a Claude Code plugin at version 0.3.0.

Philosophy

The README explicitly documents five design principles:

[P1] Minimal Blast Radius: one-shot commands, no daemon, no background watch, no network. Every side effect is triggered by an explicit user command and scoped to ~/.claude/ plus the output tarball path.

[P2] Allowlist Over Denylist: snapshots contain an explicit list of artifacts (settings, CLAUDE.md, hooks, plugin manifests, MCP servers). New files Claude Code adds in future versions are NOT auto-captured — plugin updates decide what gets included. This is the opposite trade-off from wholesale-capture tools; we pay with manual maintenance and gain predictable, auditable snapshot contents.

[P3] No Network, Ever: export and apply are local-only. Plugin reinstallation during apply delegates to Claude Code's own /plugin install mechanism, which manages network access itself. claude-snapshot makes zero outbound requests.

[P4] Diff Before Destroy: every apply is preceded by a diff summary the user must acknowledge. Every overwritten file is first copied to <file>.bak. Snapshot contents are always inspectable without extraction via /snapshot:inspect.

[P5] Cross-Platform First-Class: the plugin is Node.js, not bash. It runs the same on macOS and Linux without polyfills, different code paths, or GNU-coreutils assumptions. Windows via WSL is supported; native Windows is best-effort.

Use Cases

  1. Multiple machines — personal ↔ work sync
  2. OS reinstall — backup before format, restore after fresh install
  3. Safe rollback — snapshot before risky config experiments
  4. Team onboarding — share snapshot with new team members for instant parity
02

Architecture

claude-snapshot — Architecture

Distribution

  • Type: Claude Code plugin (primary) + npm package (secondary)
  • Plugin name: snapshot@claude-snapshot
  • npm package: claude-snapshot
  • Version analyzed: 0.3.0
  • Runtime required: Node.js 18+, Claude Code with plugin support
  • Language: JavaScript (Node.js ESM)
  • npm dependency: tar package for archive I/O

Install Methods

# As Claude Code plugin (recommended)
/plugin marketplace add adhenawer/claude-snapshot
/plugin install snapshot@claude-snapshot
/reload-plugins

# Via npx (no install)
npx -y claude-snapshot export
npx -y claude-snapshot inspect <path>
npx -y claude-snapshot diff <path>
npx -y claude-snapshot apply <path>

Directory Tree

claude-snapshot/
├── src/
│   └── snapshot.mjs         # Core Node.js ESM script
├── commands/
│   ├── export.md             # /snapshot:export command
│   ├── inspect.md            # /snapshot:inspect command
│   ├── diff.md               # /snapshot:diff command
│   └── apply.md              # /snapshot:apply command
├── .claude-plugin/
│   ├── plugin.json           # Plugin manifest (name: snapshot, version: 0.3.0)
│   └── marketplace.json
├── tests/                    # 57 passing tests
├── docs/
└── package.json

Snapshot Anatomy

claude-snapshot-YYYY-MM-DD.tar.gz
├── manifest.json          # schemaVersion, plugins, marketplaces, hooks, MDs, MCPs, checksums
├── settings.json          # Claude Code settings (plugins, hooks, permissions, env, statusLine)
├── mcp-servers.json       # MCP configs (path-normalized, OAuth tokens excluded)
├── global-md/             # CLAUDE.md + other root-level .md files
├── hooks/                 # Custom hook scripts
├── plugins/
│   ├── installed_plugins.json
│   ├── known_marketplaces.json
│   └── blocklist.json
└── cache/                 # (only with --full)

What Migrates

Artifact Included
settings.json Yes
CLAUDE.md + global .md files Yes
Plugin manifests + marketplace registrations Yes
Hook scripts Yes
MCP server configs (path-normalized, OAuth excluded) Yes
Plugin caches (with --full) Yes
Sessions, history, telemetry No
Project-scoped plugins No

Cross-Platform

  • Absolute paths (like /Users/you/) normalized to $HOME at export
  • Resolved back to current machine's $HOME at apply
  • Windows native: best-effort; WSL: supported
03

Components

claude-snapshot — Components

Commands (4 slash commands)

Command Usage Purpose
/snapshot:export /snapshot:export Export setup as .tar.gz to ~/claude-snapshot-YYYY-MM-DD.tar.gz
/snapshot:inspect <path> /snapshot:inspect ~/claude-snapshot-*.tar.gz Preview snapshot contents without extracting
/snapshot:diff <path> /snapshot:diff ~/claude-snapshot-*.tar.gz Compare snapshot against current setup
/snapshot:apply <path> /snapshot:apply ~/claude-snapshot-*.tar.gz Apply snapshot (with diff preview + confirmation)

Core Script

src/snapshot.mjs — single Node.js ESM module implementing all snapshot operations:

  • Export: reads ~/.claude/, normalizes paths, creates .tar.gz with manifest.json
  • Inspect: extracts and displays manifest without side effects
  • Diff: compares manifest against current ~/.claude/ state
  • Apply: backup → write → install plugins (delegates to Claude Code's /plugin install)

npx Interface

npx -y claude-snapshot export
npx -y claude-snapshot inspect <path>
npx -y claude-snapshot diff <path>
npx -y claude-snapshot apply <path>

Outputs:

  • Human-readable summary (interactive terminal)
  • Single JSON line when piped
  • --json flag forces JSON in terminal

Plugin Manifest

{
  "name": "snapshot",
  "version": "0.3.0",
  "description": "Export and apply portable snapshots of your Claude Code setup across machines",
  "author": { "name": "Rodolfo Moraes" },
  "repository": "https://github.com/adhenawer/claude-snapshot",
  "license": "MIT"
}

No Hooks, No Skills, No MCP

claude-snapshot ships zero hooks, skills, subagents, or MCP servers. It is a pure utility plugin.

Tests

57 passing tests covering export, inspect, diff, and apply operations.

05

Prompts

claude-snapshot — Prompts

Excerpt 1 — /snapshot:apply Command File

From commands/apply.md:

---
name: apply
description: Apply a snapshot to this machine's Claude Code setup
allowed-tools: Bash, Read, AskUserQuestion
---

# /snapshot:apply

Apply a Claude Code snapshot to this machine, restoring the complete setup.

## Steps

1. Validate the path argument exists

2. First run diff to show the user what will change:
```bash
node "${CLAUDE_PLUGIN_ROOT}/src/snapshot.mjs" diff "$SNAPSHOT_PATH"
  1. Present the diff summary and ask for confirmation:

    "The following changes will be applied: [summary]. Existing files with conflicts will be backed up as .bak. Apply all? (y/n)"

  2. If confirmed, run apply:

node "${CLAUDE_PLUGIN_ROOT}/src/snapshot.mjs" apply "$SNAPSHOT_PATH"
  1. Report results: files written/overwritten, backups created, plugins installed, warnings

  2. MCP servers — post-apply guidance: [detailed per-method guidance for npm, pip, binary, manual methods]

Do NOT modify ~/.claude.json yourself. v0.2 explicitly reports without writing because .claude.json also holds OAuth tokens. The user installs MCPs through their normal tooling; the snapshot tells them what to install, not how to edit the file.

  1. Warn the user to restart Claude Code for changes to take full effect.

**Technique**: Safety-gate command pattern. The command explicitly requires a diff review step before apply, surfaces a specific reasoning note about why `.claude.json` is excluded (OAuth token safety), and ends with a restart reminder. This is a defensive command design that prioritizes reversibility and user awareness over speed.

## Excerpt 2 — /snapshot:export Command File

From `commands/export.md`:

```markdown
---
name: export
description: Export your Claude Code setup as a portable snapshot
allowed-tools: Bash, Read
---

# /snapshot:export

## Steps

1. Run the export via the core script, passing any user arguments:
```bash
RESULT=$(node "${CLAUDE_PLUGIN_ROOT}/src/snapshot.mjs" export $ARGS 2>&1)
echo "$RESULT"
  1. Parse the JSON result and report to the user:
    • Output file path (emphasize this — it's what they'll pass to /snapshot:apply on the other machine)
    • Number of plugins, hooks, MDs, and marketplaces included

**Technique**: Shell-as-agent-instruction. The command instructs the agent to run a shell command and parse the JSON result, then reformat it as a human-readable report. This pattern delegates the complex logic to the Node.js script (testable, deterministic) and uses Claude as the presentation layer.
09

Uniqueness

claude-snapshot — Uniqueness

differs_from_seeds

claude-snapshot has no direct analog among the 11 seeds. It is entirely infrastructure-focused — managing the ~/.claude/ directory as a configuration artifact — rather than defining agent behavior, spec formats, or workflow methodology. The closest seed parallel is agent-os (which also manages ~/.claude/ content), but agent-os authors new standards while claude-snapshot migrates existing ones. Unlike claude-conductor (which provides markdown templates), claude-snapshot treats the entire Claude Code configuration layer as a portable backup artifact. It has zero overlap with workflow seeds (superpowers, BMAD-METHOD, spec-driver, spec-kit) — it exists in the "configuration infrastructure" layer that all workflow seeds assume but none address. The most philosophically similar framework in this batch is claude-overlay (which also manages Claude Code config files), but claude-overlay manages provider credentials while claude-snapshot manages the complete setup portability.

Positioning

  • Primary differentiator: The only tool in the catalog explicitly designed for Claude Code configuration portability and backup. Snapshots include a complete machine-portable archive of plugins, hooks, CLAUDE.md files, and MCP configs with path normalization.
  • Secondary differentiator: Explicit design principles (P1–P5) published in the README — unusual rigor for a 2-star project. The design shows careful reasoning about blast radius, reversibility, and OAuth token safety.
  • Target user: Developers with multiple machines (personal + work) or who regularly reinstall OSes and need to preserve their Claude Code setup.

Observable Failure Modes

  1. Version skew: If Claude Code changes ~/.claude/ file formats between snapshot export and apply, the snapshot may be partially incompatible. The schemaVersion in manifest.json should help but is not documented as having compatibility guarantees.
  2. MCP manual installation: MCP servers are reported but not applied automatically. On machines with many MCPs, the manual step list could be long and error-prone.
  3. Plugin marketplace assumption: Apply relies on /plugin install which requires the marketplace to be accessible. Air-gapped machines cannot apply plugin-containing snapshots.
  4. .bak accumulation: Each apply creates .bak files; repeated applies to the same machine accumulate backup files without cleanup.
  5. Narrow scope (Claude Code only): Snapshots are useless on machines using Cursor, Codex, or other AI tools — the format is Claude Code-specific.
04

Workflow

claude-snapshot — Workflow

Workflow 1: Multi-Machine Sync

# On machine A
/snapshot:export
# → ~/claude-snapshot-2026-05-26.tar.gz

# Transfer file (Drive, scp, USB, etc.)

# On machine B
/snapshot:apply ~/claude-snapshot-2026-05-26.tar.gz
# → shows diff → confirms → applies

Workflow 2: OS Reinstall Backup

# Before wiping
/snapshot:export

# After fresh OS install + Claude Code
/snapshot:apply ~/claude-snapshot-2026-05-26.tar.gz

Workflow 3: Safe Experimentation

# Save current state
/snapshot:export

# Experiment with new plugins, hooks, risky configs...

# If something breaks:
/snapshot:apply ~/claude-snapshot-2026-05-26.tar.gz

Workflow 4: Team Onboarding

# Team lead exports their setup
/snapshot:export
# Share file with new team member

# New team member applies
/snapshot:apply ~/team-snapshot-2026-05-26.tar.gz

Phase-to-Artifact Map

Phase Artifact
export ~/claude-snapshot-YYYY-MM-DD.tar.gz
inspect Human-readable manifest summary (stdout only)
diff Diff report (stdout only)
apply Modified ~/.claude/ files + .bak backups

Apply Flow (Detailed)

  1. Validate snapshot path exists
  2. Run diff — show what will change
  3. Present diff summary + confirmation: "Apply all? (y/n)"
  4. If confirmed:
    • Back up conflicting files as <file>.bak
    • Extract snapshot, resolve $HOME for target machine
    • Install missing plugins via Claude Code's /plugin install
  5. Report results (files written, backups created, plugins installed)
  6. Post-apply: surface MCP server guidance (manual installation needed)
  7. Warn user to restart Claude Code for changes to take effect

Approval Gates

Gate Type
Diff preview before apply yes-no
MCP server installation guidance informational (not blocking)
06

Memory Context

claude-snapshot — Memory & Context

State Storage

claude-snapshot operates on the filesystem:

Path Role
~/claude-snapshot-YYYY-MM-DD.tar.gz Snapshot archive (output)
~/.claude/ Source (export) and target (apply)
~/.claude/<file>.bak Pre-apply backup of each overwritten file

Snapshot Manifest

Each snapshot contains a manifest.json with:

  • schemaVersion — for future compatibility
  • plugins, marketplaces, hooks, MDs — explicit allowlist
  • checksums — SHA-based integrity checks

No Session State

claude-snapshot maintains no ongoing session state. Each command is completely stateless — export reads current ~/.claude/, apply writes to ~/.claude/, and both exit cleanly.

Backup / Rollback

Every apply creates .bak copies before overwriting:

~/.claude/settings.json.bak
~/.claude/CLAUDE.md.bak

This provides a one-level rollback without needing another snapshot.

Context Compaction Handling

Not applicable — claude-snapshot does not interact with AI session context.

Cross-Machine Portability

Path normalization at export time (/Users/you/$HOME) + path resolution at apply time ensures snapshots transfer cleanly between machines with different usernames or directory structures.

MCP Server Handling

MCP configs are captured but applied differently than other artifacts:

  • Paths are normalized and stored in mcp-servers.json in the archive
  • OAuth tokens are explicitly excluded from mcpServers capture
  • On apply, MCPs are reported (what needs installing) but NOT auto-written to ~/.claude.json — user must install manually via their normal MCP tooling
07

Orchestration

claude-snapshot — Orchestration

Multi-Agent Pattern

None — claude-snapshot is a single-command utility.

Orchestration Pattern

none

Execution Mode

one-shot — each command runs once and exits.

Isolation Mechanism

none — reads/writes ~/.claude/ directly with .bak safeguards.

Multi-Model Usage

None — no LLM calls.

Subagent Definition Format

None.

Consensus Mechanism

None.

Prompt Chaining

Minimal — the apply command chains: diff → confirmation → apply as a sequential two-step flow.

Dependency on Claude Code

claude-snapshot delegates plugin installation to Claude Code's own /plugin install mechanism during apply. This creates a soft dependency: the apply command instructs Claude to run /plugin install <name> rather than implementing its own plugin installation. This is intentional (P3: No Network, Ever — the plugin itself doesn't manage network, Claude Code does).

Cross-Tool Portability

Low — the plugin is Claude Code-specific. The npx path works standalone on the CLI but the snapshot format (plugin manifests, hook scripts) is Claude Code-specific. Snapshots cannot be applied to other AI tools.

08

Ui Cli Surface

claude-snapshot — UI & CLI Surface

Claude Code Plugin Interface

The primary interface is 4 slash commands within Claude Code:

/snapshot:export                              # Export to ~/claude-snapshot-YYYY-MM-DD.tar.gz
/snapshot:inspect <path>                     # Preview without extracting
/snapshot:diff <path>                        # Compare against current setup
/snapshot:apply <path>                       # Apply with diff preview + confirmation

npx CLI Interface

Secondary interface — standalone without Claude Code:

npx -y claude-snapshot export
npx -y claude-snapshot inspect <path>
npx -y claude-snapshot diff <path>
npx -y claude-snapshot apply <path>
  • Interactive terminal: human-readable summary
  • Piped: single JSON line
  • --json flag: force JSON in terminal

Binary

  • Binary name: claude-snapshot (in package.json#bin)
  • Is thin wrapper: No — full Node.js runtime

Local UI

None — text-only output.

MCP Server

None.

IDE Integration

Claude Code plugin is the primary integration. No VS Code extension or other IDE integration.

Observability

  • inspect command provides a full manifest audit without side effects
  • diff command shows what will change before apply
  • Apply output reports: files written, backups created, plugins installed, warnings

CI/CD

The npx -y claude-snapshot export path can be used in CI for automated backup before deployment or config changes.

Related frameworks

same archetype · same primary tool · same memory type

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…

Agent OS ★ 4.6k

Extracts implicit codebase conventions into token-efficient markdown standards files and injects them selectively into AI agent…

Claude Conductor ★ 367

Gives Claude Code a persistent, cross-linked, auto-analyzed documentation system so it retains codebase context across sessions.

Spec-Driver (Greenfield Spec-Driven Development) ★ 25

Prevents spec rot in AI-assisted development by making implementation changes flow back into evergreen, authoritative specs via…

Anthropic Knowledge Work Plugins ★ 16k

Role-specialized plugin bundles with live MCP connectors that turn Claude into a domain expert for enterprise knowledge workers.

Codex Integration for Claude Code (skill-codex) ★ 1.3k

Single Claude Code skill that handles Codex CLI invocation correctly (stdin blocking, thinking token suppression, session resume)…