agent-swarm: Instructions file for Claude Code

CLAUDE.md

agent-swarm CLAUDE.md is an instructions file for Claude Code from desplega-ai/agent-swarm. It costs 8,378 tokens per session, scanned A, original, MIT.

A set of instructions for working on the Agent Swarm project, including its architecture, commands, code-search method, and development rules. Agent Swarm coordinates several coding agents.

In plain words
What is it for?
Use it when developing or reviewing the Agent Swarm codebase, starting its server, searching its code, or checking architectural constraints.
Why use it?
It keeps changes consistent with rules about databases, API keys, prompts, and worker communication.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions subagents; positional $N argument.

This is desplega-ai/agent-swarm's own configuration. It tells Claude Code how to work on agent-swarm itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-swarm configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/worker/.{npm,cache}.

Reuse

Borrowing it

Nothing to install: this file belongs to desplega-ai/agent-swarm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/desplega-ai/agent-swarm/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/desplega-ai/agent-swarm

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 agent-swarm CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/desplega-ai/agent-swarm/claude-md/github.svg)](https://agentmods.dev/instructions/desplega-ai/agent-swarm/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/desplega-ai/agent-swarm/claude-md"><img src="https://agentmods.dev/badge/instructions/desplega-ai/agent-swarm/claude-md/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 agent-swarm CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/desplega-ai/agent-swarm/claude-md"><img src="https://agentmods.dev/badge/instructions/desplega-ai/agent-swarm/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8,378 This file is loaded in full into every session.
When invoked 8,378 The same file — it is already loaded in full.
Security scan A 2 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.08378 $0.08378
Opus 5 $0.04189 $0.04189
Sonnet 5 $0.01676 $0.01676
Haiku 4.5 $0.00838 $0.00838

Measured today against content hash 69d7761fd02b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

agent-swarm CLAUDE.md scanned grade A with 2 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 today.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **`ENV HOME=/home/worker` survives `USER root`** — `npm install` / `playwright install` / curl-pipe-bash under root will dump caches into `/home/worker/.{npm,cache}`. Override `HOME=/root` and redirect caches (`NPM_CON

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

bash scripts/check-test-spawn-sync.sh # tests must use runChild(), never Bun.spawnSync
CLAUDE.md · 373 lines

How it starts

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

Agent Swarm

Multi-agent orchestration for Claude Code, Codex, Gemini CLI. Bun + TypeScript, bun:sqlite (WAL), Biome, Ink CLI.

See CONTRIBUTING.md to get set up. Start the server with bun run start:http.

Architecture invariants

The API server (src/http.ts, src/server.ts, src/tools/, src/http/) is the sole owner of the SQLite database. Worker-side code (src/commands/, src/hooks/, src/providers/, src/prompts/, src/cli.tsx, src/claude.ts) must never import from src/be/db or bun:sqlite. Workers talk to the API over HTTP using the swarm API key + X-Agent-ID headers. Enforced by scripts/check-db-boundary.sh (CI).

The swarm API key MUST be read via getApiKey() from src/utils/api-key.ts — never process.env.API_KEY / process.env.AGENT_SWARM_API_KEY directly. Precedence: AGENT_SWARM_API_KEY > API_KEY. Enforced by scripts/check-api-key-boundary.sh (CI).

System prompt and task prompt text MUST go through the prompt-template registry in src/prompts/; do not hardcode new prompt sections with string concatenation in runners, hooks, or providers. Add or update a registered template, then resolve it from the call site.

All runtime DB access goes through the async seam: getDbClient() from src/be/db.ts. Use await client.query<Row>(sql, params) / get<Row> / run, and await client.transaction(async (tx) => ...). Raw sync access (getDb(), .prepare(, bun:sqlite imports) is allowed only for the boot-path files listed in scripts/check-async-db-seam.sh (CI-enforced).

  • Client-level calls made inside a transaction callback join that transaction automatically (AsyncLocalStorage routing). Nested transaction calls become SAVEPOINTs.
  • transaction opens with BEGIN IMMEDIATE (write lock taken at BEGIN, with cross-process BUSY retry). Pass { readOnly: true } only for SELECT-only callbacks. Boot-path code that still uses raw db.transaction(fn) must invoke it as .immediate(...). A deferred BEGIN that reads before it writes fails with SQLITE_BUSY_SNAPSHOT ("database is locked") when a second process shares the file, and busy_timeout never retries that error.
  • Post-commit hooks (telemetry, workflow event-bus emits) MUST use getDbClient().afterCommit(fn), never queueMicrotask or a bare .then(). Microtasks drain BEFORE COMMIT under async transaction callbacks, so they can observe or publish uncommitted state.
  • A missing await on an async DB call compiles clean in many positions and fails silently at runtime. CI catches this class via bun scripts/check-floating-promises.ts (statement position) and bun scripts/check-promise-sinks.ts (truthiness, serialization, object-literal sinks). Run both locally before pushing, next to the usual gates.

Read the full file on GitHub · 373 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. today Changed · +2 lines · +110 tokens per session 69d7761fd02b
  2. 4d ago Changed · +71 tokens per session dfdd31b9a864
  3. 5d ago Changed · +3 lines · +85 tokens per session d0ea435293e4
  4. 9d ago First seen · 368 lines · 8,112 tokens per session scan A e1cb86b94e81

Subscribe to this mod's changes

agent-swarm CLAUDE.md is an instructions file published in the GitHub repository desplega-ai/agent-swarm (754 stars, last pushed today), licensed MIT. It adds 8,378 tokens to every session, about $0.0419 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens