review-swarm

review-swarm is a command for Claude Code from kikocastro/markdown-mindmap. It costs 40 tokens per session (2,000 once invoked), scanned A, original, MIT.

A pre-merge pull-request review process that uses four focused reviewers and combines their findings into one review.

In plain words
What is it for?
Use it to review an open pull request, identify high-severity issues, post a consolidated GitHub review, and fix only those high-severity findings.
Why use it?
It looks for different classes of bugs before code is merged, while filtering out findings that cannot be supported by the changes.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents.

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/kikocastro/markdown-mindmap/review-swarm
Clone the repo
git clone --depth 1 https://github.com/kikocastro/markdown-mindmap

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-swarm

README.md
[![agentmods](https://agentmods.dev/badge/commands/kikocastro/markdown-mindmap/review-swarm.svg)](https://agentmods.dev/commands/kikocastro/markdown-mindmap/review-swarm)
Your own site
<a href="https://agentmods.dev/commands/kikocastro/markdown-mindmap/review-swarm"><img src="https://agentmods.dev/badge/commands/kikocastro/markdown-mindmap/review-swarm.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 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,000 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.1 $0.00040 $0.02000
Opus 5 $0.00020 $0.01000
Sonnet 5 $0.00008 $0.00400
Haiku 4.5 $0.00004 $0.00200

Measured 5d ago against content hash abeb1cc30227, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

review-swarm 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 5d 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.

.claude/commands/review-swarm.md · 171 lines

How it starts

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

review-swarm

Adversarial review of a pull request. Four reviewers run in parallel, each with a narrow charter and no permission to wander outside it. The orchestrator (you) merges their output, throws away anything that cannot be cited, posts one review, and fixes only the HIGH findings.

The point is not coverage. It is that each of these charters corresponds to a class of bug that has actually shipped past a normal review here.

Arguments

$ARGUMENTS is a PR number. If empty, run the whole procedure once per PR in gh pr list --state open --json number, sequentially. Skip PRs authored by dependabot[bot] or renovate[bot] unless the number was passed explicitly.

Step 0 — orchestrator setup (do this before spawning anything)

gh pr view <PR> --json number,title,body,headRefName,baseRefName,author,files
gh pr diff <PR> > /tmp/review-swarm-<PR>.diff
BASE=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name)
git fetch origin
git merge-base origin/$BASE origin/<headRefName>   # the real base, never a remembered sha

Note the linked issue: Closes #N / Fixes #N in the PR body, or the branch name. Fetch it with gh issue view N --json title,body and pass its acceptance criteria to reviewer 3 verbatim. If there is no linked issue, say so and let reviewer 3 fall back to the PR description.

Pass to every subagent: the PR number, the diff path, the merge-base sha, the repo root.

Step 1 — spawn all four in one message

They are independent. One message, four Agent calls, or they run serially and cost four times the wall clock. Every one of them gets these standing instructions:

  • Findings only. No praise, no summary of what the PR does, no scope creep.
  • Every finding carries a file:line from the current tree. A finding you cannot cite is not a finding; drop it yourself rather than making the orchestrator do it.
  • Read the surrounding file, not only the diff hunk. Most of these bugs are in the interaction between the new lines and the old ones.
  • If a check is impossible (no test runner, no linked issue), say so explicitly. Do not substitute a different check and report it as if it were the one asked for.

Read the full file on GitHub · 171 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. 5d ago First seen · 171 lines · 40 tokens per session scan A abeb1cc30227

Subscribe to this mod's changes

review-swarm is a command published in the GitHub repository kikocastro/markdown-mindmap (11 stars, last pushed 2d ago), licensed MIT. It adds 40 tokens to every session and 2,000 once invoked, about $0.0002 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-30.