backup

backup is a command for Claude Code from cwakim/claude-plugins. It costs 68 tokens per session (7,106 once invoked), scanned A, original, MIT.

A command that copies the agent's project memories, handoff notes, plans, and global settings into a private GitHub repository. Each backup is submitted as a pull request and immediately squash-merged, creating a change history.

In plain words
What is it for?
Use it to set up, run, check, schedule, restore, or merge backups of agent state through GitHub.
Why use it?
It protects locally stored agent information from a lost or damaged computer. It is a backup rather than a sync, so it does not alter the local files.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

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 memory-backup plugin — 5 commands shipped together

Good fit Use it to set up, run, check, schedule, restore, or merge backups of agent state through GitHub.

Compare 6 commands from other repositories ↓
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 cwakim/claude-plugins
Claude Code
/plugin install memory-backup

Made for: Claude Code.

Or install memory-backup, the plugin that ships this one along with the rest of its 5 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 backup

README.md
[![agentmods](https://agentmods.dev/badge/commands/cwakim/claude-plugins/backup/github.svg)](https://agentmods.dev/commands/cwakim/claude-plugins/backup)
Your own site
<a href="https://agentmods.dev/commands/cwakim/claude-plugins/backup"><img src="https://agentmods.dev/badge/commands/cwakim/claude-plugins/backup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backup

Your own site · 80×15
<a href="https://agentmods.dev/commands/cwakim/claude-plugins/backup"><img src="https://agentmods.dev/badge/commands/cwakim/claude-plugins/backup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,106 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00068 $0.07106
Opus 5.5 $0.00027 $0.02842
Sonnet 5.5 $0.00014 $0.01421
Haiku 4.5 $0.00007 $0.00711

Measured 23d ago against content hash 6aa8cbe7b5ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

backup 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 23d 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.

plugins/memory-backup/commands/backup.md · 498 lines

How it starts

The opening of the file, as written. The whole thing — 498 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Backup

Claude Code's persistent memory lives only on this machine, one store per project under ~/.claude/projects/<slug>/memory/. A dead disk loses all of it at once. This command mirrors every store, the plan documents in ~/.claude/plans/, the hand-written global config in ~/.claude/ (CLAUDE.md and friends), and the handoff notes tracked in ~/.claude/handoff-index.md when that index exists (it is written by the session-continuity plugin, but this command does not depend on it: no index just means no handoffs to back up), plus archived handoffs, into a staging git repo and pushes each run to a private GitHub repo. Every run lands through a pull request that is squash-merged on the spot: main stays protected, the PR history doubles as a change log of memory churn, and the backup is complete only when the merge is.

This is a backup, not a sync. Backup runs copy outward only and never write to a memory store, a handoff note, or the index. Restoring and merging are their own explicit commands (see Arguments).

The mirror tree, naming rules, and invariants live in ${CLAUDE_PLUGIN_ROOT}/docs/layout.md; the secret-scan behavior in ${CLAUDE_PLUGIN_ROOT}/docs/secret-scan.md. Read both before a backup run.

Arguments

$ARGUMENTS is optional:

  • (none) runs a backup. If nothing is configured yet, run Setup first, then continue into the backup.
  • setup is the single command for all target configuration: add a target (GitHub repo or object-storage bucket), reconfigure (re-point) an existing one, or remove one. Run it again anytime to change anything; there is no separate reconfigure command.
  • status reports the configuration, the remote repo and its visibility, and when the last backup landed. No changes.
  • schedule installs a local scheduled job (cron, or launchd on macOS) that runs the backup on a cadence; unschedule removes it. See Schedule mode.
  • restore ..., zip ..., merge ... are sibling commands, split out so each invocation loads only what it needs. Read ${CLAUDE_PLUGIN_ROOT}/commands/restore.md, zip.md, or merge.md and follow it, passing the remaining arguments through unchanged: /backup restore --dry-run behaves exactly like /memory-backup:restore --dry-run.

Read the full file on GitHub · 498 lines

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. 23d ago Changed · +19 lines 6aa8cbe7b5ec
  2. 1mo ago First seen · 479 lines · 68 tokens per session scan A 10d0f6e6382c

Subscribe to this mod's changes

backup is a command published in the GitHub repository cwakim/claude-plugins (2 stars, last pushed 23d ago), licensed MIT. It adds 68 tokens to every session and 7,106 once invoked, about $0.0003 per session on Opus 5.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.