swarm

swarm is a command for Claude Code from sema-lisp/sema. It costs 0 tokens per session (1,319 once invoked), scanned A, original, MIT.

A method for starting several independent reviewers with different ways of looking at the same question, then combining their answers into a consensus and noting disagreements or unusual views.

In plain words
What is it for?
Use it for broad or uncertain decisions that need multiple perspectives across technical or non-technical concerns.
Why use it?
It makes assumptions and trade-offs easier to challenge than a single analysis would. The number and range of reviewers can match the question's complexity and risk.

Command for Claude Code

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/sema-lisp/sema/swarm
Clone the repo
git clone --depth 1 https://github.com/sema-lisp/sema

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 swarm

README.md
[![agentmods](https://agentmods.dev/badge/commands/sema-lisp/sema/swarm.svg)](https://agentmods.dev/commands/sema-lisp/sema/swarm)
Your own site
<a href="https://agentmods.dev/commands/sema-lisp/sema/swarm"><img src="https://agentmods.dev/badge/commands/sema-lisp/sema/swarm.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,319 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 $0.00000 $0.01319
Opus 5 $0.00000 $0.00660
Sonnet 5 $0.00000 $0.00264
Haiku 4.5 $0.00000 $0.00132

Measured 4d ago against content hash 64809105cb8c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 4d 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/swarm.md · 137 lines

How it starts

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

Swarm Consensus

You are orchestrating a multi-agent consensus analysis. Your job is to spawn N independent agents, collect their responses, and synthesize consensus/divergence/outliers.

Step 1 — Determine N from complexity

Assess the problem on these axes:

  • Scope: Is this a narrow tactical question or a broad strategic one?
  • Ambiguity: Is there a clearly correct answer, or does it depend on values/tradeoffs?
  • Stakes: How costly is a wrong decision?
  • Domain breadth: Does it touch multiple disciplines?

Pick N:

Complexity N When
Low 3 Single-domain, clear tradeoffs, reversible
Medium 5 Multi-factor, some ambiguity, moderate stakes
High 7 Cross-domain, high ambiguity, hard to reverse
Critical 10 Strategic, high stakes, deeply uncertain

State your chosen N and why before spawning.


Step 2 — Spawn N agents in parallel

Use the Task tool to launch all N agents simultaneously (not sequentially).

Each agent gets the same core problem but a distinct analytical lens framing. Assign lenses from this list (rotate through them for larger N):

  1. First-principles — Strip away assumptions. What is fundamentally true here?
  2. Skeptic — What is most likely to go wrong? What are the weakest assumptions?
  3. Optimist — What is the best realistic outcome? What would have to be true for this to work brilliantly?
  4. Risk analyst — What are the tail risks? What failure modes are non-obvious?
  5. Contrarian — What does conventional wisdom get wrong here? What is the counterintuitive answer?
  6. Pragmatist — Ignoring what's ideal, what is actually executable given real constraints?
  7. Systems thinker — What are the second and third-order effects? What feedback loops exist?
  8. Devil's advocate — Steelman the opposite position as strongly as possible.
  9. Historian — What analogous situations exist? What did people learn the hard way?
  10. Minimalist — What is the simplest possible solution that could work?
  11. Pre-mortem — Assume it already failed. Work backwards: what specifically killed it?
  12. Economist — What are the real incentives at play? Who wins, who loses, and will behavior match intent?
  13. User proxy — Forget the builders. What does the person actually affected experience end-to-end?
  14. Futurist — In 3–5 years, how does this look? What trends does it ride or fight against?
  15. Bottleneck finder — What is the single constraint that limits everything else? Where is the true chokepoint?
  16. Ethicist — Who bears the costs of this decision? What obligations are being honored or ignored?
  17. Maximalist — What does the boldest, most ambitious version of this look like? What would going all-in unlock?
  18. Regulator — What rules, power structures, or institutional inertia does this touch? What requires permission?
  19. Archaeologist — Strip away all the new framing. What old problem is this actually? Has it been solved before?
  20. Synthesizer — Where do the opposing views secretly agree at a deeper level? What framing resolves the apparent conflict?

Read the full file on GitHub · 137 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. 4d ago First seen · 137 lines · 0 tokens per session scan A 64809105cb8c

Subscribe to this mod's changes

swarm is a command published in the GitHub repository sema-lisp/sema (41 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,319 tokens. 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.