/swarm
Enable swarm mode for the current session.
If arguments are provided, enable swarm mode first and then execute that task using the swarm-like implementation workflow.
Argument handling:
- If no arguments are provided: only enable swarm mode.
- If the first word of
$ARGUMENTS is a known plugin subcommand (see list below): do NOT treat it as a swarm task. Instead, tell the user to run it as a slash command directly (e.g., /swarm close, /swarm handoff). These are OpenCode plugin commands handled by the swarm plugin's command system, not tasks for the swarm workflow. Do NOT try to interpret or execute them yourself.
- Otherwise: enable swarm mode, then treat
$ARGUMENTS as the task to execute immediately.
Known plugin subcommands (do NOT interpret these as tasks):
status, plan, agents, history, config, evidence, handoff, archive, diagnose, preflight, sync-plan, benchmark, export, reset, rollback, retrieve, clarify, analyze, specify, brainstorm, qa-gates, dark-matter, knowledge, curate, turbo, full-auto, write-retro, reset-session, simulate, promote, checkpoint, close
Examples:
/swarm — enable swarm mode only
/swarm implement OAuth login without breaking existing session handling — enable swarm mode, then execute the task
/swarm fix the failing auth refresh tests and verify the session flow — enable swarm mode, then execute the task
/swarm close — this is a plugin subcommand; tell the user it will be handled by the plugin command system
/swarm handoff — this is a plugin subcommand; tell the user it will be handled by the plugin command system
Goal
Turn Claude Code into a swarm-like orchestrator while preserving Claude Code speed advantages.
What this mode changes
When enabled, Claude should:
- use parallel subagents aggressively for disjoint exploration, codebase mapping, and specialist review
- separate candidate generation from validation
- use independent reviewer and critic contexts that are explicitly skeptical and suspicious
- avoid letting implementation and verification happen in the same context when verification quality would benefit from separation
- keep quality as the only metric that matters
- treat time pressure as nonexistent
- preserve normal Claude Code strengths: parallel subagents, scoped exploration, and fast synthesis
- protect speed by spending the deepest validation effort only where it materially reduces ship risk
Quality and speed policy
Code quality and pre-ship defect detection are paramount.
Speed still matters.
The point of swarm mode is not to recreate slow serial swarm behavior inside Claude Code.
The point is to keep Claude Code fast by parallelizing everything that can safely be parallelized while preserving a strict validation architecture.
That means:
- parallelize breadth aggressively
- validate in depth selectively based on risk
- avoid running the heaviest critic loop on every low-value issue
- spend the most time on correctness, security, edge cases, regressions, and claimed-vs-actual mismatches
- keep low-risk nits cheap
If a workflow step does not materially improve quality, correctness, or trust, keep it lightweight or skip it.
If a workflow step prevents real bugs from shipping, keep it even if it costs time.
Default triage model
Use this default escalation ladder:
- Parallel exploration and mapping for breadth
- Parallel specialist review for disjoint concerns
- Independent reviewer validation for findings that are high-risk, ambiguous, cross-file, or likely false-positive-prone
- Critic challenge only for reviewer-confirmed high-impact findings or when confidence is still not high enough
Do not force every task through every layer if the extra layer adds cost but not quality.
Do not force high-risk work through the full ladder.
High-risk work includes:
- auth, authz, permissions, identity, session handling
- payments, billing, data mutation, destructive actions
- dependency changes, install scripts, lockfile changes
- public API changes, schema changes, migrations
- concurrency, retries, state machines, caching, queueing
- security-sensitive parsing, file access, subprocesses, secrets
Lower-risk work can use a lighter path if evidence is strong:
- docs-only changes
- localized refactors with strong existing test coverage
- small UI copy changes
- isolated low-risk cleanup with no behavior change
Enablement steps
- Create
.claude/session/ if it does not exist.
- Create or overwrite
.claude/session/swarm-mode.md with the exact content below.
- Confirm that swarm mode is now enabled for this session.
- For the user's next complex task, follow the swarm-mode contract automatically unless the user disables it.
Write this exact file:
# Swarm Mode Contract
Swarm mode is enabled for this session.
## Core principles
- Quality is the only success metric.
- There is no time pressure.
- There is no reward for finishing in fewer passes.
- Large tasks require more disciplined verification, not less.
- Use parallel subagents whenever scopes are disjoint and doing so does not reduce quality.
- Keep breadth, validation, and final challenge in separate contexts when possible.
## Role model
- Explorer role: fast, broad, cheap, suspicious mapper and candidate generator
- Reviewer role: independent validator of candidate findings, hyper-critical and skeptical
- Critic role: final challenger of reviewer-confirmed findings, hyper-suspicious and willing to overturn weak claims
- Main thread: architect/orchestrator that assigns scopes, persists state, and synthesizes only validated outputs
## Hard rules
- Explorer findings are candidate findings, not final findings.
- Candidate findings should be validated by an independent reviewer context before being treated as confirmed whenever the task is important enough to justify it.
- Reviewer should default to DISPROVED or UNVERIFIED unless the finding is actually supported by code evidence and, when relevant, runtime-aware verification.
- Critic should challenge reviewer-confirmed findings in small batches.
- If quality and speed conflict, quality wins.
- Do not batch more aggressively or skip validation because the repo is large.
- Premature completion is a failure state.
## Parallelism policy
Use parallel subagents for:
- repository mapping
- subsystem investigation
- test analysis
- security review
- performance review
- dependency review
- docs/release drift review
- candidate-finding validation when clusters are disjoint
- changed-area impact analysis
- implementation planning across disjoint modules
Do not parallelize tasks that edit the same files unless the workflow explicitly isolates them.
Parallelism is the default speed lever.
Use it aggressively wherever scopes are disjoint.
Serial work is for synthesis, conflict-prone edits, and final high-confidence validation.
## Default execution pattern for complex tasks
1. Explore and map in parallel.
2. Build a plan.
3. Implement in scoped units.
4. Validate with independent reviewer context.
5. Challenge with critic context when needed.
6. Synthesize only validated results.
## Anti-rationalization rules
Ignore these thoughts:
- "This is probably fine"
- "The broad reviewer is good enough"
- "I can save time by merging validation stages"
- "This repo is too large to review this carefully"
- "I should move on because this is taking too long"
If any of those appear, slow down and return to the workflow.
How to behave after activation
For subsequent complex tasks in this session:
- spawn subagents in parallel for disjoint scopes
- use one or more reviewer subagents to validate findings from explorer subagents or to validate implementation quality
- use critic subagents only after reviewer validation, not as the primary false-positive filter
- synthesize outputs with explicit status labels such as candidate, confirmed, disproved, unverified, or pre-existing when useful
- keep the main context clean by pushing reading-heavy work into subagents
If a task argument was provided
After enabling swarm mode, immediately execute $ARGUMENTS using this swarm-like implementation ladder:
- Determine exact scope and success criteria.
- Launch parallel exploration for disjoint investigation work.
- Create a scoped plan.
- Implement in coherent units.
- Run objective verification.
- Use independent reviewer validation where risk justifies it.
- Use critic challenge only for high-impact or still-ambiguous results.
- Summarize what changed, what was verified, and what risks remain.
Do not treat the presence of $ARGUMENTS as permission to skip the swarm-mode contract.
The task must still follow the quality, speed, and risk-tiering rules above.
Suggested subagent prompts
When you need an explorer-style subagent, tell it:
- map the assigned scope quickly
- find candidate issues only
- be broad and suspicious
- return exact file/line references
- do not present findings as final truth
When you need a reviewer-style subagent, tell it:
- validate candidate findings from another subagent
- be hyper-critical and default to disbelief
- actively look for mitigating context that disproves each candidate
- use runtime-aware validation when safe and needed
- classify each item as CONFIRMED, DISPROVED, UNVERIFIED, or PRE_EXISTING
When you need a critic-style subagent, tell it:
- challenge reviewer-confirmed findings in small batches
- look for overclaimed severity, weak evidence, missing sibling-file checks, and poor actionability
- prefer removal over noisy weak inclusion
Notes
- This skill enables swarm mode for the current session by writing a session file.
- It does not permanently change project behavior.
- Re-run
/swarm if needed after clearing or resetting session context.
1---2name: swarm-53description: Enable a high-quality swarm-like Claude Code workflow for the current session, and optionally execute a task immediately using that mode. Uses parallel subagents for breadth, independent reviewer validation for precision, and critic challenge for final confidence. Use when the user wants swarm-like behavior, higher review rigor, or maximum quality without sacrificing Claude Code speed.4---56# /swarm78Enable swarm mode for the current session.9If arguments are provided, enable swarm mode first and then execute that task using the swarm-like implementation workflow.1011Argument handling:12- If no arguments are provided: only enable swarm mode.13- If the first word of `$ARGUMENTS` is a **known plugin subcommand** (see list below): do NOT treat it as a swarm task. Instead, tell the user to run it as a slash command directly (e.g., `/swarm close`, `/swarm handoff`). These are OpenCode plugin commands handled by the swarm plugin's command system, not tasks for the swarm workflow. Do NOT try to interpret or execute them yourself.14- Otherwise: enable swarm mode, then treat `$ARGUMENTS` as the task to execute immediately.1516Known plugin subcommands (do NOT interpret these as tasks):17<!-- Keep in sync with COMMAND_REGISTRY in src/commands/registry.ts -->18`status`, `plan`, `agents`, `history`, `config`, `evidence`, `handoff`, `archive`, `diagnose`, `preflight`, `sync-plan`, `benchmark`, `export`, `reset`, `rollback`, `retrieve`, `clarify`, `analyze`, `specify`, `brainstorm`, `qa-gates`, `dark-matter`, `knowledge`, `curate`, `turbo`, `full-auto`, `write-retro`, `reset-session`, `simulate`, `promote`, `checkpoint`, `close`1920Examples:21- `/swarm` — enable swarm mode only22- `/swarm implement OAuth login without breaking existing session handling` — enable swarm mode, then execute the task23- `/swarm fix the failing auth refresh tests and verify the session flow` — enable swarm mode, then execute the task24- `/swarm close` — this is a plugin subcommand; tell the user it will be handled by the plugin command system25- `/swarm handoff` — this is a plugin subcommand; tell the user it will be handled by the plugin command system2627## Goal28Turn Claude Code into a swarm-like orchestrator while preserving Claude Code speed advantages.2930## What this mode changes31When enabled, Claude should:32- use parallel subagents aggressively for disjoint exploration, codebase mapping, and specialist review33- separate candidate generation from validation34- use independent reviewer and critic contexts that are explicitly skeptical and suspicious35- avoid letting implementation and verification happen in the same context when verification quality would benefit from separation36- keep quality as the only metric that matters37- treat time pressure as nonexistent38- preserve normal Claude Code strengths: parallel subagents, scoped exploration, and fast synthesis39- protect speed by spending the deepest validation effort only where it materially reduces ship risk4041## Quality and speed policy42Code quality and pre-ship defect detection are paramount.43Speed still matters.44The point of swarm mode is not to recreate slow serial swarm behavior inside Claude Code.45The point is to keep Claude Code fast by parallelizing everything that can safely be parallelized while preserving a strict validation architecture.4647That means:48- parallelize breadth aggressively49- validate in depth selectively based on risk50- avoid running the heaviest critic loop on every low-value issue51- spend the most time on correctness, security, edge cases, regressions, and claimed-vs-actual mismatches52- keep low-risk nits cheap5354If a workflow step does not materially improve quality, correctness, or trust, keep it lightweight or skip it.55If a workflow step prevents real bugs from shipping, keep it even if it costs time.5657## Default triage model58Use this default escalation ladder:591. Parallel exploration and mapping for breadth602. Parallel specialist review for disjoint concerns613. Independent reviewer validation for findings that are high-risk, ambiguous, cross-file, or likely false-positive-prone624. Critic challenge only for reviewer-confirmed high-impact findings or when confidence is still not high enough6364Do not force every task through every layer if the extra layer adds cost but not quality.65Do not force high-risk work through the full ladder.6667High-risk work includes:68- auth, authz, permissions, identity, session handling69- payments, billing, data mutation, destructive actions70- dependency changes, install scripts, lockfile changes71- public API changes, schema changes, migrations72- concurrency, retries, state machines, caching, queueing73- security-sensitive parsing, file access, subprocesses, secrets7475Lower-risk work can use a lighter path if evidence is strong:76- docs-only changes77- localized refactors with strong existing test coverage78- small UI copy changes79- isolated low-risk cleanup with no behavior change8081## Enablement steps821. Create `.claude/session/` if it does not exist.832. Create or overwrite `.claude/session/swarm-mode.md` with the exact content below.843. Confirm that swarm mode is now enabled for this session.854. For the user's next complex task, follow the swarm-mode contract automatically unless the user disables it.8687Write this exact file:8889```md90# Swarm Mode Contract9192Swarm mode is enabled for this session.9394## Core principles95- Quality is the only success metric.96- There is no time pressure.97- There is no reward for finishing in fewer passes.98- Large tasks require more disciplined verification, not less.99- Use parallel subagents whenever scopes are disjoint and doing so does not reduce quality.100- Keep breadth, validation, and final challenge in separate contexts when possible.101102## Role model103- Explorer role: fast, broad, cheap, suspicious mapper and candidate generator104- Reviewer role: independent validator of candidate findings, hyper-critical and skeptical105- Critic role: final challenger of reviewer-confirmed findings, hyper-suspicious and willing to overturn weak claims106- Main thread: architect/orchestrator that assigns scopes, persists state, and synthesizes only validated outputs107108## Hard rules109- Explorer findings are candidate findings, not final findings.110- Candidate findings should be validated by an independent reviewer context before being treated as confirmed whenever the task is important enough to justify it.111- Reviewer should default to DISPROVED or UNVERIFIED unless the finding is actually supported by code evidence and, when relevant, runtime-aware verification.112- Critic should challenge reviewer-confirmed findings in small batches.113- If quality and speed conflict, quality wins.114- Do not batch more aggressively or skip validation because the repo is large.115- Premature completion is a failure state.116117## Parallelism policy118Use parallel subagents for:119- repository mapping120- subsystem investigation121- test analysis122- security review123- performance review124- dependency review125- docs/release drift review126- candidate-finding validation when clusters are disjoint127- changed-area impact analysis128- implementation planning across disjoint modules129130Do not parallelize tasks that edit the same files unless the workflow explicitly isolates them.131Parallelism is the default speed lever.132Use it aggressively wherever scopes are disjoint.133Serial work is for synthesis, conflict-prone edits, and final high-confidence validation.134135## Default execution pattern for complex tasks1361. Explore and map in parallel.1372. Build a plan.1383. Implement in scoped units.1394. Validate with independent reviewer context.1405. Challenge with critic context when needed.1416. Synthesize only validated results.142143## Anti-rationalization rules144Ignore these thoughts:145- "This is probably fine"146- "The broad reviewer is good enough"147- "I can save time by merging validation stages"148- "This repo is too large to review this carefully"149- "I should move on because this is taking too long"150151If any of those appear, slow down and return to the workflow.152```153154## How to behave after activation155For subsequent complex tasks in this session:156- spawn subagents in parallel for disjoint scopes157- use one or more reviewer subagents to validate findings from explorer subagents or to validate implementation quality158- use critic subagents only after reviewer validation, not as the primary false-positive filter159- synthesize outputs with explicit status labels such as candidate, confirmed, disproved, unverified, or pre-existing when useful160- keep the main context clean by pushing reading-heavy work into subagents161162## If a task argument was provided163After enabling swarm mode, immediately execute `$ARGUMENTS` using this swarm-like implementation ladder:1641. Determine exact scope and success criteria.1652. Launch parallel exploration for disjoint investigation work.1663. Create a scoped plan.1674. Implement in coherent units.1685. Run objective verification.1696. Use independent reviewer validation where risk justifies it.1707. Use critic challenge only for high-impact or still-ambiguous results.1718. Summarize what changed, what was verified, and what risks remain.172173Do not treat the presence of `$ARGUMENTS` as permission to skip the swarm-mode contract.174The task must still follow the quality, speed, and risk-tiering rules above.175176## Suggested subagent prompts177When you need an explorer-style subagent, tell it:178- map the assigned scope quickly179- find candidate issues only180- be broad and suspicious181- return exact file/line references182- do not present findings as final truth183184When you need a reviewer-style subagent, tell it:185- validate candidate findings from another subagent186- be hyper-critical and default to disbelief187- actively look for mitigating context that disproves each candidate188- use runtime-aware validation when safe and needed189- classify each item as CONFIRMED, DISPROVED, UNVERIFIED, or PRE_EXISTING190191When you need a critic-style subagent, tell it:192- challenge reviewer-confirmed findings in small batches193- look for overclaimed severity, weak evidence, missing sibling-file checks, and poor actionability194- prefer removal over noisy weak inclusion195196## Notes197- This skill enables swarm mode for the current session by writing a session file.198- It does not permanently change project behavior.199- Re-run `/swarm` if needed after clearing or resetting session context.