branch

branch is a command for Claude Code from juanmhidalgo/claude-plugins. It costs 77 tokens per session (1,860 once invoked), scanned A, original, MIT.

A command for reviewing changes on a Git branch before merging them. A branch is a separate line of development in a Git repository.

In plain words
What is it for?
Comparing the current branch with a base branch such as main or master, examining the diff, and reporting findings from critical to low severity.
Why use it?
It organizes possible security, performance, bug, quality, and testing problems by severity so merge readiness is easier to judge.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; names the NotebookEdit 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 code-review plugin — 6 skills, 14 commands, 14 agents, 1 hook shipped together

Good fit Comparing the current branch with a base branch such as main or master, examining the diff, and reporting findings from critical to low severity.

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 juanmhidalgo/claude-plugins
Claude Code
/plugin install code-review

Made for: Claude Code.

Or install code-review, the plugin that ships this one along with the rest of its 6 skills, 14 commands, 14 agents, 1 hook.

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 branch

README.md
[![agentmods](https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/branch/github.svg)](https://agentmods.dev/commands/juanmhidalgo/claude-plugins/branch)
Your own site
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/branch"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/branch/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 branch

Your own site · 80×15
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/branch"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/branch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,860 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.00077 $0.01860
Opus 5.5 $0.00031 $0.00744
Sonnet 5.5 $0.00015 $0.00372
Haiku 4.5 $0.00008 $0.00186

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

Security

Grade A, and why

branch 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 26d 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.

code-review/commands/branch.md · 175 lines

How it starts

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

Context

  • Current branch: !git branch --show-current
  • Arguments: !bash "${CLAUDE_PLUGIN_ROOT}/scripts/args.sh" '$ARGUMENTS'
  • All arguments: $ARGUMENTS

The Arguments line is the parsed form of what the user typed: one JSON object with pane, spec, effort and positional. Read its fields; do not parse the raw arguments yourself. spec is null when none was given, and find-spec.sh then searches on its own; a path with spaces cannot be passed.

Base branch

Use positional[0] if present. Otherwise main, falling back to master.

Effort level

effort is one of low | medium | high | max, default medium. It sets how much uncertainty reaches you:

  • low / medium — only findings the reviewer verified against the code path
  • high / max — broader coverage, including findings resting on context the reviewer could not confirm, each marked as such

If effort is null, read pr_effort: from .claude/code-review.local.md and reuse it; else medium.

Why this is dispatched and not done inline

<iron_law priority="blocking">

Run the reviewer in a subagent. Never review the branch yourself in this conversation.

</iron_law>

A reviewer that already holds the conversation which produced the code inherits its framing — every reason the code looks correct is already in the window, and the review degrades into confirming decisions it watched being made. A subagent starts from the diff and the repo, with no memory of why anything was written.

This is the property that distinguishes this command from an inline review, and it is the reason to reach for it when this session wrote the code.

If subagents are unavailable, say plainly that the review will be weaker and why, then offer: run it in a fresh session (--pane, when inside Herdr), or run it inline and mark the report as context-contaminated. Do not silently downgrade.

Herdr pane

Run this review in a Herdr pane when pane is true, or when pane is null and review_in_pane is configured true (${user_config.review_in_pane}). pane: false always wins: it is what the pane session itself receives. In the pane, run in collect mode: follow ${CLAUDE_PLUGIN_ROOT}/references/herdr-pane.md instead of the Dispatch below. It falls back to the normal run outside Herdr.

Read the full file on GitHub · 175 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. 26d ago Changed · +2 lines 47f0c872b191
  2. 1mo ago Changed · +7 lines 6d27160dafd4
  3. 1mo ago Changed · +10 lines 356c91a88ce6
  4. 1mo ago Changed · +21 lines ab8f914a68f2
  5. 2mo ago Changed · +66 lines · +35 tokens per session e39d4c8470fa
  6. 3mo ago First seen · 69 lines · 42 tokens per session scan A a333636928aa

Subscribe to this mod's changes

branch is a command published in the GitHub repository juanmhidalgo/claude-plugins (8 stars, last pushed 18d ago), licensed MIT. It adds 77 tokens to every session and 1,860 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.

Related

branch compared with commands from other repositories

branch next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
branchjuanmhidalgo/claude-pluginsCommand818d agoMITA77Claude Code
speckit.spex.submitrhuss/cc-spexCommand122yesterdayApache-2.0A15Claude Code
merge-conflict-analysisrjmurillo/ai-agentsCommand50todayApache-2.0A0GitHub Copilot
pr-riskkumaran-is/claude-code-onboardingCommand37todayMITA0Claude Code
gitazrtydxb/procoderCommand21222d agoApache-2.0A20Claude Code
repo-audittractorjuice/arc-kitCommand2.3ktodaynoneA29Claude Code
factoryfelvieira/claude-skills-fvCommand2913d agoApache-2.0A47Claude Code