merge

merge is a command for coding agents from cwakim/claude-plugins. It costs 64 tokens per session (2,611 once invoked), scanned A, original, MIT.

An interactive command for combining memory, handoff, and planning files from backups or another machine into the current machine. A monorepo-like mirror is not required; it can work with backup sources such as a GitHub repository, object storage, or a zip file.

In plain words
What is it for?
Use it to merge saved memories, handoff notes, and plans from one or more machine mirrors, review a restore-style plan, resolve conflicts, and rebuild shared indexes.
Why use it?
It helps reconcile differences between machines while preserving local files and asking before conflicts are applied. It excludes machine-specific configuration because copying that automatically could cause breakage.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the memory-backup plugin — 4 commands shipped together

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/merge
Clone the repo
git clone --depth 1 https://github.com/cwakim/claude-plugins

Or install memory-backup, 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 merge

README.md
[![agentmods](https://agentmods.dev/badge/commands/cwakim/claude-plugins/merge.svg)](https://agentmods.dev/commands/cwakim/claude-plugins/merge)
Your own site
<a href="https://agentmods.dev/commands/cwakim/claude-plugins/merge"><img src="https://agentmods.dev/badge/commands/cwakim/claude-plugins/merge.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,611 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.00064 $0.02611
Opus 5 $0.00032 $0.01306
Sonnet 5 $0.00013 $0.00522
Haiku 4.5 $0.00006 $0.00261

Measured 3d ago against content hash 46018af7ff4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

merge 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 3d 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/merge.md · 182 lines

How it starts

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

Merge (merge [--dry-run] [path])

Converges this machine's live state with the other machines' mirrors. Merge reads one, several, or all of the other machines/<host>/ subtrees from a backup source and applies their content into the live stores here, with restore's temperament throughout: plan first, conflicts asked, nothing local ever deleted, nothing applied before the plan is confirmed. It never writes into any machines/ subtree; the every-machine-writes-only-its-own invariant from docs/layout.md stands. It works for any number of machines. Full convergence is one cycle: each machine in turn merges from all the others and backs up, in any order; after the last machine's turn every subtree agrees, and resolutions made early in the cycle propagate through the mirror, so later machines mostly just confirm them.

Merge covers memories, handoffs, and plans. Config is excluded by design: settings.json, keybindings, commands, and agents legitimately differ per machine, and merging them invites subtle breakage. Config moves between machines only through an explicit restore, where the user has deliberately chosen a source machine to copy from.

The mirror tree and name-to-target derivation rules live in ${CLAUDE_PLUGIN_ROOT}/docs/layout.md; read it before building the plan. If the source machine picked below turns out to be this machine's own subtree, refuse and point at restore: merging a mirror into the machine it came from is what restore is for.

Resolve the source

Identical to restore's source resolution (see commands/restore.md), except merge wants every machine's subtree, not just this host's:

  • <path> given: a zip made by zip <path>, or its already-extracted folder. A .zip file is extracted into a fresh temp directory (mktemp -d); a directory is used directly. Verify the source root contains at least one machines/<hostname>/ subtree; if not, say so and stop. No GitHub, no gh, no network.
  • No <path>: a configured backup target; both kinds may exist.
    • GitHub mirror (~/.claude/memory-backup/ clone): git pull --ff-only first so it is current. The source root is the clone.
    • Object storage (~/.claude/memory-backup-obstore.json): materialize it into a fresh temp directory with ${CLAUDE_PLUGIN_ROOT}/scripts/obstore-pull.sh --dest <tmp> --bucket ... reading bucket/prefix/endpoint/region/profile from the config. Pass no --host, so the whole machines/ tree (every machine) comes down, which is what merge reads across. The temp dir is then the source root, handled exactly like an extracted zip.
    • Both configured: ask via AskUserQuestion which to merge from. Only one: use it without asking. If nothing is configured, say so and stop: merge presumes an established mirror (for disaster recovery onto a fresh machine, use restore).

Read the full file on GitHub · 182 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. 3d ago First seen · 182 lines · 64 tokens per session scan A 46018af7ff4d

Subscribe to this mod's changes

merge is a command published in the GitHub repository cwakim/claude-plugins (2 stars, last pushed 13d ago), licensed MIT. It adds 64 tokens to every session and 2,611 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.