Claude Agent SDK Swift — Development skill for Claude Code
Community Claude Agent SDK for Swift, with streaming, MCP, session stores, and tracing.
How to install Claude Agent SDK Swift
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open ya-luotao/claude-agent-sdk-swift and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Agent SDK Swift does
Community Claude Agent SDK for Swift, with streaming, MCP, session stores, and tracing.
Alternatives in Development
- Root Cause Tracing — Use when errors occur deep in execution and you need to trace back to find the original trigger 102.5k ★
- MCP Python SDK — Python SDK for building MCP servers 22.3k ★
- Storybloq — Cross-session context for Claude Code 696 ★
README
Claude Agent SDK for Swift
A community Swift SDK for the Claude Code CLI, built with Swift 6, `async/await`, actors, and `AsyncSequence`. **macOS 13+ comes first**. The `CLITransport` interface separates the protocol from native process management to support a future Linux implementation. No third-party runtime dependencies, Python, or Ruby are required.
The protocol follows the [official Python SDK 0.2.153](https://github.com/anthropics/claude-agent-sdk-python/tree/763922b0de2c9fb5371504d73ae54cde49536fe1), with additional API capabilities from the [community Ruby SDK 0.33.1](https://github.com/ya-luotao/claude-agent-sdk-ruby/tree/7d4ec3779770adb83b32be86b5431a506b1a6ce5): one-shot and multi-turn queries, asynchronous input, permissions and hooks, MCP, session history and external storage, a CLI installer, observers, and OTLP tracing.
The implementation covers the main feature areas, with explicit semantic and platform differences documented in the [feature comparison](docs/PARITY.md). Builds, local tests, and initialization with the real CLI have passed. Live model tests did not pass because the test environment was not authenticated; see the [validation record](docs/VALIDATION.md).
Installation
Requires Swift 6, macOS 13+, and an authenticated Claude Code CLI. Add the [repository](https://github.com/ya-luotao/claude-agent-sdk-swift) to your application's `Package.swift`:
dependencies: [
.package(url: "https://github.com/ya-luotao/claude-agent-sdk-swift.git", branch: "main"),
],
targets: [
.executableTarget(name: "MyAgent", dependencies: [
.product(name: "ClaudeAgentSDK", package: "claude-agent-sdk-swift"),
]),
]
The SDK discovers the CLI in this order: `options.cliPath`, the project's `vendor/claude`, PATH, and common user installation directories. You can explicitly install a pinned version with SHA-256 verification:
let executable = try await CLIInstaller().install(version: "2.1.278")
var options = ClaudeAg
Related Skills
Claw
86 Native macOS app wrapping Claude Code SDK in Swift. Plan Mode, MCP Integration, Custom System Prompts
MCPSwiftWrapper
A light wrapper around mcp-swift-sdk for easy usage of MCP clients in Swift
MCP Recall
mcp-recall compresses MCP tool outputs (94 KB → 3.5 KB · 96%) and stores full results in SQLite for retrieval
Claude Agent SDK
An Elixir SDK for Claude Code - provides programmatic access to Claude Code CLI with streaming message process
Claude Code Headless
Programmatically drive the real Claude Code CLI in a PTY — structured semantic/screen/committed events, live t
ClaudeAgentSDK
Swift SDK for Claude Code — feature parity with the official Python SDK
Related Agents
AI SDK Expert
Expert in Vercel AI SDK v5 handling streaming, model integration, tool calling, hooks, state management, edge
Vercel AI SDK Expert
Use for Vercel AI SDK v5 implementation work: chat interfaces, tool calling, streaming, agentic loop control,
iOS
Use for iOS app development tasks: Swift and SwiftUI code, UIKit work, Xcode project configuration, App Store