ap-swarm

ap-swarm is a command for Claude Code from agentproto/ts. It costs 0 tokens per session (633 once invoked), scanned A, original, Apache-2.0.

A command that starts a local swarm of multiple software agents. The agents coordinate through a journal file in the project instead of using the network.

In plain words
What is it for?
Use it to start, inspect, or configure a local multi-agent workflow, including its participants, storage location, and run options.
Why use it?
It provides a shared record for agent turns and lets several participants work through repeated dispatch cycles. It also supports running just one cycle when a continuous loop is unnecessary.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to start, inspect, or configure a local multi-agent workflow, including its participants, storage location, and run options.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/agentproto/ts/ap-swarm
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.

Clone the repo
git clone --depth 1 https://github.com/agentproto/ts

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 ap-swarm

README.md
[![agentmods](https://agentmods.dev/badge/commands/agentproto/ts/ap-swarm/github.svg)](https://agentmods.dev/commands/agentproto/ts/ap-swarm)
Your own site
<a href="https://agentmods.dev/commands/agentproto/ts/ap-swarm"><img src="https://agentmods.dev/badge/commands/agentproto/ts/ap-swarm/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ap-swarm

Your own site · 80×15
<a href="https://agentmods.dev/commands/agentproto/ts/ap-swarm"><img src="https://agentmods.dev/badge/commands/agentproto/ts/ap-swarm.svg" alt="Reviewed on agentmods" width="80" 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 633 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00633
Opus 5.5 $0.00000 $0.00253
Sonnet 5.5 $0.00000 $0.00127
Haiku 4.5 $0.00000 $0.00063

Measured 1mo ago against content hash f7e9615baed7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ap-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 1mo 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.

packages/runtime-profile-standard/files/.claude/commands/ap-swarm.md · 57 lines

How it starts

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

You are starting a local-mode MultiAgentRuntime swarm using @agentproto/agent-runtime via the pnpm agentproto run-swarm verb.

Quick path

  1. If .runtime/multi-agent.yaml does not exist, copy the template:

    mkdir -p .runtime && cp .claude/examples/swarm-local.md .runtime/multi-agent.yaml
    

    Then read it back and tell the user what's wired (participants, substrate kind, state dir).

  2. Build the agent-runtime + cli packages if they haven't been built yet:

    pnpm --filter @agentproto/agent-runtime build && pnpm --filter @agentproto/cli build
    

    You only need this on first run or after pulling changes — tsup --watch (from pnpm dev) keeps it fresh.

  3. Start the swarm. Pass through any user-supplied args (--once, --interval, --verbose). Default:

    pnpm agentproto run-swarm --manifest .runtime/multi-agent.yaml --verbose
    

    This is a long-running loop. Suggest the user open a separate terminal for it, OR run with --once to do a single dispatch cycle and exit.

  4. Seeding the journal: tell the user that participant turns only fire on @Mention of a known participant. Show them how to add a seed turn manually:

    cat <<'EOF' >> .runtime/conversation.md
    === TURN id=t_seed participant=user ts=$(date -u +%FT%TZ) ===
    @Reviewer please look at <file or topic>
    EOF
    

    Or just edit .runtime/conversation.md directly in the editor.

Notes

  • The journal at .runtime/conversation.md is the source of truth for file mode. It's gitignored. Resetting = deleting the file.
  • Per-participant scratch state lives at .runtime/state/<participantId>.json. Also gitignored.
  • Other substrates (chat servers, MCP bridges, …) ship as separate plugin packages. Register them via --plugin <module-id> on run-swarm, or list them under plugins[] in ~/.agentproto/config.json.

Errors to watch

  • "unknown substrate kind ''. Registered kinds: […]" → the manifest's substrate.kind has no matching factory. Either fix the kind, or install the plugin that provides it and pass --plugin <module-id>.
  • "manifest file not found" → check the path; the verb resolves it from the current cwd.
  • Spawned claude returning non-zero → the participant agent's command failed. Check stderr in the swarm process output.

Read the full file on GitHub · 57 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. 1mo ago First seen · 57 lines · 0 tokens per session scan A f7e9615baed7

Subscribe to this mod's changes

ap-swarm is a command published in the GitHub repository agentproto/ts (10 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 633 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-31.