merge

A command for finishing work on a Git branch, the separate line of development where changes are made. It checks documentation and the working tree, merges the branch into the main branch, and cleans up when appropriate.

In plain words
What is it for?
Use it when a branch is ready to ship, whether it was created normally or through a Git worktree, a separate working directory linked to the same repository.
Why use it?
Merging can hide missing documentation, unwanted files, or unresolved conflicts. This command checks those conditions and exposes problems instead of quietly changing them.

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/peterkrueck/claude-code-development-kit/merge
Clone the repo
git clone --depth 1 https://github.com/peterkrueck/Claude-Code-Development-Kit
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,872 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.00000 $0.04872
Opus 5 $0.00000 $0.02436
Sonnet 5 $0.00000 $0.00974
Haiku 4.5 $0.00000 $0.00487

Measured 2d ago against content hash 2e329887189c, 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 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.

commands/merge.md · 322 lines

How it starts

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

Merge Command

Finalize work on a branch: verify docs + tree are clean, merge to main, clean up. Supports both standard git checkout -b branches and git worktree flows — auto-detected at pre-flight.

Context from user: $ARGUMENTS


Philosophy

/merge is a verify + ship command, not a do-everything-at-end-of-session cleanup. Doc updates, commits, and testing belong to the work session on the branch. By the time /merge runs — typically in a fresh claude session — those things should already be done. This command verifies the invariant, surfaces violations, and ships if clean.

Rule of thumb: if you're tempted to have /merge silently fix something, STOP and surface it to the user instead. Merges are semi-destructive; a missed doc update or an accidentally-committed build artifact is much harder to undo after the fact.

Two scenarios, one command. When the branch fast-forwards or auto-merges with no conflicts, this is pure verify + ship. When main has diverged and the merge conflicts — routine when overlapping branches touch the same files — conflict resolution becomes the real work (→ Step 4b). Resolving conflicts is NOT "silently fixing": surface the approach decision to the user, then execute it on rails with mandatory verification.

Prime directive (non-negotiable): any merge where main had diverged — i.e., git composed a new tree from both sides, whether it conflicted or auto-merged cleanly — MUST pass the project's build/test before the merge commit is finalized (→ Step 4c). The nastiest defects are clean auto-merges with no conflict marker: a reference whose declaration the other side moved or deleted compiles on each parent alone and breaks only in the combined tree. Only building the composed tree catches it. (If main is already an ancestor of the branch — no divergence — the merged tree equals the branch tree, already built on-branch; the build is skippable.)


$ARGUMENTS conventions

Two documented uses for $ARGUMENTS:

Read the full file on GitHub · 322 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 · 322 lines · 0 tokens per session scan A 2e329887189c

Subscribe to this mod's changes

merge is a command published in the GitHub repository peterkrueck/Claude-Code-Development-Kit (1,380 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,872 tokens. 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-30.