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 instructions/christopherkarani/swarm/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.svg" alt="Measured on agentmods" 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 | $0.04337 | $0.04337 |
| Opus 5 | $0.02168 | $0.02168 |
| Sonnet 5 | $0.00867 | $0.00867 |
| Haiku 4.5 | $0.00434 | $0.00434 |
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 4d 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 — 355 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.
- 4d 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 (574 stars, last pushed 5d ago), licensed MIT. It adds 4,337 tokens to every session, about $0.0217 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-30.
Other instructions, from other repositories
swift-architecture-skill AGENTS.md
Instructions for efremidze/swift-architecture-skill, covering agents guidelines for swift architecture skill, working with this repository, 1. understanding the skill, 2. modifying architecture playbooks and 3. testing and validation.
Autono CLAUDE.md
Claude Code instructions for vortezwohl/Autono, covering claude.md, project overview, architecture, core components and key design patterns.
auxilia CLAUDE.md
Claude Code instructions for keurcien/auxilia, covering claude.md, project overview, backend conventions, layered architecture and naming.
Dingent CLAUDE.md
Instructions for Dingent/Dingent, covering gitnexus — code intelligence, always do, never do, resources and cli.
swift-developer CLAUDE.md
Claude Code instructions for hmohamed01/swift-developer, covering claude.md, plugin purpose, key features, structure and development notes.
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).