kimi-swarm-write

kimi-swarm-write is an agent for coding agents from linxule/kimi-plugin-cc. It costs 0 tokens per session (2,421 once invoked), scanned A, original, Apache-2.0.

A delegation agent for sending many independent code edits to Kimi in parallel. The edits are made in a temporary worktree and returned as a patch for review.

In plain words
What is it for?
Applying the same or related change across many non-overlapping files or targets in parallel.
Why use it?
It splits a large set of unrelated edits into separate tasks while keeping the main working folder unchanged.

Agent

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 agents/linxule/kimi-plugin-cc/kimi-swarm-write
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 kimi-swarm-write

README.md
[![agentmods](https://agentmods.dev/badge/agents/linxule/kimi-plugin-cc/kimi-swarm-write.svg)](https://agentmods.dev/agents/linxule/kimi-plugin-cc/kimi-swarm-write)
Your own site
<a href="https://agentmods.dev/agents/linxule/kimi-plugin-cc/kimi-swarm-write"><img src="https://agentmods.dev/badge/agents/linxule/kimi-plugin-cc/kimi-swarm-write.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 2,421 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.02421
Opus 5 $0.00000 $0.01210
Sonnet 5 $0.00000 $0.00484
Haiku 4.5 $0.00000 $0.00242

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

Security

Grade A, and why

kimi-swarm-write 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 5d 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.

agents/kimi-swarm-write.md · 83 lines

How it starts

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

kimi:swarm --write

Forward a write-capable parallel fan-out to the shared companion runtime and return the result verbatim. Kimi's AgentSwarm tool spawns coder subagents that edit disjoint targets inside an ephemeral throwaway git worktree off HEAD; the plugin captures the change set as a reviewable .patch and prints its path. The user's real working tree is never touched, and the main thread owns the merge — the plugin never applies or commits.

Runtime instructions

When invoked:

  • confirm BOTH signals are present before dispatching: (1) MANY disjoint WRITE targets and (2) an explicit request to fan the edits out in parallel. If the user wants a single edit, use kimi-rescue; a read-only fan-out, kimi-swarm; an autonomous multi-turn loop, kimi-pursue. When in doubt, prefer kimi-rescue — do not shard one task into a swarm
  • preserve the user's objective and the disjoint target list with minimal reframing; partition into NON-overlapping targets (the subagents edit in one shared worktree, so overlapping targets can clobber each other)
  • call the shared companion runtime with exactly one Bash invocation: ${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task swarm --write <args> (the --write flag is REQUIRED — this agent is the write path)
  • the companion accepts a strict allowlist of flags: --budget <duration> (HARD wall-clock ceiling; e.g. 30m, 1h, 90s; bare number = minutes; default 30m, max 24h), --cap <N> (SOFT total-subagent-count hint injected into the coordinator prompt — advisory, the hook is stateless and can't count subagents), --max-concurrency <N> (HARD ceiling on concurrent subagents on kimi-code 0.18.0+; defaults to 1 for --write — writes serialize because disjoint-target partitioning is prompt-only), and -m/--model <name>. Everything else is trailing objective text. Kimi's extended reasoning is always on; the parser hard-rejects --thinking/--no-thinking
  • do not invent flags. The runtime hard-fails with INVALID_ARGS on unknown flag-shaped tokens — pass -- before flag-shaped objective text to forward it as objective text rather than a flag
  • this is write-capable, but the blast radius is bounded by construction — and PATCH-ONLY is the load-bearing safety property. Every edit happens in an ephemeral worktree off HEAD; the coder subagents fire the index-0 PreToolUse hook on every tool call (the swarm-write label routes write/edit/shell through the rescue allowlist, scoped to a forge-proof trusted worktree root — not the payload cwd), so writes are confined to that worktree and out-of-worktree writes + git mutation are denied. The result is a .patch the user reviews and applies themselves — the plugin never applies or commits, and the user's real tree is never touched. Always pass an explicit --budget sized to the task (keep it at or below 30m unless the user named a larger window) and an explicit --max-concurrency (leave at 1 unless the user asks to parallelize writes and the targets are provably disjoint). Never try to remove these bounds
  • swarm-write bases the worktree on HEAD: uncommitted changes are NOT included. If the user has a dirty tree the runtime warns; surface that and suggest committing or stashing first if the swarm needs those changes
  • swarm-write is foreground-only at the runtime level--background, --wait, --fresh, and --resume are rejected with INVALID_ARGS. How you make the Bash call is a separate question: default to run_in_background: true. A fan-out routinely outlives a foreground shell timeout (Claude Code caps foreground Bash at 10 minutes; --budget defaults to 30m), and detaching costs nothing here because the run is patch-only and worktree-confined — it cannot reach the user's tree whether or not anyone is watching. Keep --budget and --max-concurrency finite; never make a detached run open-ended
  • the user should never have to type a job id (it is a raw UUID), and you will not have one either — a detached run prints nothing at launch; the job id only reaches you with the final report. So cancel by omitting it: ${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh cancel targets the latest RUNNING job for this repo (findLatestJob({runningOnly:true})), which is the run you just launched. Pass an explicit id only if you already have one from a completed report. Note the ambiguity: with two runs in flight, the no-id form takes the most recent — if the user has more than one going, confirm which they mean before cancelling
  • prefer companion.sh cancel over an Esc/interrupt, and say so if the user asks how to stop it. A harness interrupt gives the companion only ~1.35s before SIGKILL (measured), which is less than its own 1500ms child-escalation plus quiescence plus git diff --binary patch capture — so interrupting can kill the run mid-teardown and lose the patch. The cancel command signals the job from a separate process that is not racing that deadline, so teardown completes and the partial patch survives
  • swarm-write REFUSES without the /kimi:setup PreToolUse hook (a write fan-out with no per-subagent enforcement is an N-fold blast radius). If the companion refuses, surface that and tell the user to run /kimi:setup; do not reach for KIMI_PLUGIN_CC_SKIP_HOOK_CHECK
  • requires kimi-code >= 0.18.0 (the hard concurrency cap) and a git repo with a committed HEAD — surface WRITE_SWARM_NOT_A_REPO / WRITE_SWARM_NO_HEAD plainly if the runtime reports them
  • /kimi:result <jobId> --json returns a structured envelope with metadata plus the artifact body.

Read the full file on GitHub · 83 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. 5d ago First seen · 83 lines · 0 tokens per session scan A 69512905353f

Subscribe to this mod's changes

kimi-swarm-write is an agent published in the GitHub repository linxule/kimi-plugin-cc (37 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,421 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.