agent-squad-swift

agent-squad-swift is a skill for Claude Code, Codex from 2FastLabs/agent-squad. It costs 91 tokens per session (3,648 once invoked), scanned A, original, Apache-2.0.

A guide for building Swift apps with AgentSquad, a framework for coordinating one or more on-device AI assistants on iPhone, iPad, and Mac. It covers assistants, routing, tools, voice, storage, and tracing.

In plain words
What is it for?
Use it when adding or changing AgentSquad-based Swift features, such as assistant routing, OpenAI-compatible models, native or MCP tools, tool interfaces, saved conversations, or voice assistants.
Why use it?
It helps developers choose the right framework component for a single assistant, several specialist assistants, data-grounded answers, or voice interaction.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/2fastlabs/agent-squad/swift
Any agent
npx skills add 2FastLabs/agent-squad --skill swift
Clone the repo
git clone --depth 1 https://github.com/2FastLabs/agent-squad

Made for: Claude Code, Codex.

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-squad-swift

README.md
[![agentmods](https://agentmods.dev/badge/skills/2fastlabs/agent-squad/swift.svg)](https://agentmods.dev/skills/2fastlabs/agent-squad/swift)
Your own site
<a href="https://agentmods.dev/skills/2fastlabs/agent-squad/swift"><img src="https://agentmods.dev/badge/skills/2fastlabs/agent-squad/swift.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,648 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00091 $0.03648
Opus 5 $0.00046 $0.01824
Sonnet 5 $0.00018 $0.00730
Haiku 4.5 $0.00009 $0.00365

Measured 4d ago against content hash 8ec7c834482d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-squad-swift 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.

swift/SKILL.md · 170 lines

How it starts

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

AgentSquad Swift — assistant guide

Protocol-driven, on-device multi-agent framework (Swift 6.2, iOS 16+ / macOS 14+; persistence via FileChatStorage on iOS 16+, DeviceChatStorage on iOS 17+). This is guidance and a map — not an API reference. Read the exact signatures from the source (swift/Sources/AgentSquad/) and the worked recipes from the docs site sources (docs/src/content/docs/swift/); this file tells you what to use, when, and what to watch out for.

When to use what

  • One assistant → an Agent (or GroundedAgent) + an Orchestrator with no classifier. No routing hop.
  • Several specialists → multiple agents + an LLMClassifier; the orchestrator routes each turn.
  • Answers must not drift from data (prices, stock, balances) → GroundedAgent: a Brain calls tools, an isolated Presenter speaks only from the curated results (it can be a smaller/local model).
  • Voice → a VoiceAssistant (a peer of the orchestrator, not an agent): OpenAIVoiceAssistant (single LLM + tools, speaks directly — the spoken analog of Agent) or OpenAIGroundedVoiceAssistant (Brain → Presenter, can't drift from data — analog of GroundedAgent).

Every component is a Sendable protocol with one built-in implementation — swap in your own anywhere.

Modules (import only what you use)

Import Pulls in Contents
AgentSquad nothing external protocols, Agent, GroundedAgent, Orchestrator, LLMClassifier, ChatCompletionsClient, DakeraRetriever, FileChatStorage, DeviceChatStorage, InMemoryChatStorage, TransformingChatStorage, SummarizingChatStorage, OSLogTracer, OTLP export
AgentSquadMCP MCP Swift SDK MCPServer (= MCPToolProvider), SDKMCPClient
AgentSquadAudio AVFoundation VoiceProcessedAudioIO (capture+playback, one engine, AEC — the recommended wiring), MicCapture (voice-processed/AEC by default), AudioPlayback, VoiceProcessing, AudioSessionPolicy (needs NSMicrophoneUsageDescription)

Read the full file on GitHub · 170 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 170 lines · 91 tokens per session scan A 8ec7c834482d

Subscribe to this mod's changes

agent-squad-swift is a skill published in the GitHub repository 2FastLabs/agent-squad (7,753 stars, last pushed today), licensed Apache-2.0. It adds 91 tokens to every session and 3,648 once invoked, about $0.0005 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.