swarm

swarm is a command for coding agents from linxule/kimi-plugin-cc. It costs 64 tokens per session (1,049 once invoked), scanned A, original, Apache-2.0.

A command that distributes a read-only code or design review across multiple helper agents and combines their findings into one report.

In plain words
What is it for?
Use it for broad workspace reviews, or add its write option to have edits made in temporary worktrees and returned as a patch for inspection.
Why use it?
It helps examine separate files, modules, or questions in parallel while keeping the default review from changing the workspace.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the kimi plugin — 12 skills, 11 commands, 7 agents, 1 hook shipped together

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/linxule/kimi-plugin-cc/swarm
Clone the repo
git clone --depth 1 https://github.com/linxule/kimi-plugin-cc

Or install kimi, the plugin that ships this one along with the rest of its 12 skills, 11 commands, 7 agents, 1 hook.

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/linxule/kimi-plugin-cc/swarm.svg)](https://agentmods.dev/commands/linxule/kimi-plugin-cc/swarm)
Your own site
<a href="https://agentmods.dev/commands/linxule/kimi-plugin-cc/swarm"><img src="https://agentmods.dev/badge/commands/linxule/kimi-plugin-cc/swarm.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 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,049 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.00064 $0.01049
Opus 5 $0.00032 $0.00524
Sonnet 5 $0.00013 $0.00210
Haiku 4.5 $0.00006 $0.00105

Measured 4d ago against content hash 85b36b2c6799, 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.

commands/swarm.md · 29 lines

What it actually says

Run the companion with any user-supplied flags appended after task swarm:

${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task swarm <args>

/kimi:swarm is a parallel fan-out: Kimi uses the AgentSwarm tool to fan the work out across subagents (one per file/module/question), then consolidates into one markdown report. By default it is read-only, enforced by the same PreToolUse hook as /kimi:review — the hook runs under the swarm label (read-only tool set plus AgentSwarm), and every spawned subagent inherits that label and fires the same hook (policy index 0), so a subagent's write/edit/shell call is denied exactly like a single-turn review's.

--write turns it into a write-capable fan-out: the coordinator and coder subagents run inside an ephemeral throwaway git worktree off your HEAD, edit disjoint targets there, and the result is captured as a reviewable patch (written to a .patch file whose path is printed in the report). Writes are confined to that worktree by the swarm-write hook label (rescue-grade allowlist, scoped to a forge-proof trusted worktree root — not the payload cwd); git mutation and out-of-worktree writes are denied; the plugin never applies or commits — you own the merge. Your real working tree is never touched.

Supported flags:

  • --write — fan out EDITS (not just review). Requires kimi-code >= 0.18.0, a git repo with a committed HEAD, and the PreToolUse hook. Bases the worktree on HEAD: uncommitted changes are NOT included (you'll get a warning) — commit or stash first if the swarm needs them. --write is also reachable via the model-invocable kimi-swarm-write subagent, with strict triggering (many disjoint write targets AND explicit fan-out intent); auto-dispatch widens no write surface and keeps every bound, and the slash command itself stays human-only.
  • --budget <duration> — HARD wall-clock ceiling (e.g. 30m, 1h, 90s; bare number = minutes). Default 30m. The always-on bound on cost/runaway.
  • --cap <N> — SOFT cap on TOTAL subagent count: injected into the prompt as a model instruction. Advisory, not hook-enforced (the hook is stateless and can't count subagents), so the model may exceed it. Bounds lifetime total, not peak parallelism.
  • --max-concurrency <N> — HARD ceiling on how many subagents run AT ONCE, on kimi-code 0.18.0+ (exported as KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY; older binaries ignore it). Defaults to 4 for read, 1 for --write (writes serialize by default since disjoint-target partitioning is prompt-only) — pass a value to widen or throttle. Distinct from --cap: concurrency (simultaneous) ≠ total count (lifetime).
  • -m, --model <name>

Prototype limitations:

  • No --background flag — the runtime has no detached-worker mode for swarm. That is separate from how the caller runs the shell command: for --write (30m default budget vs a 10-minute foreground Bash cap) detaching the call is expected; for a read-only fan-out the default stays foreground and detaching is a per-request choice. --budget and --max-concurrency stay finite either way, and budget expiry still captures the patch/report. To stop a run, just say so — the stop path is companion.sh cancel with no id (it targets the latest running job for this repo). For --write, prefer that over Esc: an interrupt can kill the run mid-teardown and lose the captured patch.
  • Read-only swarm requires kimi-code >= 0.12.0 (the AgentSwarm tool); --write requires >= 0.18.0 (the hard concurrency cap). Both refuse without the /kimi:setup PreToolUse hook (a fan-out with no enforcement is an N-fold blast radius).

Return the companion stdout verbatim.

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 · 29 lines · 64 tokens per session scan A 85b36b2c6799

Subscribe to this mod's changes

swarm is a command published in the GitHub repository linxule/kimi-plugin-cc (37 stars, last pushed 5d ago), licensed Apache-2.0. It adds 64 tokens to every session and 1,049 once invoked, about $0.0003 per session on Opus 5. 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.