Skip to main content

Module types

Module types 

Source
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§

AgentDefinition
Configuration for a programmatically defined subagent.
AssistantMessage
An assistant response message with content blocks.
ClaudeAgentOptions
Main configuration for Claude Code queries and sessions.
HookContext
Context information passed to hook callbacks.
HookMatcher
Configuration for matching hooks to specific events or tools.
McpClaudeAiProxyServerConfig
Claude.ai proxy MCP server config shape used in MCP status responses.
McpHttpServerConfig
Configuration for an MCP server using HTTP transport.
McpSSEServerConfig
Configuration for an MCP server using Server-Sent Events (SSE) transport.
McpSdkServerConfig
Configuration for an in-process SDK MCP server.
McpSdkServerStatusConfig
SDK MCP server config shape used in MCP status responses.
McpServerInfo
Server metadata returned for connected MCP servers.
McpServerStatus
Status entry for a single MCP server.
McpStatusResponse
Typed MCP status response payload returned by get_mcp_status.
McpStdioServerConfig
Configuration for an MCP server using stdio transport.
McpToolAnnotations
Tool annotations returned in MCP status payloads.
McpToolInfo
Tool metadata returned in MCP status payloads.
PermissionResultAllow
Result indicating the tool call should be allowed.
PermissionResultDeny
Result indicating the tool call should be denied.
PermissionRuleValue
A rule to add, replace, or remove in a permission update.
PermissionUpdate
Configuration for updating permissions programmatically.
ResultMessage
Final result message with cost and usage information.
SDKSessionInfo
Session metadata returned by list_sessions.
SandboxIgnoreViolations
Configuration for ignoring specific sandbox violations.
SandboxNetworkConfig
Network-specific configuration for sandbox mode.
SandboxSettings
Sandbox configuration for controlling command execution isolation.
SdkPluginConfig
Configuration for loading plugins in the SDK.
SessionMessage
User/assistant message returned by get_session_messages.
StreamEvent
Stream event for partial message updates during streaming.
SystemMessage
A system message with metadata.
SystemPromptPreset
Preset configuration for the system prompt.
TaskNotificationMessage
Typed view for system messages with subtype task_notification.
TaskProgressMessage
Typed view for system messages with subtype task_progress.
TaskStartedMessage
Typed view for system messages with subtype task_started.
TaskUsage
Token/tool usage reported in task-related system messages.
TextBlock
A text content block in an assistant message.
ThinkingBlock
A thinking content block (for models with extended thinking capability).
ToolAnnotations
MCP tool annotations providing hints about tool behavior.
ToolPermissionContext
Context information passed to tool permission callbacks.
ToolResultBlock
A tool execution result block.
ToolUseBlock
A tool use request block.
ToolsPreset
Preset tools configuration for using Claude Code’s default tool set.
UserMessage
A user input message.

Enums§

ContentBlock
Union type for all content block types in messages.
McpServerConfig
Union type for MCP server configurations.
McpServerConnectionStatus
MCP server connection status.
McpServerStatusConfig
MCP server config shape returned by get_mcp_status.
McpServersOption
MCP server configuration option for ClaudeAgentOptions.
Message
Union type of all possible messages from the Claude Code CLI.
PermissionBehavior
Behavior for rule-based permission operations.
PermissionMode
Permission mode controlling how Claude Code handles tool execution permissions.
PermissionResult
Union type for permission callback results.
PermissionUpdateDestination
Destination for applying a permission update.
PermissionUpdateType
The type of a permission update operation.
SettingSource
Controls which filesystem-based configuration sources the SDK loads settings from.
SystemPrompt
System prompt configuration.
TaskNotificationStatus
Status values for task notification messages.
ThinkingConfig
Controls extended thinking behavior.
ToolsOption
Tools configuration.
UserContent
User message content — either plain text or structured content blocks.

Type Aliases§

CanUseToolCallback
Callback type for custom tool permission logic.
HookCallback
Callback type for hook functions.
HookInput
Input data passed to hook callbacks.
HookJSONOutput
Return value from hook callbacks.
StderrCallback
Callback type for receiving stderr output lines from the CLI process.