Sno Station
Sno Station is your agents' workstation: open-source software that turns the AI agents you already run into one squad on your own machine. Two heads are better than one, and they get better with every
Architect-centric agentic swarm plugin for OpenCode. Hub-and-spoke orchestration with SME consultation, code generation, and QA review.
PluginsTypeScript · JavaScriptGitHub @ZaxbyHubSelf-installOwner unconfirmed
Paste into Claude or ChatGPT for installation instructions suited to your environment.
Have you tried it? One tap is enough. No sign-in needed.
Loading the full README. The saved excerpt is shown below.
Your AI writes the code. Swarm proves it works.
Closing the trust gap between "the model said it's done" and "this actually works in production."
OpenCode Swarm is a plugin for OpenCode that turns a single AI coding session into an architect-led team of specialized core, optional, and conditional agents. Run /swarm agents for the live roster; it is generated from the current plugin configuration. One agent writes the code. A different agent reviews it. Another writes and runs tests. Another checks security. Nothing ships until every required gate passes.Read the full README ↗Closing the trust gap between "the model said it's done" and "this actually works in production."
Website · Getting Started · Configuration · Architecture
OpenCode Swarm is a plugin for OpenCode that turns a single AI coding session into an architect-led team of specialized core, optional, and conditional agents. Run /swarm agents for the live roster; it is generated from the current plugin configuration. One agent writes the code. A different agent reviews it. Another writes and runs tests. Another checks security. Nothing ships until every required gate passes.
bunx opencode-swarm install
This single command installs the package, registers it as an OpenCode plugin, disables conflicting default agents, and creates a ready-to-edit config at
~/.config/opencode/opencode-swarm.json. Requires Bun >= 1.3.13 (bun --versionto check), or Node.js >= 22.13 for npm installs (the Node-hosted sidecar uses the built-innode:sqlite). If you must use npm:npm install -g opencode-swarm && opencode-swarm install.
First-run note: the installer registers the plugin, writes the global plugin config, creates a project override when missing, and disables the native
exploreandgeneralagents inopencode.json. If you are not using a Swarm architect, the Swarm gates, reviewers, and test agents are bypassed. Open the OpenCode agent or mode picker and choose the Swarm architect when needed.
Most AI coding tools let one model write code and ask that same model whether the code is good. That misses too much. Swarm separates planning, implementation, review, testing, and documentation into specialized internal roles — and enforces gated execution so agents never mutate the codebase in parallel unless their scopes are proven disjoint (v8 parallel lanes, Epic waves), and then each in its own isolated worktree.
| Surface | Entry point |
|---|---|
swarm-implement.yml gated GitHub Action | swarm:implement issue label or workflow_dispatch — runs the implementation pipeline and opens an evidence PR |
/swarm agents for the live roster — that is the source of truth, not this list.external_skills.curation_enabled: true in config). Includes 7 tools: external_skill_discover, external_skill_list, external_skill_inspect, external_skill_promote, external_skill_reject, external_skill_delete, external_skill_revoke. Candidates pass through a 3-gate validation pipeline before evaluation: prompt injection scan (12 regex patterns), unsafe instruction scan (25 patterns), and provenance integrity check (SHA-256, timestamp, URL, publisher, and hash verification)./swarm skill-opt plan|run|status|diff|approve|reject|rollback|history) that drives one allowlisted SKILL.md candidate at a time through deterministic draft → smoke → evaluation-substrate validation → manual approval → atomic activation/rollback. Bounded, restartable, reversible, and unable to mutate source/harness/security surfaces. Disabled by default (skill_opt.enabled: false); see docs/skill-optimizer.md.The Swarm architect coordinates all internal agents automatically. You never manually switch between internal roles. If the active OpenCode agent is not a Swarm architect, the plugin workflow is bypassed.
Swarm includes comprehensive static analysis for shell commands to detect and intercept file write operations before execution.
POSIX shell detection — Parses commands with bash-parser AST for accurate detection of:
>, >>, >|, <<, <<-)cp, mv, install, ln, truncate, dd)sed -i, perl -i, awk -i)python -c, node -e, bun -e, ruby -e, php -r)curl -o, wget -O, scp)tar -x, unzip, gunzip)git clean -fd, git reset --hard)Windows shell detection — Uses regex heuristics for PowerShell and cmd.exe:
Out-File, Set-Content, Add-Content, Copy-Item, Move-Itemcopy, move, ren, del, rd, md>, >>)Interactive session denial — Blocks commands that create persistent or open-ended sessions:
watch, screen, tmux new-sessionStart-ProcessCross-process scope enforcement — Declared scope is persisted to .swarm/scopes/scope-{taskId}.json with:
rm -rf, rmdir /s, del /s, Remove-Item -Recurse, rsync --delete) are blocked unless ALL target paths are within the declared scope (coder agents only)The guardrails system blocks destructive shell commands targeting:
/root, /etc, C:\Windows, etc.).swarm/ directoryYou say:
Build me a JWT auth system.
Swarm then:
coder writes code
automated checks run
reviewer checks correctness
test engineer writes and runs tests
architect runs regression sweep
failures loop back with structured feedback
With Epic Mode on, epic_next_wave issues each phase as waves of conflict-free tasks (the same per-task pipeline runs inside every wave), and epic_phase_review runs a reviewer + critic over the whole phase before phase_complete.
All project state lives in .swarm/ — plans, evidence, context, knowledge, and telemetry. Resumable by design. If .swarm/ already exists, the architect goes straight into RESUME → EXECUTE instead of repeating discovery.
Swarm has two independent mode systems:
Session modes — toggle per session with a slash command:
| Mode | Safety | Speed | When to Use |
|---|---|---|---|
| Balanced (default) | High | Medium | Everyday development |
| Turbo | Medium | Fast | Rapid iteration; skips phase_complete Gates 1–5 (Stage A and Stage B still run for every task) |
| Lean Turbo | High | Fast | Parallel lanes for non-conflicting tasks (up to max_parallel_coders coders) |
| Full-Auto | Deterministic policy + critic oversight | Fast | Unattended multi-interaction runs |
| Epic (opt-in) | High — per-task QA always runs; Turbo stays off | Fast on plans with many independent tasks | Large plans: one plan = one epic, run phase by phase as parallel waves of tasks with disjoint scopes |
Auto-proceed — a session toggle (/swarm auto-proceed [on|off]) that skips the "Ready for Phase N+1?" prompt at phase boundaries. Defaults to false; set as a plan default via execution_profile.auto_proceed during QA GATE SELECTION. Session override always wins. Independent of Full-Auto.
Full-Auto reduces approval friction by deterministically allowing safe operations (read-only tools, in-scope writes, safe shell) and routing every ambiguous or high-risk action (writes to plugin/build/guardrail paths, network, dependency changes, plan/phase mutations, subagent delegation) through the read-only critic_oversight agent before it executes. Denials are returned to the agent as structured signals so it can choose a safer path; repeated denials pause the run; phase completion requires an APPROVED oversight record. See docs/modes.md for mode, permission_policy, denials, and oversight config keys, fail-closed semantics, and recovery from a paused run.
Epic binds to the current plan and runs fully on OpenCode 1.x and OpenCode 2 (7.x plugin). On OpenCode 2 the v2 adapter ships a session-capable client, places coder worktree sessions with an eager parentless create (#3169 Phase 3), and — since #3169 Phase 4 — dispatches human-typed /swarm commands natively, so the full flow (/swarm epic start → waves → phase review → close) is available there; the remaining live-host verification legs are tracked on #3169, and the dual-host CI lane has landed (merge-queue v2 smoke cell, weekly host-contract v2 digest, and a vendored-pin freshness notice). The epic itself is always opened by the user (human-only policy — the agent cannot start one on any host). /swarm epic start also refuses plans too small to benefit and suggests Balanced. The epic_next_wave tool then dispatches each phase as waves of tasks whose declared scopes don't conflict; in a git project each coder works in an isolated worktree on an epic branch, and /swarm epic close squash-lands the work as staged changes for you to review. Every task in a wave still runs the full per-task QA pipeline (Stage A and Stage B). Epic learns which files tasks tend to write together and uses it to plan later waves and epics. See docs/modes.md; maintainers start with src/epic/README.md.
Project mode — persistent via execution_mode config key:
| Value | Effect |
|---|---|
strict | Maximum safety — adds slop-detector and incremental-verify hooks |
balanced (default) | Standard hooks |
fast | Skips compaction service — for short sessions under context pressure |
Switch session modes with /swarm turbo [on|off], /swarm full-auto [on|off], or /swarm epic start|close (Epic needs "epic": {"mode": {"enabled": true}} in config). Control phase-boundary auto-proceed with /swarm auto-proceed [on|off]. Set project mode in config. Lean Turbo is configured in turbo.lean.* in config and composes with all session modes. See docs/modes.md.
→ For a complete first-run walkthrough, see Getting Started.
The 15-minute guide covers:
bunx opencode-swarm install)The installer automatically:
opencode-swarm to the OpenCode plugin listexplore and general agents to reduce routing conflictsIt does not create a project config. .opencode/opencode-swarm.json is opt-in — create it yourself only if you want project-level overrides of the global config.
No animated GIF is shipped in the repo — instead, here is the exact terminal session you can record yourself with asciinema rec demo.cast (or any screen recorder). Every command below is real and runs against this repo as published.
Recording script (copy/paste-able, ~30 seconds):
# 1. Install the plugin (5s)
bunx opencode-swarm install
# 2. Open opencode and select a Swarm architect if it is not already active
opencode
# 3. Inside the OpenCode session, verify Swarm is live (5s)
/swarm help
/swarm agents
# 4. Kick off a task — the architect plans, then gates fire automatically (15s)
Build me a JWT auth helper with tests.
# 5. Watch the gates land in real time (5s)
/swarm status
/swarm evidence
ASCII storyboard of what a viewer should see:
┌──────────────────────────────────────────────────────────────┐
│ $ bunx opencode-swarm install │
│ ✓ installed opencode-swarm │
│ │
│ $ opencode │
│ [Swarm] Welcome! Architect auto-selected. Type /swarm help │
│ │
│ > /swarm help │
│ Available commands: status, plan, agents, help, diagnose... │
│ │
│ > Build me a JWT auth helper with tests. │
│ [architect] PLAN → critic gate → APPROVED │
│ [coder] task 1.1 implementing… │
│ [reviewer] correctness OK │
│ [test_eng.] 3 tests written, 3 pass │
│ [architect] regression sweep clean → phase_complete │
│ │
│ > /swarm evidence │
│ task 1.1: review ✓ tests ✓ sast ✓ secrets ✓ drift ✓ │
└──────────────────────────────────────────────────────────────┘
Each row corresponds to a real gate documented further down this README — none are simulated.
OpenCode caches plugins indefinitely. A normal OpenCode restart does not pull newer versions from npm — once a plugin is cached, OpenCode keeps using that exact copy on every subsequent launch (issue #675). The cache lives in several places depending on your platform and OpenCode version:
~/.cache/opencode/node_modules/opencode-swarm/~/.config/opencode/node_modules/opencode-swarm/~/.cache/opencode/packages/opencode-swarm@latest/~/.cache/opencode/packages/opencode-swarm/~/Library/Caches/opencode/..., %LOCALAPPDATA%\opencode\..., or %APPDATA%\opencode\...The updater also clears known OpenCode lock files (bun.lock, bun.lockb, and package-lock.json) so the next start resolves the latest package.
To upgrade to the latest published version (clears all known layouts automatically):
bunx opencode-swarm update # cache-only refresh, then restart opencode
# or
bunx opencode-swarm install # full reinstall (re-asserts config), then restart opencode
/swarm diagnose shows the running version and, when available, the latest
version on npm so you can tell at a glance whether your cache is stale.
To disable the background staleness check entirely, set version_check: false
in your opencode-swarm.json.
Common subcommands at a glance:
/swarm help [command] # List all commands or get detailed help for a specific command
/swarm status # Current phase and task
/swarm show-plan [N] # Full plan or filtered by phase
/swarm agents # Registered agents and models
/swarm diagnose # Health check
/swarm evidence [task] # Test and review results
/swarm epic status # Open epic, current wave, landing state (Epic Mode)
/swarm reset --confirm # Clear swarm state
Use /swarm help to see all available commands categorized by function. Use /swarm help <command> for detailed usage information on a specific command.
Nine commands display a ⚠️ warning in help output because they share names with Claude Code built-in slash commands (e.g., /plan, /reset, /status). The warning reminds you to always use /swarm <command> — the bare CC command does something different and sometimes destructive. See docs/commands.md#claude-code-command-conflicts for the full conflict registry.
See docs/commands.md for the full reference. The live source of truth is src/commands/registry.ts, which includes canonical commands, compound commands, and deprecated aliases.
Some commands are available under deprecated names for backwards compatibility. Using the canonical name is recommended:
| Alias (deprecated) | Canonical command |
|---|---|
/swarm config-doctor | /swarm config doctor |
/swarm diagnosis | /swarm diagnose |
/swarm evidence-summary | /swarm evidence summary |
/swarm doctor | /swarm config doctor |
/swarm info | /swarm status |
/swarm list-agents | /swarm agents |
/swarm health | /swarm diagnose |
/swarm plan | /swarm show-plan |
/swarm close | /swarm finalize |
/swarm check | /swarm preflight |
/swarm clear | /swarm reset-session |
Aliases are hidden from help output but still function. The canonical command should be used in scripts and documentation.
Swarm registers a roster of specialized core, optional, and conditional agents. The exact count shifts as agents are added or feature-flagged, so treat /swarm agents as the live source of truth — that command lists what is actually registered in your session. You don't manually switch between them — the architect coordinates automatically.
| Agent | Role | Badge |
|---|---|---|
| architect | Orchestrates workflow, writes plans, enforces gates | Core |
| explorer | Scans codebase, gathers context, maps facts | Core |
| coder | Implements one task at a time (or concurrently in isolated worktrees for provably file-disjoint task groups — v8, #1674) | Core |
| reviewer | Checks correctness and security (also reviews a whole phase under Epic Mode via epic_phase_review) | Core |
| test_engineer | Writes and runs tests, adversarial testing | Core |
| critic | Reviews plans before implementation begins (also challenges a whole phase under Epic Mode via epic_phase_review) | Core |
| critic_finding_validator | Independently confirms, disproves, or leaves reviewer findings unverified | Core |
| critic_oversight | Sole quality gate in full-auto autonomous mode | Core |
| sme | Provides domain expertise guidance | Core |
| docs | Updates documentation to match implementation | Core |
| designer | Generates UI scaffolds and design tokens | Conditional |
| critic_sounding_board | Pre-escalation pushback to the architect | Optional |
| critic_drift_verifier | Verifies implementation matches spec | Optional |
| critic_hallucination_verifier | Verifies APIs and citations against real sources | Optional |
| curator_init | Consolidates prior knowledge at session start | Optional |
| curator_phase | Consolidates phase outcomes, detects workflow drift | Optional |
| council_generalist | Broad analytical voice in the General Council (uses reviewer model) |
Legend: Core = always available, Optional = available by default (can be disabled), Conditional = requires specific feature config (ui_review or council)
Run /swarm status and /swarm agents to see what's active.
graph TB
subgraph Orchestration
A[Architect]
end
subgraph Discovery
E[Explorer]
end
subgraph Execution
C[Coder]
T[Test Engineer]
D[Designer]
end
subgraph Quality
R[Reviewer]
CR[Critic]
CO[Critic Oversight]
CSB[Critic Sounding Board]
CDV[Critic Drift Verifier]
CHV[Critic Hallucination Verifier]
end
subgraph Support
S[SME]
DOC[Docs]
CI[Curator Init]
CP[Curator Phase]
end
subgraph Council
CM[Council Member]
CMO[Council Moderator]
end
A -->|Discover| E
E -->|Context| A
A -->|Consult| S
S -->|Guidance| A
A -->|Design| D
D -->|Scaffold| C
A -->|Implement| C
C -->|Review| R
R -->|Verify| A
C -->|Test| T
T -->|Results| A
A -->|Deliberate| CM
CM -->|Verdict| A
Both projects compared here have since been renamed: oh-my-opencode is now OmO and get-shit-done is now GSD Core. The table reflects them as they were when it was written (April 2026, v6.81.0) and has not been re-checked against their current releases.
| Feature | Swarm | oh-my-opencode (now OmO) | get-shit-done (now GSD Core) |
|---|---|---|---|
| Multiple specialized agents | ✅ Core + optional + conditional roster (/swarm agents) | ❌ | ❌ |
| Plan reviewed before coding | ✅ | ❌ | ❌ |
| Every task reviewed + tested | ✅ | ❌ | ❌ |
| Different model for review vs. code | ✅ | ❌ | ❌ |
| Shell write detection (POSIX/PowerShell/cmd) | ✅ | ❌ | ❌ |
| Scope enforcement with cross-process persistence | ✅ | ❌ | ❌ |
| Interactive session detection and blocking | ✅ | ❌ | ❌ |
| Resumable sessions | ✅ | ❌ | ❌ |
| Built-in security scanning | ✅ | ❌ | ❌ |
| Learns from mistakes | ✅ | ❌ | ❌ |
| Parallel tasks refused at dispatch unless their scopes are conflict-free (Epic Mode) | ✅ | ❌ | ⚠️ overlap check only falls back to sequential |
| Conflict prediction from git co-change history (Epic Mode) | ✅ | ❌ | ❌ |
| Learns per-file risk of undeclared writes across runs (Epic Mode) | ✅ | ❌ | ❌ |
| Plan-restructuring suggestions with predicted speedup (Epic Mode) | ✅ | ❌ | ❌ |
Swarm works with any provider supported by OpenCode.
No API key required. Excellent starting point:
{
"agents": {
"coder": { "model": "opencode/nemotron-3-ultra-free" },
"reviewer": { "model": "opencode/big-pickle" },
"explorer": { "model": "opencode/big-pickle" }
}
}
For production, mix providers by role:
| Agent | Recommended | Why |
|---|---|---|
| architect | OpenCode UI selection | Needs strongest reasoning |
| coder | minimax-coding-plan/MiniMax-M2.5 | Fast, accurate code generation |
| reviewer | zai-coding-plan/glm-5 | Different training from coder |
| test_engineer | minimax-coding-plan/MiniMax-M2.5 | Same strengths as coder |
| explorer | google/gemini-2.5-flash | Fast read-heavy analysis |
| sme | kimi-for-coding/k2p5 | Strong domain expertise |
| Provider | Format | Example |
|---|---|---|
| OpenCode Zen | opencode/<model> | opencode/big-pickle |
| Anthropic | anthropic/<model> | anthropic/claude-sonnet-4-20250514 |
google/<model> | google/gemini-2.5-flash | |
| Z.ai | zai-coding-plan/<model> | zai-coding-plan/glm-5 |
| MiniMax | minimax-coding-plan/<model> | minimax-coding-plan/MiniMax-M2.5 |
| Kimi | kimi-for-coding/<model> | kimi-for-coding/k2p5 |
Automatic fallback to a secondary model on transient errors (including provider quota exhaustion — e.g. GitHub Copilot's 429 quota exceeded monthly limit):
{
"agents": {
"coder": {
"model": "anthropic/claude-sonnet-4-20250514",
"fallback_models": ["opencode/mimo-v2.6-flash-free"]
}
}
}
Fallback applies to dispatched subagents and to primary (interactive) sessions
alike. For a primary session, a fallback-eligible provider failure on one turn
switches the session's next message to the configured fallback (sticky for the
session; announced by a MODEL FALLBACK: advisory and a model_fallback
telemetry event). Recovery boundaries: session end (or a new session), 30
minutes without any message on the session, or a change to the configured
model chain (the stale selection then reads as absent and the primary is
retried). Switching the session's agent away from the fallback-scoped role
suppresses the override while the other agent is active, but the prior role's
selection persists until the idle window expires — switching back re-applies
it. There is deliberately no in-session code escape (the host's
model-selection surface cannot distinguish a user re-pick from the session
selection). A one-shot opencode run turn that already failed cannot be
re-driven mid-turn — the OpenCode host owns the request loop — so interactive
(TUI/GUI) sessions pick up the fallback on their next message, while a failed
one-shot invocation simply ends; re-run it after resolving the quota.
See docs/configuration.md for full configuration reference.
Swarm monitors agent trajectories and injects course-correction guidance before loops form. Detects five failure patterns:
When detected, escalation levels trigger:
Configure via:
{
"prm": {
"enabled": true,
"pattern_thresholds": {
"repetition_loop": 2,
"ping_pong": 2,
"expansion_drift": 3,
"stuck_on_test": 3,
"context_thrash": 10
}
}
}
Note: Both
max_trajectory_linesandescalation_enabledare enforced at runtime.max_trajectory_linesis the one knob bounding the session trajectory store — the cold-session read, the append-path compaction, and denied-call recording all use it;escalation_enabledgates the escalation ladder (advisory → hard stop). Terminal/cooldown semantics live indocs/configuration.md(Hard-stop episode state machine).
.swarm/plan-ledger.jsonl — authoritative source of truth (v6.44 durability model)
.swarm/context.md — technical decisions and cached SME guidance
.swarm/evidence/ — review/test results per task
.swarm/telemetry.jsonl — session observability events (fire-and-forget, never blocks execution)
.swarm/curator-summary.json — phase-level intelligence and drift reports
.swarm/epic/ — Epic Mode: the open epic, its waves, and close reports with scorecards
.swarm/epic-prior/ — Epic Mode: the learned project prior and past epic reports (survives /swarm close)
Every agent runs inside a circuit breaker that prevents runaway behavior:
| Signal | Default Limit |
|---|---|
| Tool calls | 200 |
| Duration | 30 min |
| Same tool repeated | 10x |
| Consecutive errors | 5 |
Limits reset per task. Per-agent overrides available in config.
Note: Built-in per-agent profiles override the global
max_consecutive_errorsto 8 forarchitect,coder,test_engineer,explorer, andreviewer(src/config/schema.tsDEFAULT_AGENT_PROFILES). The5shown above is theGuardrailsConfigSchemaglobal default that applies only when no per-agent profile sets the value. See docs/installation.md § Guardrails Configuration for the full schema and docs/configuration.md § Per-agent override fields for how to override.
Each agent can only write to specific paths:
.swarm/plan.md, .swarm/plan.json)src/, tests/, docs/, scripts/.swarm/evidence/tests/, .swarm/evidence/Override via authority.rules in config.
Built-in tools verify every task before it ships:
phase_completeThese quality gates run locally. No Docker is required. Config-gated features such as General Council web search can make external API calls only when you enable them and provide a Tavily or Brave Search key.
The Context Budget Guard monitors how full the model's context window is getting across the whole conversation. It helps prevent context overflow before it becomes a problem.
max_injection_tokens. Token counts come from one canonical estimator, estimateTokens in src/hooks/utils.ts (flat ~0.33 tokens/char), unless provider-reported usage is available for the turn, which stays authoritative.context_budget.model_limits entry ("<provider>/<model>", then "<model>", then "default") → the context window the OpenCode host reports for the model you are running (model.limit.context, already provider-specific, so a Copilot entry and a first-party entry for the same model resolve differently) → a static fallback table → 128000 as a last resort when nothing else is known. Set a model_limits entry only if you want a smaller working budget than your model's real window..swarm/context.md. This is informational by itself — execution continues normally./swarm handoff — and, when enforce is true (the default), the guard also prunes the outgoing request (see the next bullet).enforce: true (default), crossing the critical threshold masks eligible completed tool outputs (those older than recent_window turns OR longer than tool_output_mask_threshold characters, in turns not protected by preserve_last_n_turns) and prunes lower-priority messages toward prune_target of the window (best-effort: pruning stops at the target or when no eligible removable message remains, whichever comes first). All of this happens — the current turn's message array as sent to the provider. Your is never rewritten: stored conversation, artifacts, and tool results on disk are untouched. External data — provider-reported usage and the live model limit — is read, never written.To disable entirely, set context_budget.enabled: false in your swarm config.
On-demand status check: architects can invoke the context_status tool at any time to read current context-window headroom (tokens used, model limit, usage percent, threshold state, model ID, provider) without triggering advisory warnings or mutating state. Works even when context_budget.enabled is false.
Swarm includes an intelligent skill propagation system that tracks, validates, and scores skill usage across agent delegations. When the architect delegates to subagents (coder, reviewer, test_engineer, etc.), the system:
.swarm/skill-usage.jsonl with session-scoped entries (agent, task ID, skill paths, timestamp)SKILLS: field, the system suggests relevant skills with relevance scoresSKILLS: field## Available Skills section in .swarm/context.md with usage counts and compliance rates.opencode/skill-routing.yaml maps agent types to specific skill paths with optional keyword descriptionsGuardrails:
Configuration:
{
"skillPropagation": {
"enabled": true,
"enforce": false,
"audiences": []
}
}
enabled (boolean, default true) — turns skill-propagation scoring, recommendations, and warnings on or off. The mandatory explicit-skill-reference integrity check still runs even when this is false.enforce (boolean, default false) — when true, blocks delegations that omit the SKILLS: field instead of only warning.audiences (string array, default [], max 16 entries, de-duplicated) — extra audience tokens to broaden which skills are considered in scope for this project, in addition to the active runner's own audience. Each entry must be a lowercase domain token matching ^[a-z0-9]+(?:[._-][a-z0-9]+)*$; the reserved value swarm-plugin and any runner:* prefix are rejected.Skill routing file format (.opencode/skill-routing.yaml):
version: 1
routing:
coder:
- path: .claude/skills/writing-tests/SKILL.md
keywords: ["test", "testing", "writing tests"]
- path: .claude/skills/engineering-conventions/SKILL.md
keywords: ["engineering", "conventions", "invariants"]
reviewer:
- path: .claude/skills/swarm-pr-review/SKILL.md
keywords: ["review", "security", "audit"]
Routing skills are merged with scored recommendations, with explicitly routed skills receiving a boosted score (0.9) to prioritize them.
Seven skill-management tools (skill_generate, skill_list, skill_apply, skill_inspect, skill_regenerate, skill_retire, skill_improve) are opt-in via the skills.enabled config flag (default false). With the flag off, the tools are host-denied for every agent except the skill_improver specialist (issue #2528): the model never receives their schema, so they are genuinely unreachable — not merely unlisted. With the flag on, the architect regains all seven. Tools remain exported and registered.
Swarm provides tools for managing generated skill lifecycles:
skill_retire — Retires an active generated skill by creating a retired.marker file in its directory. Retired skills are excluded from discovery, scoring, and injection. The SKILL.md file is preserved for auditability. Use skill_retire(slug, reason?) to retire a skill, or pass a reason for tracking purposes.
skill_regenerate — Re-clusters the source knowledge entries for an active skill and updates the SKILL.md in place. Reads the existing SKILL.md frontmatter to identify source knowledge IDs, resolves current entries from knowledge stores, and re-renders the skill content. Falls back to fuzzy slug-based re-clustering if source IDs yield no matches. Skills whose source knowledge is entirely archived are automatically retired during regeneration.
Auto-retire health check — During each curator phase run, skills are automatically evaluated for retirement when:
Auto-retired skills are noted in the phase digest summary. The check is non-blocking — errors are caught and logged without failing the curator.
Proposal cleanup — When a draft skill proposal is activated via skill_apply, the source proposal file is deleted as part of the activation process (best-effort; permission errors are logged but do not block activation).
/swarm skill-opt (issue #1822 — SkillOpt 3/7) is a manually-activated, governed optimizer that drives ONE allowlisted SKILL.md candidate at a time through deterministic draft → static smoke → evaluation-substrate validation (split:'test') → manual approval → atomic activation (or rollback). The loop is bounded, restartable, reversible, and unable to mutate harness/source/security surfaces.
Commands: /swarm skill-opt plan|run|status|diff|approve|reject|rollback|history.
/swarm skill-opt run requires skill_opt.enabled: true AND --confirm. plan/status/diff/history are always available (read-only / proposal-only).approve/activate/reject/rollback are human-only and require --expected-content-hash to refuse a stale base.evaluateCandidateV1) — no duplicate runner/scorer. Held-out test sets are single-use (claimHeldOutTest), so a single run performs at most one validation..swarm/evolution/skills/<slug>/<candidateId>/ with hash-chain integrity and corrupt-tail quarantine.See docs/skill-optimizer.md for the full architecture and the skill_opt config block.
/swarm harness-opt (issue #2503 — the HarnessOpt capstone) is the executing, governed optimizer over the declarative harness_evolution surface: it drives ONE governed round at a time through the evaluation substrate in a disposable worktree (the substrate fingerprints the active checkout before and after every execution), freezes the comparative task set before any round, and records durable lineage with task-cost accounting (missing host data stays unknown, never zero).
Commands: /swarm harness-opt plan|run|compare|status|stop|history.
run requires harness_opt.enabled: true AND --confirm; run/stop are human-only.test split consumes the held-out set exactly once (substrate-enforced)./swarm approve-write + the harness store, which additionally re-validates recorded approved paths against the CURRENT allowlist.See docs/harness-optimizer.md for the full architecture and the harness_opt config block.
Swarm provides an opt-in, quarantine-first pipeline for discovering, validating, and promoting external skills. Disabled by default — no network calls are made until explicitly enabled.
external_skills:
curation_enabled: true
sources:
- type: url
location: https://example.com/skills/
trust_level: medium
Every candidate passes a 3-gate pipeline before entering quarantine:
| Gate | Name | Description |
|---|---|---|
| 1 | Prompt Injection Scan | 12 regex patterns plus oversized field, invisible character, and suspicious formatting checks detect system instruction injection, role hijacking, and instruction override attempts |
| 2 | Unsafe Instruction Scan | 25 patterns detect shell commands, file system attacks, network exfiltration, and privilege escalation |
| 3 | Provenance Integrity | SHA-256 content hash, timestamp validation, URL format checks, and publisher presence validation |
Trust level modulation: low trust promotes warning-severity findings to errors (stricter); medium and high trust levels keep warnings advisory. Error-severity findings always block regardless of trust level.
| Tool | Description |
|---|---|
external_skill_discover | Fetch and validate a skill from a configured source |
external_skill_list | List candidates with status filters |
external_skill_inspect | View full candidate details |
external_skill_promote | Promote validated candidate to active skill (user approval required) |
external_skill_reject | Reject candidate with reason |
external_skill_delete | Remove candidate from quarantine store |
external_skill_revoke | Retire a previously promoted skill |
| Key | Type | Default | Description |
|---|---|---|---|
context_budget.enabled | boolean | true | Enable or disable the context budget guard entirely |
context_budget.max_injection_tokens | number | 4000 | Separate per-turn cap on system-enhancer injection. It is NOT the guard's budget — the guard measures total conversation tokens against model_limits, not this value |
context_budget.warn_threshold | number | 0.7 | Ratio (0.0-1.0) of the model context window at which total conversation tokens trigger a warning advisory |
context_budget.critical_threshold | number | 0.9 | Ratio (0.0-1.0) of the model context window at which total conversation tokens trigger a critical alert with handoff recommendation |
context_budget.enforce | boolean | true | When true (default), crossing the critical threshold masks large completed tool outputs and prunes lower-priority messages in the outgoing request toward prune_target. Execution is never blocked or aborted |
context_budget.prune_target | number | 0.7 | Ratio (0.0-1.0) of the context window the outgoing request is pruned toward when enforcement runs |
context_budget.preserve_last_n_turns | number | 4 | Number of recent turns protected from pruning |
context_budget.recent_window | number | 10 | Age (in turns) beyond which a completed tool output becomes eligible for masking during enforcement; the latest preserve_last_n_turns turns are always protected |
context_budget.tracked_agents | string[] | ['architect'] | Agents to track for context budget warnings |
context_budget.enforce_on_agent_switch | boolean | true | Enforce budget limits when switching agents |
context_budget.model_limits |
Minimal (disable):
{
"context_budget": {
"enabled": false
}
}
Default (reference):
{
"context_budget": {
"enabled": true,
"max_injection_tokens": 4000,
"warn_threshold": 0.7,
"critical_threshold": 0.9,
"enforce": true,
"prune_target": 0.7,
"preserve_last_n_turns": 4,
"recent_window": 10,
"tracked_agents": ["architect"],
"enforce_on_agent_switch": true,
"model_limits": { "default": 128000 },
"tool_output_mask_threshold": 2000,
"scoring": {
"enabled": false,
"max_candidates": 100,
"decision_decay": { "mode": "exponential", "half_life_hours": 24 }
}
}
}
(Omitted keys — weights above — take the schema defaults listed in the table; only the eight documented weight keys are read.)
Aggressive (for long-running sessions):
{
"context_budget": {
"enabled": true,
"max_injection_tokens": 2000,
"warn_threshold": 0.5,
"critical_threshold": 0.75,
"enforce": true,
"prune_target": 0.6,
"preserve_last_n_turns": 2,
"recent_window": 5,
"tracked_agents": ["architect"],
"enforce_on_agent_switch": true,
"model_limits": { "default": 128000 },
"tool_output_mask_threshold": 1500,
"scoring": {
"enabled": true,
"max_candidates": 50,
"weights": { "phase": 1.5, "current_task": 3.0, "recent_failure": 3.0, "recent_success": 0.3, "decision_recency": 2.0 },
"decision_decay": { "mode": "linear", "half_life_hours": 12 }
}
}
}
Note on
scoring.token_ratios: the key is still accepted by the config schema for backward compatibility, but it is deprecated and inert — no runtime code reads it, and per-content token ratios are deliberately not used. Token costs for both normal and scoring accounting always come from the one canonical estimator (estimateTokensinsrc/hooks/utils.ts, flat ~0.33 tokens/char); when the provider reports token usage, that figure stays authoritative.
.swarm/ artifacts, and tool results on disk are untouched.estimateTokens, ~0.33 tokens/char) otherwise.| Surface | What It Does |
|---|---|
| syntax_check | Tree-sitter validation across the configured language grammar map |
| placeholder_scan | Catches TODOs, FIXMEs, stubs, placeholder text |
| sast_scan | Offline security analysis, 68 rules, 8 languages |
| sbom_generate | CycloneDX dependency tracking, 8 ecosystems |
| build_check | Runs your project's native build/typecheck |
| incremental_verify | Post-coder hook for TS/JS, Go, Rust, Python, and C#; configured by incremental_verify.*, not invoked as a registered tool |
| quality_budget | Enforces complexity, duplication, and test ratio limits |
| pre_check_batch | Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential) |
| phase_complete | Produces a complete bounded read-only gate report, revalidates the exact plan/config/evidence snapshot under lock, and commits the phase only when every applicable gate still passes |
| run_phase_review | Architect-only: runs the bounded final-review engine and persists complete content-addressed review evidence for phase_complete |
| repair_gate_evidence | Architect-only: rebuilds recoverable task evidence from durable requirements, recovers receipt-backed legacy marker wedges or the exact sentinel-only state emitted by the historical repair flow, requires fresh coder settlement, and refuses every other receipt-less reconstruction without changing state |
| repair_knowledge_receipt_ledger | Architect-only: validates receipt projections or salvages a corrupt authoritative ledger while requiring exact phase/session re-evaluation |
| record_directive_override | Architect-only: records explicit critical-directive authorization separately from phase completion; unreadable authority cannot be overridden |
| mutation_test | Applies LLM-generated mutation patches to source files and runs tests to measure kill rate; verdict is pass/warn/fail based on configurable thresholds; used by the mutation_test gate (opt-in, off by default) |
| generate_mutants | Architect-only: generates LLM-based mutation patches (5–10 per function across 6 types: off-by-one, null substitution, operator swap, guard removal, branch swap, side-effect deletion) for direct consumption by the mutation_test tool; returns SKIP verdict on LLM failure rather than throwing |
Quality-gate surfaces run locally and require no Docker. Optional search-backed council features use external APIs only when explicitly enabled and configured.
Optional enhancement: Semgrep (if on PATH).
{
"gates": {
"syntax_check": { "enabled": true },
"placeholder_scan": { "enabled": true },
"sast_scan": { "enabled": true },
"quality_budget": {
"enabled": true,
"max_complexity_delta": 5,
"min_test_to_code_ratio": 0.3
}
}
}
Swarm uses file locking to protect shared state files from concurrent write corruption. The locking strategy differs by file: plan.json uses hard locking (write blocked on contention), while events.jsonl uses advisory locking (write proceeds with a warning on contention).
proper-lockfile with automatic retries (F-09): 5 retries with exponential backoff (10ms→500ms, factor 2); a held lock is treated as stale after LOCK_TIMEOUT_MS (5 minutes)| File | Tool | Lock Key |
|---|---|---|
.swarm/plan.json | update_task_status | plan.json |
.swarm/events.jsonl | phase_complete | events.jsonl |
The two protected tools use different strategies:
update_task_status — Hard lock on plan.json
When two calls contend for plan.json:
success: false — with recovery_guidance: "retry" and an error message identifying the lock holder{
"success": false,
"message": "Task status write blocked: plan.json is locked by architect (task: update-task-status-1.1-1234567890)",
"errors": ["Concurrent plan write detected — retry after the current write completes"],
"recovery_guidance": "Wait a moment and retry update_task_status. The lock will expire automatically if the holding agent fails."
}
What the caller should do: Retry update_task_status after a short delay.
phase_complete — Advisory lock on events.jsonl
When two calls contend for events.jsonl:
success: true — duplicate concurrent appends are possible but events.jsonl is an append-only log and duplicate phase entries do not corrupt stateThis asymmetry is intentional: plan.json stores mutable structured JSON where concurrent overwrites produce malformed files; events.jsonl is an append-only log where a duplicate entry is a recoverable nuisance.
If a lock-holding agent crashes or hangs, the lock file will eventually expire (handled by proper-lockfile stale-lock cleanup). On the next retry, the call will succeed. Swarm does not auto-retry on lock contention — the architect receives the error and decides when to retry.
Config file location: ~/.config/opencode/opencode-swarm.json (global) or .opencode/opencode-swarm.json (project). Project config merges over global.
Tip: add "$schema": "https://unpkg.com/opencode-swarm/opencode-swarm.schema.json" as the first key of your config (config files created by the plugin already include it) for editor validation and autocomplete of every configuration key. See docs/configuration.md.
{
"agents": {
"architect": { "model": "anthropic/claude-opus-4-6" },
"coder": { "model": "minimax-coding-plan/MiniMax-M2.5", "fallback_models": ["minimax-coding-plan/MiniMax-M2.1"] },
"explorer": { "model": "minimax-coding-plan/MiniMax-M2.1" },
"sme": { "model": "kimi-for-coding/k2p5" },
"critic": { "model": "zai-coding-plan/glm-5" },
"reviewer": { "model": "zai-coding-plan/glm-5", "fallback_models": ["opencode/big-pickle"] },
"test_engineer": { "model": "minimax-coding-plan/MiniMax-M2.5" },
"docs": { "model": "zai-coding-plan/glm-4.7-flash" },
"designer": { "model": "kimi-for-coding/k2p5" }
},
"guardrails": {
"max_tool_calls": 200,
"max_duration_minutes": 30,
"profiles": {
"coder": { "max_tool_calls": 500 }
}
},
"authority": {
"enabled": true,
"rules": {
"coder": {
"allowedPrefix": ["src/", "lib/"],
"blockedPrefix": [".swarm/"],
"blockedZones": ["generated"]
}
}
},
"review_passes": {
"always_security_review": false,
"security_globs": ["**/*auth*", "**/*crypto*", "**/*session*"]
},
"automation": {
"mode": "manual",
"capabilities": {
"plan_sync": true,
"phase_preflight": false,
"config_doctor_on_startup": false,
"config_doctor_autofix": false,
"evidence_auto_summaries": true,
"decision_drift_detection": true
}
},
"knowledge": {
"enabled": true,
"swarm_max_entries": 100,
"hive_max_entries": 200,
"auto_promote_days": 90,
"max_inject_count": 5,
"inject_char_budget": 2000,
"max_lesson_display_chars": 120,
"dedup_threshold": 0.6,
"scope_filter": ["global"],
"hive_enabled": true,
"rejected_max_entries": 20,
"validation_enabled": true,
"evergreen_confidence": 0.9,
"evergreen_utility": 0.8,
"low_utility_threshold": 0.3,
"min_retrievals_for_utility": 3,
"schema_version": 1
},
"epic": {
"mode": { "enabled": false },
"cochange": { "enabled": false }
}
}
Swarm now explicitly distinguishes five architect modes:
DISCOVER — After the explorer finishes scanning the codebase.PLAN — When the architect writes or updates the plan.EXECUTE — During task implementation (the normal pipeline).PHASE-WRAP — After all tasks in a phase are completed, before docs are updated.UNKNOWN — Fallback when the current state does not match any known mode.Each mode determines which injection blocks are added to the LLM prompt (e.g., plan cursor is injected in PLAN, tool output truncation in EXECUTE, etc.).
Default mode: manual. No background automation — all actions require explicit slash commands.
Modes:
manual — No background automation. All actions via slash commands (default).hybrid — Background automation for safe operations, manual for sensitive ones.auto — Full background automation.Capability defaults:
plan_sync: true — Background plan synchronization using fs.watch with debounced writes (300ms) and 2-second polling fallbackphase_preflight: false — Phase preflight checks before agent execution (opt-in)config_doctor_on_startup: false — Validate configuration on startupconfig_doctor_autofix: false — Auto-fix for config doctor (opt-in, security-sensitive)evidence_auto_summaries: true — Automatic summaries for evidence bundlesdecision_drift_detection: true — Detect drift between planned and actual decisionsThe plan_cursor config compresses the plan that is injected into the LLM context.
{
"plan_cursor": {
"enabled": true,
"max_tokens": 1500,
"lookahead_tasks": 2
}
}
true (default) Swarm injects a compact plan cursor instead of the full plan.md.lookahead_tasks upcoming tasks. Earlier phases are reduced to one‑line summaries.0 to show only the current task.All three controls are honored on both context‑injection paths (the default
injection path and the opt‑in context_budget.scoring ranking path) and in the
context‑budget report's token accounting (issue #2580). Disabling
("enabled": false) suppresses the cursor block; the remaining injections are
unchanged — on the default path that is the phase header line, and on the
scoring path the phase and current‑task context candidates. The full plan text
is never injected in its place. When the cursor exceeds max_tokens and the
compact rebuild kicks in, lookahead is reduced to one task and earlier phases
collapse to one‑line summaries. A phase marked [BLOCKED] is surfaced as a
one‑line ## Phase N [BLOCKED] summary in both renders (issue #2841); its
summary is reserved ahead of generic budget truncation, so it is never
silently dropped within the configured max_tokens (only when even the
summary cannot fit the bound does the bound win, as for every section).
Control the size of tool outputs that are sent back to the LLM.
{
"tool_output": {
"truncation_enabled": true,
"max_lines": 150,
"per_tool": {
"diff": 200,
"symbols": 100
}
}
}
max_lines for specific tools. The diff and symbols tools are truncated by default because their outputs can be very large.When truncation is active, a footer is appended:
---
[output truncated to {maxLines} lines – use `tool_output.per_tool.<tool>` to adjust]
Control how tool outputs are summarized for LLM context.
{
"summaries": {
"threshold_bytes": 102400,
"exempt_tools": [
"retrieve_summary",
"retrieve_lane_output",
"task",
"read",
"dispatch_lanes",
"dispatch_lanes_async",
"collect_lane_results",
"parse_lane_candidates"
]
}
}
["retrieve_summary", "retrieve_lane_output", "task", "read", "dispatch_lanes", "dispatch_lanes_async", "collect_lane_results", "parse_lane_candidates"]. Retrieval and lane tools are always exempt—summarizing them would destroy the references needed to recover their full outputs.Note: The
retrieve_summarytool supports paginated retrieval viaoffsetandlimitparameters to fetch large summarized outputs in chunks.
{
"sme": { "disabled": true },
"designer": { "disabled": true },
"test_engineer": { "disabled": true }
}
| Command | Description |
|---|---|
/swarm help [command] | List all commands or get detailed help for a specific command |
/swarm status | Current phase, task progress, agent count |
/swarm show-plan [N] | Full plan or filtered by phase |
/swarm plan [N] | Deprecated alias for /swarm show-plan [N] |
/swarm agents | Registered agents with models and permissions |
/swarm history | Completed phases with status |
/swarm config | Current resolved configuration |
/swarm diagnose | Health check for .swarm/ files, config, and sandbox executor status |
/swarm guardrail explain [--agent <role>] [--scope <path>] [--write <path>...] [--] <command> | Dry-run guardrail decisions — report what would be allowed/blocked without executing anything |
/swarm guardrail-log [--blocks-only] | Read and print the guardrail decision log most-recent-first; --blocks-only shows only block decisions |
/swarm export | Export plan and context as portable JSON |
/swarm evidence [task] | Evidence bundles for a task or all tasks |
/swarm archive [--dry-run] | Archive old evidence with retention policy |
/swarm benchmark | Performance benchmarks; optionally consume a stored gate audit with --gate-audit-run <id> |
/swarm gate-audit | Run the bounded 12-fixture reviewer/test/SAST/mutation/quality evaluation matrix |
/swarm gate-stats | Aggregate offline catch, false-reject, retry, cost, and reviewer-fallback statistics |
/swarm review [--base <ref> | --range <from..to|from...to> | --working-tree] [--json] | Run the bounded local whole-diff review engine with structured findings, optional independent validation when configured or required by gate mode, and durable evidence |
/swarm costs [--json] |
Full Tier-1 support: TypeScript, JavaScript, Python, Go, Rust Tier-2 support: Java, Kotlin, C#, C/C++, Swift Tier-3 support: Dart, Ruby, PHP/Laravel
All binaries optional. Missing tools produce soft warnings, never hard-fail.
6,000+ tests. Unit, integration, adversarial, and smoke. Run with:
bun test
Epic Mode's planner regression harness: bun scripts/epic-bench.ts.
.swarm/ state./swarm subcommands grouped by functionMIT
Stop hoping your agents figure it out. Start shipping code that actually works.
/swarm epic closeepic_phase_reviewphase_complete/swarm epic reportepic.mode.enabled: true.swarm/; pick up any project any dayhttps://<gitlab-host>/owner/repo/-/merge_requests/N, /-/issues/N) are accepted by /swarm pr-review, pr-feedback, pr subscribe/unsubscribe, ci-monitor, publication recording, and issue ingestion, with self-hosted instance hosts derived from the remote or forge.base_url (config forge: { provider, base_url }, default auto; ambiguous remotes fail closed). Every URL-security control (HTTPS-only, private/localhost rejection, IDN protection, credential stripping) applies identically to GitLab. The glab binary resolves through the same hardened resolver contract as gh (OPENCODE_SWARM_GLAB_BINARY env override). Honest capability reporting: GitLab does not synthesize GitHub's statusCheckRollup/reviewDecision/mergeStateStatus — those surface an explicit unavailable result instead of a fabricated value, and glab-backed live MR polling is tracked as follow-up issue #2882.gh CLI; delivers real-time CI, review, and merge status updates via the AutomationEventBus (FR-001, opt-in via pr_monitor.enabled: true). Subscribe with /swarm pr subscribe <pr-url|owner/repo#N|N>; unsubscribe with /swarm pr unsubscribe <pr-url|owner/repo#N|N>; check status with /swarm pr status. With auto_pr_feedback: true, CI failures and merge conflicts mechanically activate PR_FEEDBACK only when no other workflow owns the session; otherwise they are durably queued for a later round..tsx / .c aliases) — extending: see docs/adding-a-language.mdfiles[], paths[], targetFiles[]) to prevent scope bypass via multi-file tool calls.| Conditional |
| council_skeptic | Adversarial stress-tester voice in the General Council (uses critic model) | Conditional |
| council_domain_expert | Technical-depth voice in the General Council (uses SME model) | Conditional |
| Per-epic scorecard: conflicts, rework, gate first-pass rates (Epic Mode) | ✅ | ❌ | ❌ |
.swarm/| record |
{} |
Per-model token limit overrides, keyed by "<provider>/<model>", "<model>", or "default". Empty by default so the live model's own context window is used; set an entry only to impose a smaller working budget |
context_budget.unified_injection_tokens | number | undefined | Opt-in unified ceiling (tokens) for combined system-enhancer + knowledge-injector injection per turn. When set, both hooks share this budget with proportional split |
context_budget.tool_output_mask_threshold | number | 2000 | Character threshold (chars, not tokens): during enforcement, a completed tool output in a non-protected turn is masked when it is older than recent_window turns OR longer than this many characters (either condition) |
skills.enabled | boolean | false | Gates the 7 skill-management tools (skill_generate, skill_list, skill_apply, skill_inspect, skill_regenerate, skill_retire, skill_improve) behind an opt-in flag. When false (default), these tools are host-denied for every agent except skill_improver — genuinely unreachable at request time (issue #2528). |
skill_opt.enabled | boolean | false | Master opt-in for the governed skill optimizer (/swarm skill-opt). run also requires --confirm; plan/status/diff/history are always available. See docs/skill-optimizer.md. |
skill_opt.deadband | number | 0 | Promotion policy deadband forwarded to the evaluation substrate. |
skill_opt.max_rounds | number | 5 | Hard cap on draft/smoke retries before a validation (held-out test set is single-use). |
skill_opt.max_transient_retries | number | 5 | Max transient-infra retries before an infra failure becomes inconclusive. |
epic.mode.enabled | boolean | false | Master opt-in for Epic Mode (/swarm epic, epic_next_wave, epic_phase_review). The legacy turbo.epic.* path is still accepted and migrated with a warning. See docs/modes.md |
epic.mode.activation_threshold | number | 0.3 | Intra-component density above which a conflict component runs one task per wave |
epic.cochange.enabled | boolean | false | Adds the git co-change conflict signal to Epic planning and /swarm coupling (otherwise declared-path conflicts only) |
epic.cochange.threshold / min_co_changes | number | 0.6 / 5 | NPMI floor and minimum co-change count for a file pair to count as coupled |
epic.sizing.* | object | min_tasks: 6, min_scope_coverage: 0.8, min_effective_speedup: 1.25, coder_fraction: 0.6 | /swarm epic start refuses plans below these (--force overrides and is recorded) |
epic.learning.* | object | enabled: true, decay_per_epic: 0.7, half_life_days: 60, hot_excess: 0.25 | Per-file risk and co-write learning across waves and epics |
epic.commit_policy | string | epic-branch | epic-branch (work on swarm/epic/<key>, landed at close) or current-branch |
epic.retain_refs | boolean | false | Keep refs/swarm/epics/<key>/* after close |
context_budget.scoring.enabled | boolean | false | Enable context scoring/ranking |
context_budget.scoring.max_candidates | number | 100 | Maximum items to score (10-500) |
context_budget.scoring.weights | object | { phase: 1.0, current_task: 2.0, blocked_task: 1.5, recent_failure: 2.5, recent_success: 0.5, evidence_presence: 1.0, decision_recency: 1.5, dependency_proximity: 1.0 } | Per-signal priority weights (each 0-5). Only these eight keys are read |
context_budget.scoring.decision_decay | object | { mode: 'exponential', half_life_hours: 24 } | Decision relevance decay (mode: linear or exponential; half_life_hours 1-168) |
context_budget.scoring.token_ratios | object | { prose: 0.25, code: 0.4, markdown: 0.3, json: 0.35 } | Accepted for backward compatibility only; deprecated and inert at runtime — never read. Token costs always use the canonical flat estimator (estimateTokens, ~0.33 tokens/char), never per-content ratios |
| write_mutation_evidence |
Architect-only: writes mutation gate results atomically to .swarm/evidence/{phase}/mutation-gate.json; accepts verdict (PASS/WARN/FAIL/SKIP), kill rate metrics, and optional survived mutant details; normalizes uppercase-to-lowercase before persisting |
| parse_lane_candidates | Architect-only: parses [CANDIDATE] rows and micro-lane [CLEAN] attestations from a lane output_ref; supports asserted batch families, preserves dispatch provenance, and persists sidecar JSONL records |
| write_pr_review_trigger_eval | Architect-only: validates the exact mandatory PR-review micro-lane ID set, requires completed provenance for all 11 repository-agnostic lanes, verifies the claimed merge base against an exact live base ref, rejects every NO-MATCH waiver, and atomically persists .swarm/pr-review/<run_id>/trigger-eval.json |
| complete_pr_workflow | Architect-only: validates terminal PR-review or PR-feedback coverage; feedback uses a two-call arm/publish protocol and clears only after the approved content is observed on both the bound remote-tracking ref and the actual remote branch |
| run_pr_feedback_stage_a | Architect-only: executes targeted reproduction/regression and exact git diff --check plus every mechanically applicable workspace/category/source build, typecheck, and lint obligation, then persists content-bound Stage A receipts before ordered feedback review gates |
| epic_next_wave | Architect-only, Epic Mode: closes the current wave (recording outcomes and declared-vs-actual writes) and issues the next wave of conflict-free tasks; the delegation gate only admits the active wave's tasks |
| epic_phase_review | Architect-only, Epic Mode: dispatches a read-only phase reviewer and then a phase critic, and records the evidence phase_complete requires while an epic is open |
| git_blame | Per-line git blame metadata (sha, author, date, summary) via git blame --porcelain; supports optional line range filtering |
| diff | Structured git diff with contract change detection; supports summaryOnly mode returning file list with additions/deletions counts |
| suggest_patch | Reviewer-safe structured patch suggestion; supports format parameter ('json' or 'unified') where unified outputs valid unified diff with diff --git headers, hunks, and context |
| test_runner | Auto-detect and run tests; supports bail parameter to inject framework-specific bail flags for early exit on first failure |
| symbols | Extract exported symbols from source files; supports workspace (boolean) and name (string) parameters for multi-file symbol search |
| Per-agent, per-task, per-gate, and per-retry token/cost totals from telemetry |
/swarm retrieve [id] | Retrieve auto-summarized tool outputs (supports offset/limit pagination) |
/swarm reset --confirm | Clear swarm state files |
/swarm reset-session | Clear session state files in .swarm/session/ (preserves plan and context) |
/swarm preflight | Run phase preflight checks |
/swarm config doctor [--fix] | Config validation with optional auto-fix |
/swarm doctor tools | Tool registration coherence and binary readiness check |
/swarm sync-plan | Force plan.md regeneration from the canonical plan ledger |
/swarm specify [description] | Generate or import a feature specification |
/swarm clarify [topic] | Clarify and refine an existing feature specification |
/swarm analyze | Analyze spec.md vs plan.md for requirement coverage gaps |
/swarm sdd ... | Inspect, validate, or project OpenSpec-compatible SDD artifacts into .swarm/spec.md |
/swarm brainstorm [topic] | Enter BRAINSTORM mode for structured requirement discovery before a spec |
/swarm council <question> [--spec-review] | Convene a multi-model General Council for advisory deliberation |
/swarm issue <issue-url|owner/repo#N|N> [--plan] [--trace] [--no-repro] | Ingest a GitHub issue for localization and resolution |
/swarm pr-review <pr-url|owner/repo#N|N> [--council] [instructions...] | Structured deep PR review with parallel lanes, reviewer confirmation, and critic challenge |
/swarm pr-feedback [<pr-url|owner/repo#N|N>] [instructions...] | Ingest and close known PR feedback (review comments, CI failures, conflicts) without a fresh review |
/swarm ci-monitor <pr-url|owner/repo#N|N> | Drive an already-reviewed, approved PR to green and merged (monitor CI, fix, merge; max 5 fix cycles) |
/swarm ci [--timeout-ms <n>] [--json] | Advisory headless CI: read-only gate/evidence evaluation with machine exit codes (also bunx opencode-swarm ci; see docs/ci.md) |
/swarm pr subscribe <pr-url|owner/repo#N|N> | Subscribe current session to PR monitoring (session-scoped); requires pr_monitor.enabled: true |
/swarm pr unsubscribe <pr-url|owner/repo#N|N> | Remove session's subscription to a PR |
/swarm pr status | List active PR subscriptions for current session with relative timestamps (the bunx opencode-swarm run pr status CLI has no session context, so it lists subscriptions across all sessions) |
/swarm deep-dive <scope> [--profile <name>] [--max-explorers <n>] | Read-only codebase audit with parallel explorers, dual reviewers, and critic challenge |
/swarm design-docs <description> [--out <dir>] [--lang <name>] [--update] | Generate or sync language-agnostic design docs (requires design_docs.enabled) |
/swarm epic start [--force] | close [--abandon] [--land squash|merge|none] | status [--repair-refs] | report [<key>|last] [--format json] | learning | prior [show|reset [--confirm=<token>]] | clear-merge-failure <taskId> [--confirm] | Open, inspect, and close a plan-scoped epic (Epic Mode preview; requires epic.mode.enabled) |
/swarm coupling [--phase <n>] [--threshold <-1..1>] [--min-co-changes <n>] [--format markdown|json] [--persist] [--suggest] | Measure plan coupling and rank modules driving conflicts; --suggest adds Epic plan-shaping suggestions |
/swarm dark-matter | Detect hidden file couplings from co-change history |
/swarm finalize [--prune-branches] [--skill-review] | Idempotent session close-out: retrospectives, lesson curation, evidence archive, git reset --hard + clean to align with remote branch (discards uncommitted changes), optional branch pruning, optional skill-improver proposal |
/swarm close [--prune-branches] [--skill-review] | Deprecated alias for /swarm finalize [--prune-branches] [--skill-review] |
/swarm write-retro | Write a phase retrospective manually |
/swarm handoff | Generate a handoff summary for context-budget-critical sessions |
/swarm simulate | Simulate plan execution without writing code |
/swarm promote | Promote swarm-scoped knowledge to hive (global) knowledge |
/swarm evidence summary | Generate a summary across all evidence bundles with completion ratio and blockers |
/swarm knowledge | List knowledge entries |
/swarm knowledge migrate | Migrate knowledge entries to the current format |
/swarm knowledge quarantine [id] | Move a knowledge entry to quarantine |
/swarm knowledge restore [id] | Restore a quarantined knowledge entry |
/swarm memory status | Show memory provider and JSONL migration status |
/swarm memory pending | Show pending memory proposals and recent rejection reasons |
/swarm memory recall-log | Summarize memory recall usage |
/swarm memory stale | List expired, superseded, deleted, and low-utility memory records |
/swarm memory compact | Dry-run memory cleanup; pass --confirm to apply |
/swarm memory export | Export memory records and proposals to JSONL |
/swarm memory evaluate | Run memory recall evaluation fixtures |
/swarm memory import | Import legacy JSONL memory into SQLite |
/swarm memory migrate | Run the one-time JSONL to SQLite migration |
/swarm memory link [name] | Share memory across linked worktrees (requires memory.link.enabled) |
/swarm memory link status | Show whether memory is cohort-linked (distinct from knowledge link) |
/swarm memory unlink | Stop sharing memory; copies cohort family back to local |
| `/swarm concurrency <set | status |
/swarm turbo | Enable turbo mode for the current session (skips phase_complete Gates 1–5; per-task Stage A and Stage B still run) |
/swarm full-auto | Toggle Full-Auto Mode for the current session [on |
/swarm checkpoint | Save a git checkpoint for the current state |