# claude_agent_sdk v0.11.0 - Table of Contents An Elixir SDK for Claude Code - Build AI-powered CLI tools with Claude ## Pages - Getting Started - [README](readme.md) - [Getting Started with Claude Agent SDK for Elixir](getting-started.md) - Core Guides - [Streaming Guide](streaming.md) - [Hooks Guide](hooks.md) - [MCP Tools Guide](mcp-tools.md) - [Permissions Guide](permissions.md) - Advanced Topics - [Configuration Guide](configuration.md) - [Agents Guide](agents.md) - [Sessions Guide](sessions.md) - Testing & Errors - [Testing Guide for Claude Agent SDK](testing.md) - [Error Handling Guide](error-handling.md) - Examples - [Examples](examples.md) - [Mix Task Chat Example](mix-task-chat-example.md) - [Phoenix Chat - Claude Agent SDK Demo](phoenix-chat-example.md) - [Document Generation Example](document-generation-example.md) - [Research Agent](research-agent-example.md) - [Skill Invocation Example](skill-invocation-example.md) - [Email Agent](email-agent-example.md) - Release Notes - [Changelog](changelog.md) - [LICENSE](license.md) ## Modules - [ClaudeAgentSDK.AbortSignal](ClaudeAgentSDK.AbortSignal.md): Lightweight cancellation token shared with callbacks. - [ClaudeAgentSDK.Agent](ClaudeAgentSDK.Agent.md): Agent definition for custom agent profiles. - [ClaudeAgentSDK.AssistantError](ClaudeAgentSDK.AssistantError.md): Enumerates assistant-level error codes surfaced by the Claude CLI. - [ClaudeAgentSDK.CLI](ClaudeAgentSDK.CLI.md): Centralized Claude CLI discovery and version tracking. - [ClaudeAgentSDK.Config](ClaudeAgentSDK.Config.md): Centralizes application environment reads for the SDK. - [ClaudeAgentSDK.Errors](ClaudeAgentSDK.Errors.md): Structured error types for programmatic handling. - [ClaudeAgentSDK.Errors.Guards](ClaudeAgentSDK.Errors.Guards.md): Guard macros for pattern matching SDK errors. - [ClaudeAgentSDK.Log](ClaudeAgentSDK.Log.md): SDK-scoped logger wrapper with a configurable minimum log level. - [ClaudeAgentSDK.Model](ClaudeAgentSDK.Model.md): Model validation and normalization utilities. - [ClaudeAgentSDK.Permission](ClaudeAgentSDK.Permission.md): Permission System for Claude Agent SDK. - [ClaudeAgentSDK.Permission.Context](ClaudeAgentSDK.Permission.Context.md): Permission context passed to permission callbacks. - [ClaudeAgentSDK.Permission.Result](ClaudeAgentSDK.Permission.Result.md): Permission result returned by permission callbacks. - [ClaudeAgentSDK.Permission.RuleValue](ClaudeAgentSDK.Permission.RuleValue.md): Permission rule value struct. - [ClaudeAgentSDK.Permission.Update](ClaudeAgentSDK.Permission.Update.md): Permission update types for configuring permissions via the control protocol. - [ClaudeAgentSDK.Query.CLIStream](ClaudeAgentSDK.Query.CLIStream.md): Streams CLI-only query responses over a transport. - [ClaudeAgentSDK.Query.ClientStream](ClaudeAgentSDK.Query.ClientStream.md): Wraps the `ClaudeAgentSDK.Client` GenServer to provide a Stream interface. - [ClaudeAgentSDK.Streaming.EventAdapter](ClaudeAgentSDK.Streaming.EventAdapter.md): Utilities for working with heterogeneous streaming event/message streams. - [ClaudeAgentSDK.Streaming.Termination](ClaudeAgentSDK.Streaming.Termination.md): Shared termination logic for streaming sessions. - [ClaudeAgentSDK.TaskSupervisor](ClaudeAgentSDK.TaskSupervisor.md): Optional Task.Supervisor for supervised callback execution. - [ClaudeAgentSDK.Tool](ClaudeAgentSDK.Tool.md): Tool definition macro for creating in-process MCP tools. - [ClaudeAgentSDK.Tool.Registry](ClaudeAgentSDK.Tool.Registry.md): GenServer that manages tool registration and execution for SDK MCP servers. - [ClaudeAgentSDK.Transport](ClaudeAgentSDK.Transport.md): Behaviour describing the transport layer used to communicate with the Claude CLI. - [ClaudeAgentSDK.Transport.Erlexec](ClaudeAgentSDK.Transport.Erlexec.md): Transport implementation backed by erlexec. - [ClaudeAgentSDK.Transport.Port](ClaudeAgentSDK.Transport.Port.md): Default transport implementation that uses Erlang `Port`s to communicate with the Claude CLI. - [ClaudeAgentSDK.Transport.StreamingRouter](ClaudeAgentSDK.Transport.StreamingRouter.md): Selects streaming transport based on required features. - Core API - [ClaudeAgentSDK](ClaudeAgentSDK.md): An Elixir SDK for Claude Code. - [ClaudeAgentSDK.Client](ClaudeAgentSDK.Client.md): Bidirectional client for Claude Code with hooks support. - [ClaudeAgentSDK.Orchestrator](ClaudeAgentSDK.Orchestrator.md): Concurrent query orchestration with rate limiting and error recovery. - [ClaudeAgentSDK.Query](ClaudeAgentSDK.Query.md): Handles querying Claude Code and processing responses. - Session - [ClaudeAgentSDK.Session](ClaudeAgentSDK.Session.md): Helper functions for working with Claude sessions. - [ClaudeAgentSDK.SessionStore](ClaudeAgentSDK.SessionStore.md): Persistent session storage and management. - Authentication - [ClaudeAgentSDK.Auth.Provider](ClaudeAgentSDK.Auth.Provider.md): Multi-provider authentication abstraction. - [ClaudeAgentSDK.Auth.Providers.Anthropic](ClaudeAgentSDK.Auth.Providers.Anthropic.md): Anthropic-specific authentication via `claude setup-token`. - [ClaudeAgentSDK.Auth.Providers.Bedrock](ClaudeAgentSDK.Auth.Providers.Bedrock.md): AWS Bedrock authentication. - [ClaudeAgentSDK.Auth.Providers.Vertex](ClaudeAgentSDK.Auth.Providers.Vertex.md): Google Vertex AI authentication. - [ClaudeAgentSDK.Auth.TokenStore](ClaudeAgentSDK.Auth.TokenStore.md): Persistent token storage for authentication. - [ClaudeAgentSDK.AuthChecker](ClaudeAgentSDK.AuthChecker.md): Authentication checker and environment validator for Claude Code SDK. - [ClaudeAgentSDK.AuthManager](ClaudeAgentSDK.AuthManager.md): Manages authentication tokens for Claude Code SDK. - Streaming - [ClaudeAgentSDK.Streaming](ClaudeAgentSDK.Streaming.md): Bidirectional streaming for interactive Claude conversations. - [ClaudeAgentSDK.Streaming.EventParser](ClaudeAgentSDK.Streaming.EventParser.md): Parses streaming events from Claude CLI's `--include-partial-messages` output. - [ClaudeAgentSDK.Streaming.Session](ClaudeAgentSDK.Streaming.Session.md): GenServer managing a persistent bidirectional streaming session with Claude. - Message Handling - [ClaudeAgentSDK.ContentExtractor](ClaudeAgentSDK.ContentExtractor.md): Content extraction helper for Claude Code SDK messages. - [ClaudeAgentSDK.Message](ClaudeAgentSDK.Message.md): Represents a message from Claude Code CLI. - Configuration - [ClaudeAgentSDK.OptionBuilder](ClaudeAgentSDK.OptionBuilder.md): Smart option builder for Claude Code SDK configurations. - [ClaudeAgentSDK.Options](ClaudeAgentSDK.Options.md): Configuration options for Claude Code SDK requests. - Testing - [ClaudeAgentSDK.Mock](ClaudeAgentSDK.Mock.md): Mock implementation for the Claude Code CLI for testing purposes. - [ClaudeAgentSDK.Mock.Process](ClaudeAgentSDK.Mock.Process.md): Mock process implementation that returns predefined responses instead of spawning a CLI. - Hooks - [ClaudeAgentSDK.Hooks](ClaudeAgentSDK.Hooks.md): Type definitions and utilities for Claude Code Hooks. - [ClaudeAgentSDK.Hooks.Matcher](ClaudeAgentSDK.Hooks.Matcher.md): Hook matcher configuration. - [ClaudeAgentSDK.Hooks.Output](ClaudeAgentSDK.Hooks.Output.md): Hook output structure and helpers. - [ClaudeAgentSDK.Hooks.Registry](ClaudeAgentSDK.Hooks.Registry.md): Hook callback registration and ID management. - Control Protocol - [ClaudeAgentSDK.ControlProtocol.Protocol](ClaudeAgentSDK.ControlProtocol.Protocol.md): Control protocol message encoding and decoding. - Utilities - [ClaudeAgentSDK.DebugMode](ClaudeAgentSDK.DebugMode.md): Comprehensive debugging and diagnostics for Claude Code SDK. - [ClaudeAgentSDK.JSON](ClaudeAgentSDK.JSON.md): Simple JSON parser for Claude Code SDK. - [ClaudeAgentSDK.Process](ClaudeAgentSDK.Process.md): Handles spawning and communicating with the Claude Code CLI process using erlexec. - Exceptions - [ClaudeAgentSDK.Errors.CLIConnectionError](ClaudeAgentSDK.Errors.CLIConnectionError.md): Raised when the SDK fails to connect to the Claude CLI process. - [ClaudeAgentSDK.Errors.CLIJSONDecodeError](ClaudeAgentSDK.Errors.CLIJSONDecodeError.md): Raised when the SDK fails to decode JSON output from the CLI. - [ClaudeAgentSDK.Errors.CLINotFoundError](ClaudeAgentSDK.Errors.CLINotFoundError.md): Raised when the Claude CLI executable cannot be found. - [ClaudeAgentSDK.Errors.ClaudeSDKError](ClaudeAgentSDK.Errors.ClaudeSDKError.md): Base exception for all Claude Agent SDK errors. - [ClaudeAgentSDK.Errors.MessageParseError](ClaudeAgentSDK.Errors.MessageParseError.md): Raised when a message from the CLI cannot be parsed into a known type. - [ClaudeAgentSDK.Errors.ProcessError](ClaudeAgentSDK.Errors.ProcessError.md): Raised when the Claude CLI process exits with an error. ## Mix Tasks - Mix Tasks - [mix claude.setup_token](Mix.Tasks.Claude.SetupToken.md): Sets up a long-lived authentication token for Claude Code SDK. - [mix run.live](Mix.Tasks.Run.Live.md): Runs Elixir scripts against the live Claude API instead of using mocks. - [mix showcase](Mix.Tasks.Showcase.md): Run the Claude Code SDK comprehensive showcase. - [mix test.live](Mix.Tasks.Test.Live.md): Runs tests against the live Claude API instead of using mocks.