review-branch-and-fix

review-branch-and-fix is a command for Claude Code from layered-ai-public/claude-review-action. It costs 11 tokens per session (657 once invoked), scanned A, original, Apache-2.0.

A command that reviews the current Git branch against its base branch and fixes the problems it finds. Git is a tool for tracking code changes, and a branch is a separate line of work in a repository.

In plain words
What is it for?
It helps compare the branch with main or master, run a review using another agent, and modify the code to address the review findings.
Why use it?
It combines checking a branch's changes with applying fixes, so issues found during review do not need to be corrected separately. It stops when there are no changes to review.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: model in frontmatter; mentions subagents; mentions Claude Code.

Good fit It helps compare the branch with main or master, run a review using another agent, and modify the code to address the review findings.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/layered-ai-public/claude-review-action/review-branch-and-fix
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/layered-ai-public/claude-review-action

Made for: Claude Code.

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 review-branch-and-fix

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/layered-ai-public/claude-review-action/review-branch-and-fix"><img src="https://agentmods.dev/badge/commands/layered-ai-public/claude-review-action/review-branch-and-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 657 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.00011 $0.00657
Opus 5.5 $0.00004 $0.00263
Sonnet 5.5 $0.00002 $0.00131
Haiku 4.5 $0.00001 $0.00066

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

Security

Grade A, and why

review-branch-and-fix 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 12d 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/review-branch-and-fix.md · 45 lines

How it starts

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

Review and fix the current branch against the base branch.

The review itself is defined by the /review-branch command - this command does not restate it. Run that review, then fix what it finds.

Base branch

Determine the base branch by checking which of main or master exists as a remote tracking branch. If the argument $ARGUMENTS is provided, use that as the base instead.

Run git diff <base>...HEAD to obtain the diff. If there are no changes, say so and stop.

Running a review pass

Each review pass is delegated to a subagent running Sonnet, so the review is done by a different model from the one applying the fixes.

Use the Agent tool with subagent_type: "general-purpose" and model: "sonnet", and this prompt:

Invoke the review-branch command with the Skill tool, passing <base> as its argument, and follow its instructions exactly. Do not modify any files. Return the complete review as your final message, in the output format that command specifies, and nothing else. If no review-branch command is available to you, say so instead of reviewing from your own judgement.

Substitute the base branch you determined above. Print the review the subagent returns verbatim, labelled with the pass number (e.g. "Review pass 1").

The review-branch command is installed alongside this one, so refer to it by name and let Claude Code resolve it - do not hardcode a path to the file. If the subagent reports it cannot find the command, stop and say that review-branch needs to be installed; do not fall back to reviewing from memory or from these instructions, which contain no review rules.

If the Agent tool is unavailable, invoke review-branch yourself in this session for each pass and note that it ran on this session's model rather than Sonnet.

Fix cycle

Run review pass 1. Then, if there are any MEDIUM or above issues:

  1. Fix each issue in the code. Keep changes minimal and focused - only fix what the review identified. Do not refactor, reorganise, or "improve" surrounding code.
  2. Never apply a fix based on an assumption the review could not verify. If a finding rests on the review's "Assumptions" line, verify it yourself in the codebase first; if you cannot, leave it unfixed and say why.
  3. After applying all fixes, run the next review pass the same way. Report only new issues introduced by your fixes - do not re-report issues that have already been resolved.
  4. If new issues are found, fix them and review again.
  5. Repeat until a clean review pass with no MEDIUM or above issues, or you have completed 3 fix cycles (whichever comes first).

Read the full file on GitHub · 45 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. 12d ago First seen · 45 lines · 11 tokens per session scan A 65a178ac7fa1

Subscribe to this mod's changes

review-branch-and-fix is a command published in the GitHub repository layered-ai-public/claude-review-action (11 stars, last pushed 7d ago), licensed Apache-2.0. It adds 11 tokens to every session and 657 once invoked, about $0.0000 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-10-19.