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.
curl -O https://raw.githubusercontent.com/desplega-ai/agent-swarm/main/CLAUDE.mdgit clone --depth 1 https://github.com/desplega-ai/agent-swarmWrote 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.
[](https://agentmods.dev/instructions/desplega-ai/agent-swarm/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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 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
transactioncalls become SAVEPOINTs. transactionopens withBEGIN 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 rawdb.transaction(fn)must invoke it as.immediate(...). A deferred BEGIN that reads before it writes fails withSQLITE_BUSY_SNAPSHOT("database is locked") when a second process shares the file, andbusy_timeoutnever retries that error.- Post-commit hooks (telemetry, workflow event-bus emits) MUST use
getDbClient().afterCommit(fn), neverqueueMicrotaskor a bare.then(). Microtasks drain BEFORE COMMIT under async transaction callbacks, so they can observe or publish uncommitted state. - A missing
awaiton an async DB call compiles clean in many positions and fails silently at runtime. CI catches this class viabun scripts/check-floating-promises.ts(statement position) andbun scripts/check-promise-sinks.ts(truthiness, serialization, object-literal sinks). Run both locally before pushing, next to the usual gates.
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.
- today Changed · +2 lines · +110 tokens per session 69d7761fd02b
- 4d ago Changed · +71 tokens per session dfdd31b9a864
- 5d ago Changed · +3 lines · +85 tokens per session d0ea435293e4
- 9d ago First seen · 368 lines · 8,112 tokens per session scan A e1cb86b94e81
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.
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.
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.
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).
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).
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.
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.