code-review-swarm — Claude Code command: what it does, how to install
code-review-swarm sends a pull request through several review agents at once: security, performance, style, architecture. Handy when a plain diff and a linter no longer catch the trouble.
no license ★ 850 updated 2026-10-26
.claude/commands/code-review-swarm.mdWhat code-review-swarm does
The command file maps out a review flow that runs on gh and npx ruv-swarm. It pulls PR metadata plus the diff, starts a swarm with named agents (security, performance, style, architecture, accessibility), then writes the findings back to the pull request as a comment or a review.
Behaviour lives in .github/review-swarm.yml. You choose required and optional agents, map each to a threshold (security blocks, performance warns, style suggests), and add rules such as no eval or no secrets hardcoded in source. Path triggers route **/auth/** to the security and architecture agents, while **/api/** pulls in performance checks.
Nothing runs until gh is authenticated, because every step calls gh pr view or gh pr review. The sample GitHub Actions job logs in with GITHUB_TOKEN through gh auth login --with-token.
What it helps with
- get a security agent over a pull request before merge
- spot leaked secrets and weak auth checks in the diff
- compare the change against
mainfor load impact - sort findings by threshold so security blocks and performance only warns
- wire automatic review to the
pull_requestevent in GitHub Actions
Example prompts for the agent
- /code-review-swarm run the security and performance agents over PR 123
- /code-review-swarm check this diff for leaked secrets and N+1 queries
- /code-review-swarm set the style threshold to suggest in
.github/review-swarm.yml
How to install code-review-swarm
Manually: put the files in place
.claude/commands/code-review-swarm.mdCall it with /code-review-swarm. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/code-review-swarm.mdCall it with /prompts:code-review-swarm. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/code-review-swarm.prompt.mdManually: put the files in place
.gemini/commands/code-review-swarm.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about code-review-swarm
How do I install code-review-swarm in Claude Code?
Place the command file in your repo at .claude/commands/code-review-swarm.md. It then appears among the project's slash commands.
What does code-review-swarm do?
It walks an agent swarm through a pull request: security, performance, style, architecture and accessibility passes. Findings go back to the PR as a comment or review via gh.
What does it need in order to run?
An authenticated gh, since the PR is read and the result written with it. The agents themselves run through npx ruv-swarm.