code-review-swarm — Claude Code subagent: setup and review
code-review-swarm deploys coordinated AI review agents against pull requests via the GitHub CLI. It flags security flaws and architecture drift before merging.
no license ★ 850 updated 2026-10-26
.claude/agents/code-review-swarm.mdWhat code-review-swarm does
This subagent orchestrates focused review roles across code diffs pulled directly through gh. Instead of relying solely on linters, it triggers npx ruv-swarm to evaluate security risks and code structure. Critical findings can directly block the pull request.
A working GitHub CLI session is mandatory. The pre-hook runs gh auth status and halts immediately if authentication is missing. Under the hood, it runs Bash commands and relies on claude-flow MCP tools to coordinate child agents. Thresholds and required checks are controlled by .github/review-swarm.yml.
What it helps with
- inspect pull requests for OWASP vulnerabilities and secret exposure
- detect inefficient database queries and memory allocation issues
- evaluate SOLID design patterns and module coupling
- post structured review comments directly to GitHub using
gh
Example prompts for the agent
- Run code-review-swarm on PR 123 and post the findings
- Perform a security review on PR 42 with suggested fixes
- Analyze architectural coupling and performance bottlenecks for this pull request
How to install code-review-swarm
Manually: put the files in place
.claude/agents/code-review-swarm.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/code-review-swarm.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/code-review-swarm.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about code-review-swarm
How to install code-review-swarm in Claude Code?
Save the subagent configuration file directly into .claude/agents/code-review-swarm.md in your project root.
What does code-review-swarm do?
It orchestrates specialized review agents focusing on security, performance, architecture, and styling. Findings are evaluated against quality gates and submitted to GitHub via CLI.
What are the prerequisites for this subagent?
You must authenticate using gh auth login. The subagent pre-hook executes gh auth status and exits with an error if GitHub credentials are missing.