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.
npx agentmods add commands/agentproto/ts/ap-swarmgit clone --depth 1 https://github.com/agentproto/tsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00021 | $0.00633 |
| Opus 5 | $0.00010 | $0.00316 |
| Sonnet 5 | $0.00004 | $0.00127 |
| Haiku 4.5 | $0.00002 | $0.00063 |
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 2d 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.
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
-
If
.runtime/multi-agent.yamldoes not exist, copy the template:mkdir -p .runtime && cp .claude/examples/swarm-local.md .runtime/multi-agent.yamlThen read it back and tell the user what's wired (participants, substrate kind, state dir).
-
Build the agent-runtime + cli packages if they haven't been built yet:
pnpm --filter @agentproto/agent-runtime build && pnpm --filter @agentproto/cli buildYou only need this on first run or after pulling changes —
tsup --watch(frompnpm dev) keeps it fresh. -
Start the swarm. Pass through any user-supplied args (
--once,--interval,--verbose). Default:pnpm agentproto run-swarm --manifest .runtime/multi-agent.yaml --verboseThis is a long-running loop. Suggest the user open a separate terminal for it, OR run with
--onceto do a single dispatch cycle and exit. -
Seeding the journal: tell the user that participant turns only fire on
@Mentionof 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> EOFOr just edit
.runtime/conversation.mddirectly in the editor.
Notes
- The journal at
.runtime/conversation.mdis 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>onrun-swarm, or list them underplugins[]in~/.agentproto/config.json.
Errors to watch
- "unknown substrate kind ''. Registered kinds: […]" → the manifest's
substrate.kindhas 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
claudereturning non-zero → the participant agent's command failed. Check stderr in the swarm process output.
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.
- 2d ago First seen · 57 lines · 0 tokens per session scan A f7e9615baed7
ap-swarm is a command published in the GitHub repository agentproto/ts (5 stars, last pushed 2d ago), licensed Apache-2.0. It adds 21 tokens to every session and 633 once invoked, about $0.0001 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-31.
Other commands, from other repositories
ctx
Search agent history or trace code to its original agent session.
compact-prep
Ask the agent to prepare for conversation compaction by updating any relevant state and providing guidance for the compaction agent and to kick off the session there after.
hatch3r-codebase-map
Reverse-engineer a brownfield codebase into current-state module boundaries, integration-point inventory, tech-debt register, and dependency graph via static analysis.
hatch3r-bug-plan
Diagnose a complex incident -- reproduce the symptom, rank root-cause hypotheses, design the fix path, and emit regression coverage items as a board-ready investigation.
hatch3r-api-spec
Generate or validate an OpenAPI specification from the codebase. Scans route definitions, extracts schemas, and produces a complete API spec.
hatch3r-benchmark
Run and analyze performance benchmarks. Compare results against baselines, identify regressions, and produce performance reports.