backup

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/cwakim/claude-plugins/backup
Clone the repo
git clone --depth 1 https://github.com/cwakim/claude-plugins
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 6,802 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 $0.00068 $0.06802
Opus 5 $0.00034 $0.03401
Sonnet 5 $0.00014 $0.01360
Haiku 4.5 $0.00007 $0.00680

Measured 2d ago against content hash 10d0f6e6382c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 479 lines

How it starts

The opening of the file, as written. The whole thing — 479 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 · 479 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. 2d 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 12d ago), licensed MIT. It adds 68 tokens to every session and 6,802 once invoked, about $0.0003 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.