Expand description
Core data types for the Claude Code SDK.
This module defines all the configuration, message, and permission types used throughout the SDK. These types correspond to the Python SDK’s type definitions documented at https://platform.claude.com/docs/en/agent-sdk/python.
Structs§
- Agent
Definition - Configuration for a programmatically defined subagent.
- Assistant
Message - An assistant response message with content blocks.
- Claude
Agent Options - Main configuration for Claude Code queries and sessions.
- Hook
Context - Context information passed to hook callbacks.
- Hook
Matcher - Configuration for matching hooks to specific events or tools.
- McpClaude
AiProxy Server Config - Claude.ai proxy MCP server config shape used in MCP status responses.
- McpHttp
Server Config - Configuration for an MCP server using HTTP transport.
- McpSSE
Server Config - Configuration for an MCP server using Server-Sent Events (SSE) transport.
- McpSdk
Server Config - Configuration for an in-process SDK MCP server.
- McpSdk
Server Status Config - SDK MCP server config shape used in MCP status responses.
- McpServer
Info - Server metadata returned for connected MCP servers.
- McpServer
Status - Status entry for a single MCP server.
- McpStatus
Response - Typed MCP status response payload returned by
get_mcp_status. - McpStdio
Server Config - Configuration for an MCP server using stdio transport.
- McpTool
Annotations - Tool annotations returned in MCP status payloads.
- McpTool
Info - Tool metadata returned in MCP status payloads.
- Permission
Result Allow - Result indicating the tool call should be allowed.
- Permission
Result Deny - Result indicating the tool call should be denied.
- Permission
Rule Value - A rule to add, replace, or remove in a permission update.
- Permission
Update - Configuration for updating permissions programmatically.
- Result
Message - Final result message with cost and usage information.
- SDKSession
Info - Session metadata returned by
list_sessions. - Sandbox
Ignore Violations - Configuration for ignoring specific sandbox violations.
- Sandbox
Network Config - Network-specific configuration for sandbox mode.
- Sandbox
Settings - Sandbox configuration for controlling command execution isolation.
- SdkPlugin
Config - Configuration for loading plugins in the SDK.
- Session
Message - User/assistant message returned by
get_session_messages. - Stream
Event - Stream event for partial message updates during streaming.
- System
Message - A system message with metadata.
- System
Prompt Preset - Preset configuration for the system prompt.
- Task
Notification Message - Typed view for
systemmessages with subtypetask_notification. - Task
Progress Message - Typed view for
systemmessages with subtypetask_progress. - Task
Started Message - Typed view for
systemmessages with subtypetask_started. - Task
Usage - Token/tool usage reported in task-related system messages.
- Text
Block - A text content block in an assistant message.
- Thinking
Block - A thinking content block (for models with extended thinking capability).
- Tool
Annotations - MCP tool annotations providing hints about tool behavior.
- Tool
Permission Context - Context information passed to tool permission callbacks.
- Tool
Result Block - A tool execution result block.
- Tool
UseBlock - A tool use request block.
- Tools
Preset - Preset tools configuration for using Claude Code’s default tool set.
- User
Message - A user input message.
Enums§
- Content
Block - Union type for all content block types in messages.
- McpServer
Config - Union type for MCP server configurations.
- McpServer
Connection Status - MCP server connection status.
- McpServer
Status Config - MCP server config shape returned by
get_mcp_status. - McpServers
Option - MCP server configuration option for
ClaudeAgentOptions. - Message
- Union type of all possible messages from the Claude Code CLI.
- Permission
Behavior - Behavior for rule-based permission operations.
- Permission
Mode - Permission mode controlling how Claude Code handles tool execution permissions.
- Permission
Result - Union type for permission callback results.
- Permission
Update Destination - Destination for applying a permission update.
- Permission
Update Type - The type of a permission update operation.
- Setting
Source - Controls which filesystem-based configuration sources the SDK loads settings from.
- System
Prompt - System prompt configuration.
- Task
Notification Status - Status values for task notification messages.
- Thinking
Config - Controls extended thinking behavior.
- Tools
Option - Tools configuration.
- User
Content - User message content — either plain text or structured content blocks.
Type Aliases§
- CanUse
Tool Callback - Callback type for custom tool permission logic.
- Hook
Callback - Callback type for hook functions.
- Hook
Input - Input data passed to hook callbacks.
- HookJSON
Output - Return value from hook callbacks.
- Stderr
Callback - Callback type for receiving stderr output lines from the CLI process.