merge

merge is a command for Claude Code from Marcel-Bich/marcel-bich-claude-marketplace. It costs 12 tokens per session (979 once invoked), scanned A, original, MIT.

A Git command that merges a branch from a separate worktree into the branch you are currently using. It can use either a merge or rebase strategy.

In plain words
What is it for?
Use it to bring completed work from a named Git worktree into your current branch, using merge or rebase.
Why use it?
It removes the manual steps of finding the worktree branch, checking its state, and integrating its changes. It also catches invalid strategies and missing worktrees.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the hydra plugin — 9 commands shipped together

Good fit Use it to bring completed work from a named Git worktree into your current branch, using merge or rebase.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/marcel-bich/marcel-bich-claude-marketplace/merge
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.

Clone the repo
git clone --depth 1 https://github.com/Marcel-Bich/marcel-bich-claude-marketplace

Made for: Claude Code.

Or install hydra, the plugin that ships this one along with the rest of its 9 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/marcel-bich/marcel-bich-claude-marketplace/merge/github.svg)](https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/merge)
Your own site
<a href="https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/merge"><img src="https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/merge/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 merge

Your own site · 80×15
<a href="https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/merge"><img src="https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/merge.svg" alt="Reviewed on agentmods" width="80" 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 979 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.00012 $0.00979
Opus 5 $0.00006 $0.00490
Sonnet 5 $0.00002 $0.00196
Haiku 4.5 $0.00001 $0.00098

Measured 8d ago against content hash 2711659d07b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 8d 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/hydra/commands/merge.md · 163 lines

How it starts

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

Worktree Merge

You are executing the /hydra:merge command. Merge a worktree branch back into the current branch.

Arguments

  • $ARGUMENTS is parsed as:
    • First word: Worktree name
    • Second word (optional): Strategy (merge/rebase)

Examples:

  • /hydra:merge feature-a - Merge with default strategy
  • /hydra:merge feature-a rebase - Rebase instead of merge

Process

1. Parse Arguments and Validate

WORKTREE_NAME=$(echo "$ARGUMENTS" | awk '{print $1}')
STRATEGY=$(echo "$ARGUMENTS" | awk '{print $2}')
STRATEGY=${STRATEGY:-merge}  # Default: merge

# Validate strategy
if [[ "$STRATEGY" != "merge" && "$STRATEGY" != "rebase" ]]; then
  echo "Unknown strategy: $STRATEGY (allowed: merge, rebase)"
  exit 1
fi

2. Check if Worktree Exists

git worktree list | grep -qE "$WORKTREE_NAME|hydra/$WORKTREE_NAME" || {
  echo "Worktree '$WORKTREE_NAME' not found"
  exit 1
}

3. Determine Branch Names

WORKTREE_BRANCH=$(git worktree list --porcelain | grep -A2 "$WORKTREE_NAME" | grep "branch " | sed 's/branch refs\/heads\///')
CURRENT_BRANCH=$(git branch --show-current)

echo "Merge: $WORKTREE_BRANCH -> $CURRENT_BRANCH"

4. Check for Uncommitted Changes

In current directory (blocks):

if [[ -n $(git status --porcelain) ]]; then
  echo "ERROR: Uncommitted changes in current directory"
  echo "Commit or stash your changes first."
  git status --short
  exit 1
fi

In worktree (warning):

WORKTREE_PATH=$(git worktree list | grep "$WORKTREE_NAME" | awk '{print $1}')
if [[ -n $(git -C "$WORKTREE_PATH" status --porcelain) ]]; then
  echo "WARNING: Uncommitted changes in worktree '$WORKTREE_NAME'"
  git -C "$WORKTREE_PATH" status --short
  # Ask whether to continue
fi

5. Show What Will Be Merged

echo "The following commits will be merged:"
git log --oneline "$CURRENT_BRANCH".."$WORKTREE_BRANCH"

echo ""
echo "Affected files:"
git diff --stat "$CURRENT_BRANCH"..."$WORKTREE_BRANCH"

Read the full file on GitHub · 163 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. 8d ago First seen · 163 lines · 12 tokens per session scan A 2711659d07b4

Subscribe to this mod's changes

merge is a command published in the GitHub repository Marcel-Bich/marcel-bich-claude-marketplace (13 stars, last pushed 2d ago), licensed MIT. It adds 12 tokens to every session and 979 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-09-03.