apply

apply is a command for Claude Code from adhenawer/claude-snapshot. It costs 12 tokens per session (516 once invoked), scanned A, original, MIT.

A command for restoring a saved Claude Code setup from a compressed snapshot file. It first shows the changes, then applies them after confirmation and creates backups for conflicting files.

In plain words
What is it for?
Use it to restore files, plugins, and configuration from a snapshot on another machine or after replacing a local setup.
Why use it?
It avoids rebuilding a coding-agent setup manually and lets you review intended changes before they are written.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the snapshot plugin — 4 commands shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add adhenawer/claude-snapshot
Claude Code
/plugin install snapshot

Made for: Claude Code.

Or install snapshot, the plugin that ships this one along with the rest of its 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for apply

README.md
[![agentmods](https://agentmods.dev/badge/commands/adhenawer/claude-snapshot/apply.svg)](https://agentmods.dev/commands/adhenawer/claude-snapshot/apply)
Your own site
<a href="https://agentmods.dev/commands/adhenawer/claude-snapshot/apply"><img src="https://agentmods.dev/badge/commands/adhenawer/claude-snapshot/apply.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 516 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.00516
Opus 5 $0.00006 $0.00258
Sonnet 5 $0.00002 $0.00103
Haiku 4.5 $0.00001 $0.00052

Measured 5d ago against content hash 121e307792f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

apply scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/apply.md · 54 lines

What it actually says

/snapshot:apply

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

Usage

/snapshot:apply <path-to-snapshot.tar.gz>

Steps

  1. Validate the path argument exists

  2. First run diff to show the user what will change:

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 (.bak files)
    • Plugins installed (or failed to install)
    • Any warnings (e.g., runtime path differences between machines)
  2. MCP servers — post-apply guidance:

    If result.mcpReport.missing is non-empty, surface it as a dedicated section. For each missing server, show install guidance based on its method:

    • npm: "Install with the MCP's official install command (e.g. claude mcp add {name} npx -y <package>)."
    • pip: "Install with uvx <package> or the project's documented uv/pipx command."
    • binary: "This MCP points to a local binary ({command}). Confirm the binary exists on this machine or install it."
    • manual: "This MCP uses a custom command ({command}). Refer to its source documentation."

    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.

    If result.mcpReport.matched is non-empty, you can mention briefly that those MCPs were already present and no action is needed.

  3. Important: Warn the user to restart Claude Code for changes to take full effect.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 54 lines · 12 tokens per session scan A 121e307792f9

Subscribe to this mod's changes

apply is a command published in the GitHub repository adhenawer/claude-snapshot (2 stars, last pushed 4mo ago), licensed MIT. It adds 12 tokens to every session and 516 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.