tddworks

ClaudeAgentSDK — Development skill for Claude Code

Development community

Swift SDK for Claude Code — feature parity with the official Python SDK.

How to install ClaudeAgentSDK

This entry records only its repository, not the path inside it, so there is no exact command to give. Open tddworks/ClaudeAgentSDK and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What ClaudeAgentSDK does

Swift SDK for Claude Code — feature parity with the official Python SDK.

Alternatives in Development

README

ClaudeAgentSDK

A Swift SDK for [Claude Code](https://docs.claude.com/en/docs/agents-and-tools/claude-agent-sdk/overview). Feature-equivalent to the [official Python SDK](https://github.com/anthropics/claude-agent-sdk-python), implemented as a thin, strongly-typed wrapper around the `claude` CLI.

  • One-shot queries and bidirectional conversations
  • Typed messages, content blocks, hooks, permissions, and control protocol
  • In-process MCP servers — register Swift closures as tools Claude can call
  • Session management: list / fork / rename / tag / delete transcripts from ~/.claude/projects/
  • Structured JSON output via JSON schema
  • Transcript mirroring to a custom SessionStore adapter
  • Real claude CLI smoke-tested; hermetic unit tests via /bin/sh fixtures

**193 tests across 45 suites.** Zero test dependencies outside the Swift Testing framework and [Mockable](https://github.com/Kolos65/Mockable).

**Upstream parity:** this release tracks [Python SDK `0.1.63`](https://github.com/anthropics/claude-agent-sdk-python/blob/main/CHANGELOG.md) (bundled Claude CLI 2.1.114). See [CHANGELOG.md](CHANGELOG.md).


Requirements

  • macOS 15 (Sequoia) or later — uses Foundation.Process + AsyncSequence
  • Swift 6.2 toolchain
  • `claude` CLI on $PATH with valid auth (for real usage; tests run hermetically without it)

Installation

// Package.swift
dependencies: [
    .package(url: "https://github.com/tddworks/ClaudeAgentSDK.git", from: "0.1.63")
],
targets: [
    .target(name: "YourApp", dependencies: [
        .product(name: "ClaudeAgentSDKDomain", package: "ClaudeAgentSDK"),
        .product(name: "ClaudeAgentSDKInfrastructure", package: "ClaudeAgentSDK"),
    ]),
]

Quick start — one-shot query

import ClaudeAgentSDKDomain
import ClaudeAgentSDKInfrastructure

var options = ClaudeAgentOptions()
options.permissionMode = .bypassPermissions
options.maxTurns = 1

for try await message in Claude.