Borrowing it
Nothing to install: this file belongs to christopherkarani/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/christopherkarani/Swarm/main/CLAUDE.mdgit clone --depth 1 https://github.com/christopherkarani/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/christopherkarani/swarm/claude-md)<a href="https://agentmods.dev/instructions/christopherkarani/swarm/claude-md"><img src="https://agentmods.dev/badge/instructions/christopherkarani/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/christopherkarani/swarm/claude-md"><img src="https://agentmods.dev/badge/instructions/christopherkarani/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.04360 | $0.04360 |
| Opus 5.5 | $0.01744 | $0.01744 |
| Sonnet 5.5 | $0.00872 | $0.00872 |
| Haiku 4.5 | $0.00436 | $0.00436 |
Grade A, and why
Swarm CLAUDE.md 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.
How it starts
The opening of the file, as written. The whole thing — 356 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Guidance for AI coding assistants (Claude Code, Cursor, etc.) working in this repository. This file is the canonical, in-repo briefing — read it before making changes.
What is Swarm?
Swarm is a Swift 6.2 framework for building agents and multi-agent workflows on Apple platforms (iOS 26+, macOS 26+, tvOS 26+) and Linux. It is built around:
- Agents —
Agentstruct with@ToolBuildertrailing closures, anAgentRuntimeprotocol, and pluggable inference providers. - Workflows — fluent composition (
.step,.parallel,.route,.repeatUntil) compiled to a DAG with checkpoint/resume. - Tools — the
@Toolmacro generates JSON schemas from Swift structs at compile time;FunctionToolcovers ad-hoc closures. - Memory — conversation, sliding-window, summary, vector, and persistent backends.
- Guardrails / Resilience / Observability — first-class concerns, not bolt-ons.
- Providers — Built-in Apple Foundation Models; custom backends inject
InferenceProvider. No Conduit / cloud façade ships with Swarm. - MCP — Model Context Protocol client and server support.
The package uses Swift 6.2 with StrictConcurrency enabled across all targets.
All public types must be Sendable — the compiler enforces it.
Repository Layout
Swarm/
├── Package.swift # SPM manifest (Swift 6.2, products)
├── README.md # User-facing overview
├── Sources/
│ ├── Swarm/ # Main library (156 .swift files)
│ │ ├── Agents/ # Agent struct, workspace integration
│ │ ├── Core/ # AgentRuntime, Conversation, Environment,
│ │ │ # PromptEnvelope, RuntimeMetadata, …
│ │ ├── Workflow/ # Workflow + durable engine + checkpointing
│ │ ├── Tools/ # Tool protocol, ToolCollection, ParallelExecutor,
│ │ │ # built-ins, web tools, schema bridging
│ │ ├── Memory/ # Conversation, sliding window, summary, vector,
│ │ │ # SwiftData, ContextCore, hybrid backends
│ │ ├── Providers/ # Foundation Models, multi-provider, sessions
│ │ ├── Guardrails/ # Input/Output/Tool guardrail specs + runner
│ │ ├── Resilience/ # Retry, circuit breaker, fallback, rate limit
│ │ ├── Observability/ # AgentTracer, SwiftLog/OSLog tracers, metrics
│ │ ├── MCP/ # MCPClient, MCPServerConnection, stdio/HTTP transports, ToolBridge
│ │ ├── Workspace/ # AgentWorkspace (AGENTS.md, .swarm/ skills)
│ │ ├── Macros/ # Public macro declarations
│ │ ├── Integration/ # Membrane and Wax integrations
│ │ └── Internal/GraphRuntime/ # Compiled DAG runtime (internal)
│ ├── HiveCore/ # In-tree durable graph (Integrations only)
│ ├── MembraneCore/ # In-tree Membrane core (Integrations only)
│ ├── Membrane/ # In-tree Membrane session (Integrations only)
│ ├── MembraneContextCore/ # In-tree Membrane↔ContextCore (Integrations)
│ ├── ContextCoreTypes/ # In-tree ContextCore types (Integrations)
│ ├── ContextCoreShaders/ # In-tree Metal shaders (Integrations)
│ ├── ContextCoreEngine/ # In-tree ContextCore engine (Integrations)
│ ├── ContextCore/ # In-tree ContextCore façade (Integrations)
│ ├── SwarmMacros/ # Compiler plugin (@Tool, @Parameter,
│ │ # @Traceable, #Prompt, builders)
│ ├── SwarmMembrane/ # Deprecated hollow re-export (remove in 0.7.0)
│ ├── SwarmMCP/ # MCP server adapter product
│ ├── SwarmCapabilityShowcase/ # Executable: deterministic showcase CLI
│ ├── SwarmCapabilityShowcaseSupport/ # Library backing the showcase
│ ├── SwarmDemo/ # (opt-in) demo executable
│ └── SwarmMCPServerDemo/ # (opt-in) MCP server demo
├── Tests/
│ ├── SwarmTests/ # Main test target (mirrors Sources/Swarm)
│ │ └── Mocks/ # MockAgentRuntime, MockInferenceProvider, …
│ ├── HiveSwarmTests/ # Hive integration tests
│ ├── SwarmMacrosTests/ # Macro expansion tests
│ └── SwarmCapabilityShowcaseTests/
├── Examples/CodeReviewer/ # Standalone example SPM project
├── docs/
│ ├── guide/ # Getting started, agent workspace, showcase
│ ├── reference/ # API catalog, front-facing-api, audits
│ └── release/ # release-checklist.md
└── .github/workflows/ # swift.yml, claude.yml, claude-code-review.yml,
# docs.yml
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.
- 1mo ago Changed · +1 lines · +21 tokens per session 0a57cdee05c1
- 1mo ago Changed · +2 tokens per session 4ac69d381e49
- 2mo ago First seen · 355 lines · 4,337 tokens per session scan A 2bd08d4a578d
Swarm CLAUDE.md is an instructions file published in the GitHub repository christopherkarani/Swarm (587 stars, last pushed 3d ago), licensed MIT. It adds 4,360 tokens to every session, about $0.0174 per session on Opus 5.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-30.
Swarm CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Swarm CLAUDE.mdchristopherkarani/Swarm | Instructions file | 587 | 3d ago | MIT | A | 4,360 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |