models
Class info¶
Re-exported classes¶
| Class | Module | Description |
|---|---|---|
| APIRetrySystemMessage | clawd_code_sdk.models.system_messages | System message emitted when an API call fails and is retried. |
| AgentAsyncLaunchedOutput | clawd_code_sdk.models.output_types | Output from the Task tool when an agent was launched asynchronously. |
| AgentCacheCreation | clawd_code_sdk.models.output_types | Cache creation token statistics. |
| AgentCompletedOutput | clawd_code_sdk.models.output_types | Output from the Task tool when the agent completed successfully. |
| AgentDefinition | clawd_code_sdk.models.agents | User-facing agent definition configuration. |
| AgentHookHandler | clawd_code_sdk.models.hooks | Agent hook handler with multi-turn tool access. |
| AgentInfo | clawd_code_sdk.models.agents | Information about an available subagent that can be invoked via the Agent tool. |
| AgentInput | clawd_code_sdk.models.input_types | Input for the Task tool. Launches a new agent to handle complex, multi-step tasks. |
| AgentOutputTextContent | clawd_code_sdk.models.output_types | A text content block in agent output. |
| AgentOutputUsage | clawd_code_sdk.models.output_types | Token usage statistics from an agent task. |
| AgentServerToolUse | clawd_code_sdk.models.usage | Server-side tool usage statistics. |
| AgentWireDefinition | clawd_code_sdk.models.agents | Wire-format agent definition matching the CLI control protocol. |
| ApiErrorParams | clawd_code_sdk.models.messages | Parameters of an API error, present only for the error kinds that have any (undocumented). |
| AppliedSettings | clawd_code_sdk.models.control | The currently applied model and effort settings. |
| AskUserQuestion | clawd_code_sdk.models.input_types | A single question to ask the user. |
| AskUserQuestionInput | clawd_code_sdk.models.input_types | Input for the AskUserQuestion tool. |
| AskUserQuestionItem | clawd_code_sdk.models.output_types | A single question that was asked. |
| AskUserQuestionOption | clawd_code_sdk.models.input_types | A single option for a user question. |
| AskUserQuestionOutput | clawd_code_sdk.models.output_types | tool_use_result for the AskUserQuestion tool. |
| AssistantMessage | clawd_code_sdk.models.messages | Assistant message with content blocks. |
| AssistantMessageContent | clawd_code_sdk.models.content_blocks | Assistant message payload mirroring anthropic.types.beta.BetaMessage. |
| AsyncHookJSONOutput | clawd_code_sdk.models.hooks | Async hook output that defers hook execution. |
| AuthStatusMessage | clawd_code_sdk.models.messages | Authentication status update. |
| BackgroundTasksChangedMessage | clawd_code_sdk.models.system_messages | Full snapshot of running background tasks, emitted whenever the set changes. |
| Base64PDFSource | clawd_code_sdk.models.content_blocks | Base64-encoded PDF document. |
| BaseHookInput | clawd_code_sdk.models.hooks | Base hook input fields present across many hook events. |
| BaseResultMessage | clawd_code_sdk.models.messages | Base result message with cost and usage information. |
| BaseSessionConfig | clawd_code_sdk.models.options | Common fields for all session configurations. |
| BaseSystemMessage | clawd_code_sdk.models.system_messages | Base class for all system messages. |
| BashInput | clawd_code_sdk.models.input_types | Input for the Bash tool. Executes bash commands in a persistent shell session. |
| BashOutput | clawd_code_sdk.models.output_types | tool_use_result for the Bash tool. |
| BashOutputInput | clawd_code_sdk.models.input_types | Input for the BashOutput tool. Retrieves output from a background bash shell. |
| BashOutputOutput | clawd_code_sdk.models.output_types | tool_use_result for the BashOutput tool (background shell output retrieval). |
| ClaudeAgentOptions | clawd_code_sdk.models.options | Query options for Claude SDK. |
| ClaudeCodeAgentInfo | clawd_code_sdk.models.server_info | Information about an available subagent from Claude Code server. |
| ClaudeCodeCommandInfo | clawd_code_sdk.models.server_info | Information about an available slash command from Claude Code. |
| ClaudeCodeModelInfo | clawd_code_sdk.models.server_info | Information about an available AI model from Claude Code. |
| ClaudeCodeServerInfo | clawd_code_sdk.models.server_info | Complete server initialization info from Claude Code. |
| ClaudeCodeSettings | clawd_code_sdk.models.settings | Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings. |
| ClaudeOAuthWaitForCompletionResponse | clawd_code_sdk.models.control | Response from waiting for a Claude OAuth flow to complete. |
| CommandHookHandler | clawd_code_sdk.models.hooks | |
| CommandLifecycleMessage | clawd_code_sdk.models.messages | Progress of a user message that was sent with a uuid (capability msg_lifecycle_v1). |
| CommandsChangedMessage | clawd_code_sdk.models.system_messages | Emitted when the set of available slash commands changes. |
| CompactBoundarySystemMessage | clawd_code_sdk.models.system_messages | System message emitted at compaction boundaries. |
| ConfigOutput | clawd_code_sdk.models.output_types | Output from the Config tool. |
| ContentDocumentSource | clawd_code_sdk.models.content_blocks | Document made of content blocks (text / images). |
| ContextUsageAgent | clawd_code_sdk.models.context_usage | An agent contributing to context usage. |
| ContextUsageAttachmentBreakdown | clawd_code_sdk.models.context_usage | Token breakdown for a specific attachment type. |
| ContextUsageCategory | clawd_code_sdk.models.context_usage | A single category in the context usage breakdown. |
| ContextUsageDeferredBuiltinTool | clawd_code_sdk.models.context_usage | A deferred builtin tool contributing to context usage. |
| ContextUsageGridCell | clawd_code_sdk.models.context_usage | A single cell in the context usage grid visualization. |
| ContextUsageMcpInstructions | clawd_code_sdk.models.context_usage | MCP server instructions contributing to context usage. |
| ContextUsageMcpTool | clawd_code_sdk.models.context_usage | An MCP tool contributing to context usage. |
| ContextUsageMemoryFile | clawd_code_sdk.models.context_usage | A memory file contributing to context usage. |
| ContextUsageMessageBreakdown | clawd_code_sdk.models.context_usage | Breakdown of message tokens by category. |
| ContextUsageSkillFrontmatter | clawd_code_sdk.models.context_usage | A single skill's frontmatter contributing to context usage. |
| ContextUsageSkills | clawd_code_sdk.models.context_usage | Skills context usage summary. |
| ContextUsageSlashCommands | clawd_code_sdk.models.context_usage | Slash commands context usage summary. |
| ContextUsageSystemPromptSection | clawd_code_sdk.models.context_usage | A system prompt section contributing to context usage. |
| ContextUsageSystemTool | clawd_code_sdk.models.context_usage | A system tool contributing to context usage. |
| ContextUsageToolCallBreakdown | clawd_code_sdk.models.context_usage | Token breakdown for a specific tool call type. |
| ContinueLatest | clawd_code_sdk.models.options | Continue the most recent conversation. |
| ControlErrorResponse | clawd_code_sdk.models.control | Control Error response. |
| ControlRequestProgressMessage | clawd_code_sdk.models.system_messages | Progress for a long-running control request (e.g. side question). |
| ControlResponse | clawd_code_sdk.models.control | Control response. |
| ConversationResetMessage | clawd_code_sdk.models.messages | Emitted when the CLI starts a new conversation within the same session. |
| CwdChangedHookInput | clawd_code_sdk.models.hooks | Input data for CwdChanged hook events. |
| CwdChangedHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for CwdChanged events. |
| DirectoryAddedHookInput | clawd_code_sdk.models.hooks | Input data for DirectoryAdded hook events. |
| DocumentBlock | clawd_code_sdk.models.content_blocks | Document content block (e.g. an attached PDF) in a user message. |
| EditOutput | clawd_code_sdk.models.output_types | tool_use_result for the Edit tool. |
| ElicitationCompleteMessage | clawd_code_sdk.models.system_messages | System message emitted when an MCP elicitation completes. |
| ElicitationHookInput | clawd_code_sdk.models.hooks | Input data for Elicitation hook events. |
| ElicitationHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for Elicitation events. |
| ElicitationResultHookInput | clawd_code_sdk.models.hooks | Input data for ElicitationResult hook events. |
| ElicitationResultHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for ElicitationResult events. |
| EnterPlanModeInput | clawd_code_sdk.models.input_types | Input for the EnterPlanMode tool. Enters planning mode. |
| EnterPlanModeOutput | clawd_code_sdk.models.output_types | tool_use_result for the EnterPlanMode tool. |
| EnterWorktreeOutput | clawd_code_sdk.models.output_types | tool_use_result for the EnterWorktree tool. |
| ExitPlanModeInput | clawd_code_sdk.models.input_types | Input for the ExitPlanMode tool. Exits planning mode for user approval. |
| ExitPlanModeOutput | clawd_code_sdk.models.output_types | tool_use_result for the ExitPlanMode tool. |
| ExitWorktreeInput | clawd_code_sdk.models.input_types | Input for the ExitWorktree tool. |
| ExitWorktreeOutput | clawd_code_sdk.models.output_types | tool_use_result for the ExitWorktree tool. |
| FileChangedHookInput | clawd_code_sdk.models.hooks | Input data for FileChanged hook events. |
| FileChangedHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for FileChanged events. |
| FileDocumentSource | clawd_code_sdk.models.content_blocks | Document uploaded through the Files API. |
| FileEditInput | clawd_code_sdk.models.input_types | Input for the Edit tool. Performs exact string replacements in files. |
| FileReadInput | clawd_code_sdk.models.input_types | Input for the Read tool. Reads files including text, images, PDFs, and notebooks. |
| FileWriteInput | clawd_code_sdk.models.input_types | Input for the Write tool. Writes a file to the local filesystem. |
| FilesPersistedSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when files have been persisted. |
| Filesystem | clawd_code_sdk.models.settings | Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation. |
| FromPR | clawd_code_sdk.models.options | Resume sessions linked to a specific GitHub PR. |
| GetSettingsResponse | clawd_code_sdk.models.control | Response from get_settings() containing effective and per-source settings. |
| GitDiff | clawd_code_sdk.models.output_types | Git diff information for a file change. |
| GlobInput | clawd_code_sdk.models.input_types | Input for the Glob tool. Fast file pattern matching. |
| GlobOutput | clawd_code_sdk.models.output_types | tool_use_result for the Glob tool. |
| GrepInput | clawd_code_sdk.models.input_types | |
| GrepOutput | clawd_code_sdk.models.output_types | tool_use_result for the Grep tool (all modes). |
| HookContext | clawd_code_sdk.models.hooks | Context information for hook callbacks. |
| HookMatcher | clawd_code_sdk.models.hooks | Hook matcher configuration. |
| HookMatcherConfig | clawd_code_sdk.models.hooks | Declarative hook matcher for agent/skill/settings hook configuration. |
| HookProgressSystemMessage | clawd_code_sdk.models.system_messages | Progress update from a running hook. |
| HookResponseSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when a hook completes. |
| HookStartedSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when a hook starts. |
| Hooks | clawd_code_sdk.models.settings | Lifecycle event hooks that run at configurable points during Claude Code operation (tool use, session start/end, notifications, prompt submit, message display, and more), not just before/after tool executions. See https://code.claude.com/docs/en/hooks. |
| ImageBlock | clawd_code_sdk.models.content_blocks | Image content block (storage-only, not emitted on the wire). |
| ImageSource | clawd_code_sdk.models.content_blocks | Base64-encoded image source data. |
| InformationalSystemMessage | clawd_code_sdk.models.system_messages | Informational text from the CLI (notices, suggestions, warnings). |
| InitSystemMessage | clawd_code_sdk.models.system_messages | System init message with session metadata. |
| InstructionsLoadedHookInput | clawd_code_sdk.models.hooks | Input data for InstructionsLoaded hook events. |
| JSONRPCError | clawd_code_sdk.models.mcp | A JSON-RPC error object. |
| JSONRPCErrorResponse | clawd_code_sdk.models.mcp | A response to a request that indicates an error occurred. |
| JSONRPCNotification | clawd_code_sdk.models.mcp | A JSON-RPC notification which does not expect a response. |
| JSONRPCRequest | clawd_code_sdk.models.mcp | A JSON-RPC request that expects a response. |
| JSONRPCResultResponse | clawd_code_sdk.models.mcp | A successful (non-error) response to a request. |
| KillShellInput | clawd_code_sdk.models.input_types | Input for the KillBash tool. Kills a running background bash shell. |
| KillShellOutput | clawd_code_sdk.models.output_types | tool_use_result for the KillBash tool. |
| ListMcpResourcesInput | clawd_code_sdk.models.input_types | Input for the ListMcpResources tool. Lists available MCP resources. |
| LocalCommandOutputMessage | clawd_code_sdk.models.system_messages | Output from a local slash command (e.g. /voice, /cost). |
| McpAuthenticateResponse | clawd_code_sdk.models.control | Response from authenticating with an MCP server. |
| McpClaudeAIProxyServerConfig | clawd_code_sdk.models.mcp | MCP Claude AI proxy server configuration. |
| McpHttpServerConfig | clawd_code_sdk.models.mcp | MCP HTTP server configuration. |
| McpResourceContents | clawd_code_sdk.models.control | A single resource content entry. |
| McpResourceEntry | clawd_code_sdk.models.output_types | A single MCP resource entry. |
| McpSSEServerConfig | clawd_code_sdk.models.mcp | MCP SSE server configuration. |
| McpSdkServerConfig | clawd_code_sdk.models.mcp | SDK MCP server configuration (serializable, no instance). |
| McpSdkServerConfigWithInstance | clawd_code_sdk.models.mcp | SDK MCP server config with a live McpServer instance. Not serializable. |
| McpServerProvenance | clawd_code_sdk.models.hooks | Which MCP server (and config source) a tool call belongs to. |
| McpServerStatus | clawd_code_sdk.models.system_messages | MCP server status. |
| McpServerStatusEntry | clawd_code_sdk.models.mcp | Status information for a single MCP server. |
| McpServerVersionInfo | clawd_code_sdk.models.mcp | Server version information returned in MCP status. |
| McpSetServersResult | clawd_code_sdk.models.mcp | Result of a setMcpServers operation. |
| McpStatusResponse | clawd_code_sdk.models.mcp | Response from get_mcp_status() containing all MCP server statuses. |
| McpStdioServerConfig | clawd_code_sdk.models.mcp | MCP stdio server configuration. |
| McpToolStatus | clawd_code_sdk.models.mcp | Status information for a single MCP tool. |
| MemoryRecallSystemMessage | clawd_code_sdk.models.system_messages | Emitted when the memory recall supervisor surfaces relevant memories into the turn. |
| MessageDisplayHookInput | clawd_code_sdk.models.hooks | Input data for MessageDisplay hook events (assistant text being displayed). |
| MessageDisplayHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for MessageDisplay events. |
| MessageParam | clawd_code_sdk.models.content_blocks | User message payload wrapping content blocks. |
| MirrorErrorSystemMessage | clawd_code_sdk.models.system_messages | Emitted when SessionStore.append() rejects or times out for a transcript-mirror batch. |
| ModelRefusalFallbackMessage | clawd_code_sdk.models.system_messages | Emitted when a model refusal triggered a switch to a fallback model. |
| ModelRefusalNoFallbackMessage | clawd_code_sdk.models.system_messages | Emitted when the model refused and no fallback model is available. |
| ModelScopedUsageWindow | clawd_code_sdk.models.context_usage | Per-model weekly window. |
| ModelUsage | clawd_code_sdk.models.usage | Cumulative token usage per model, accumulated across the entire session. |
| Network | clawd_code_sdk.models.settings | Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration. |
| NewSession | clawd_code_sdk.models.options | Start a fresh session. |
| NotebookEditInput | clawd_code_sdk.models.input_types | Input for the NotebookEdit tool. Edits cells in Jupyter notebook files. |
| NotebookEditOutput | clawd_code_sdk.models.output_types | tool_use_result for the NotebookEdit tool. |
| NotificationHookInput | clawd_code_sdk.models.hooks | Input data for Notification hook events. |
| NotificationHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for Notification events. |
| NotificationSystemMessage | clawd_code_sdk.models.system_messages | Loop-side text notification. |
| PermissionDeniedHookInput | clawd_code_sdk.models.hooks | Input data for PermissionDenied hook events. |
| PermissionDeniedHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PermissionDenied events. |
| PermissionDeniedSystemMessage | clawd_code_sdk.models.system_messages | Emitted when a tool call was denied by the permission system. |
| PermissionRequestHookInput | clawd_code_sdk.models.hooks | Input data for PermissionRequest hook events. |
| PermissionRequestHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PermissionRequest events. |
| PermissionResultAllow | clawd_code_sdk.models.permissions | Allow permission result. |
| PermissionResultDeny | clawd_code_sdk.models.permissions | Deny permission result. |
| PermissionRuleValue | clawd_code_sdk.models.permissions | Permission rule value. |
| Permissions | clawd_code_sdk.models.settings | Tool usage permissions configuration. |
| PlainTextSource | clawd_code_sdk.models.content_blocks | Plain text document. |
| PluginInstallSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when a plugin is installed. |
| PostCompactHookInput | clawd_code_sdk.models.hooks | Input data for PostCompact hook events. |
| PostModelSwitchHookInput | clawd_code_sdk.models.hooks | Input data for PostModelSwitch hook events (after the session model changed). |
| PostModelSwitchHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PostModelSwitch events. |
| PostToolUseFailureHookInput | clawd_code_sdk.models.hooks | Input data for PostToolUseFailure hook events. |
| PostToolUseFailureHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PostToolUseFailure events. |
| PostToolUseHookInput | clawd_code_sdk.models.hooks | Input data for PostToolUse hook events. |
| PostToolUseHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PostToolUse events. |
| PreCompactHookInput | clawd_code_sdk.models.hooks | Input data for PreCompact hook events. |
| PreModelSwitchHookInput | clawd_code_sdk.models.hooks | Input data for PreModelSwitch hook events (before the session model changes). |
| PreModelSwitchHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PreModelSwitch events. |
| PreSkillShellCommandHookInput | clawd_code_sdk.models.hooks | Input data for PreSkillShellCommand hook events. |
| PreSkillShellCommandHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PreSkillShellCommand events (refuse or rewrite the command). |
| PreSkillShellCommandToolInput | clawd_code_sdk.models.hooks | Tool input of a PreSkillShellCommand hook. |
| PreToolUseHookInput | clawd_code_sdk.models.hooks | Input data for PreToolUse hook events. |
| PreToolUseHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for PreToolUse events. |
| PromptHookHandler | clawd_code_sdk.models.hooks | LLM prompt hook handler. |
| PromptRequest | clawd_code_sdk.models.prompt_requests | Prompt request sent to the SDK consumer. |
| PromptRequestOption | clawd_code_sdk.models.prompt_requests | An option in a prompt request. |
| PromptResponse | clawd_code_sdk.models.prompt_requests | Response to a prompt request. |
| PromptSuggestionMessage | clawd_code_sdk.models.messages | Predicted next user prompt, emitted after each turn when promptSuggestions is enabled. |
| RateLimitInfo | clawd_code_sdk.models.messages | Rate limit information. |
| RateLimitMessage | clawd_code_sdk.models.messages | Rate limit event message. |
| ReadFileInfo | clawd_code_sdk.models.output_types | Nested file info inside a Read tool result (text mode). |
| ReadImageDimensions | clawd_code_sdk.models.output_types | Image dimension info for coordinate mapping. |
| ReadImageFileInfo | clawd_code_sdk.models.output_types | Nested file info for image reads. |
| ReadImageOutput | clawd_code_sdk.models.output_types | tool_use_result for the Read tool (image files). |
| ReadMcpResourceContentItem | clawd_code_sdk.models.output_types | A single content item from an MCP resource. |
| ReadMcpResourceInput | clawd_code_sdk.models.input_types | Input for the ReadMcpResource tool. Reads a specific MCP resource from a server. |
| ReadMcpResourceOutput | clawd_code_sdk.models.output_types | tool_use_result for the ReadMcpResource tool. |
| ReadNotebookFileInfo | clawd_code_sdk.models.output_types | Nested file info for notebook reads. |
| ReadNotebookOutput | clawd_code_sdk.models.output_types | tool_use_result for the Read tool (Jupyter notebooks). |
| ReadPartsFileInfo | clawd_code_sdk.models.output_types | Nested file info for PDF parts (extracted page images). |
| ReadPartsOutput | clawd_code_sdk.models.output_types | tool_use_result for the Read tool (PDF parts extraction). |
| ReadPdfFileInfo | clawd_code_sdk.models.output_types | Nested file info for PDF reads. |
| ReadPdfOutput | clawd_code_sdk.models.output_types | tool_use_result for the Read tool (PDF files). |
| ReadTextOutput | clawd_code_sdk.models.output_types | tool_use_result for the Read tool (text files). |
| ReloadPluginsCacheImpact | clawd_code_sdk.models.control | How a reload would change the session's tool list. |
| RemoteControlResponse | clawd_code_sdk.models.control | Response from enabling remote control. |
| ResultErrorMessage | clawd_code_sdk.models.messages | Error result message. |
| ResultSuccessMessage | clawd_code_sdk.models.messages | Successful result message. |
| ResumeSession | clawd_code_sdk.models.options | Resume an existing session by ID. |
| SDKContextUsage | clawd_code_sdk.models.context_usage | Compact context usage snapshot, attached to assistant messages. |
| SDKControlApplyFlagSettingsRequest | clawd_code_sdk.models.control | SDK control apply flag settings request. |
| SDKControlBackgroundTasksRequest | clawd_code_sdk.models.control | Moves running foreground tasks (or one tool use) to the background. |
| SDKControlCancelAsyncMessageRequest | clawd_code_sdk.models.control | Drops a pending async user message from the command queue by uuid. |
| SDKControlChannelEnableRequest | clawd_code_sdk.models.control | Enables MCP channel notifications for a marketplace plugin server. |
| SDKControlClaudeOAuthWaitForCompletionRequest | clawd_code_sdk.models.control | Waits for an in-progress Claude OAuth flow to complete. |
| SDKControlElicitationRequest | clawd_code_sdk.models.control | Requests the SDK consumer to handle an MCP elicitation (user input request). |
| SDKControlEndSessionRequest | clawd_code_sdk.models.control | Ends the current session. |
| SDKControlFileSuggestionsRequest | clawd_code_sdk.models.control | Requests at-mention file autocomplete suggestions for a partial path prefix. |
| SDKControlGenerateSessionTitleRequest | clawd_code_sdk.models.control | Generates a title for a session from a description of it. |
| SDKControlGetBinaryVersionRequest | clawd_code_sdk.models.control | Requests the version of the running Claude Code binary. |
| SDKControlGetContextUsageRequest | clawd_code_sdk.models.control | Requests a breakdown of current context window usage by category. |
| SDKControlGetContextUsageResponse | clawd_code_sdk.models.context_usage | Breakdown of current context window usage by category. |
| SDKControlGetHooksListingRequest | clawd_code_sdk.models.control | Requests the listing of configured hooks (same data as /hooks). |
| SDKControlGetSettingsRequest | clawd_code_sdk.models.control | Returns the effective merged settings and the raw per-source settings. |
| SDKControlGetTaskOutputRequest | clawd_code_sdk.models.control | Reads the output collected so far for a background task. |
| SDKControlGetTaskOutputResponse | clawd_code_sdk.models.control | Output of a background task. |
| SDKControlGetUsageRequest | clawd_code_sdk.models.control | Requests the structured usage report (session cost + rate limits). Experimental. |
| SDKControlGetUsageResponse | clawd_code_sdk.models.control | Structured /usage data: session totals and plan rate-limit windows. Experimental. |
| SDKControlInitializeRequest | clawd_code_sdk.models.control | SDK control initialize request. |
| SDKControlInterruptRequest | clawd_code_sdk.models.control | SDK control interrupt request. |
| SDKControlInterruptResponse | clawd_code_sdk.models.control | Response to an interrupt request. |
| SDKControlListModelsRequest | clawd_code_sdk.models.control | Requests the list of available models. |
| SDKControlListPermissionRulesRequest | clawd_code_sdk.models.control | Lists the effective permission rules. |
| SDKControlMcpAuthenticateRequest | clawd_code_sdk.models.control | Authenticates with an MCP server. |
| SDKControlMcpCallRequest | clawd_code_sdk.models.control | Invokes an MCP tool via the subprocess MCP client without a model turn. |
| SDKControlMcpClearAuthRequest | clawd_code_sdk.models.control | Clears authentication for an MCP server. |
| SDKControlMcpMessageRequest | clawd_code_sdk.models.control | SDK control MCP message request. |
| SDKControlMcpOAuthCallbackUrlRequest | clawd_code_sdk.models.control | Provides an OAuth redirect callback URL to complete an MCP server OAuth flow. |
| SDKControlMcpReadResourceRequest | clawd_code_sdk.models.control | Reads a resource from a connected MCP server. |
| SDKControlMcpReadResourceResponse | clawd_code_sdk.models.control | Contents of an MCP resource. |
| SDKControlMcpReconnectRequest | clawd_code_sdk.models.control | Reconnects a disconnected or failed MCP server. |
| SDKControlMcpSetServersRequest | clawd_code_sdk.models.control | Replaces the set of dynamically managed MCP servers. |
| SDKControlMcpStatusRequest | clawd_code_sdk.models.control | Requests the current status of all MCP server connections. |
| SDKControlMcpToggleRequest | clawd_code_sdk.models.control | Enables or disables an MCP server. |
| SDKControlPermissionRequest | clawd_code_sdk.models.control | SDK control permission request. |
| SDKControlReadFileRequest | clawd_code_sdk.models.control | Read a file from the session filesystem for the remote sidebar viewer. |
| SDKControlReadFileResponse | clawd_code_sdk.models.control | File contents for the remote sidebar viewer. |
| SDKControlRegisterRepoRootRequest | clawd_code_sdk.models.control | Registers an additional repository root (like /add-dir). |
| SDKControlReloadOutputStylesRequest | clawd_code_sdk.models.control | Re-scans output styles from disk. |
| SDKControlReloadOutputStylesResponse | clawd_code_sdk.models.control | Output styles after reload. |
| SDKControlReloadSkillsRequest | clawd_code_sdk.models.control | Re-scans skills from disk. |
| SDKControlReloadSkillsResponse | clawd_code_sdk.models.control | Skills after reload. |
| SDKControlRemoteControlRequest | clawd_code_sdk.models.control | Toggles the remote control REPL bridge for external session access. |
| SDKControlRequest | clawd_code_sdk.models.control | SDK control request. |
| SDKControlResponse | clawd_code_sdk.models.control | SDK Control response. |
| SDKControlRewindFilesRequest | clawd_code_sdk.models.control | SDK control rewind files request. |
| SDKControlSeedReadStateRequest | clawd_code_sdk.models.control | Seeds the readFileState cache with a path+mtime entry. |
| SDKControlSetHasSubscribersRequest | clawd_code_sdk.models.control | Tells the CLI whether anyone is watching the session output. |
| SDKControlSetMaxThinkingTokensRequest | clawd_code_sdk.models.control | Sets the maximum number of thinking tokens for extended thinking. |
| SDKControlSetModelRequest | clawd_code_sdk.models.control | Sets the model to use for subsequent conversation turns. |
| SDKControlSetPermissionModeRequest | clawd_code_sdk.models.control | SDK control set permission mode request. |
| SDKControlSetPermissionModeResponse | clawd_code_sdk.models.control | Response to a set_permission_mode request. |
| SDKControlSetProactiveRequest | clawd_code_sdk.models.control | Sets proactive mode configuration. |
| SDKControlSideQuestionRequest | clawd_code_sdk.models.control | Sends a side question to the model using the current conversation context. |
| SDKControlStopTaskRequest | clawd_code_sdk.models.control | SDK control stop task request. |
| SDKControlUpdateSettingsRequest | clawd_code_sdk.models.control | Writes settings to the local or user settings file. |
| SDKDeferredToolUse | clawd_code_sdk.models.output_types | A deferred tool use from a completed agent result. |
| SDKHookCallbackRequest | clawd_code_sdk.models.control | SDK hook callback request. |
| SDKPermissionDenial | clawd_code_sdk.models.messages | Permission denial from Claude API response. |
| SDKSessionInfo | clawd_code_sdk.models.session | Session metadata returned by list_sessions. |
| SDKUsageReport | clawd_code_sdk.models.context_usage | Session usage report (same data as /usage). |
| Sandbox | clawd_code_sdk.models.settings | Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing. |
| SdkPluginConfig | clawd_code_sdk.models.mcp | SDK plugin configuration. |
| SessionEndHookInput | clawd_code_sdk.models.hooks | Input data for SessionEnd hook events. |
| SessionKey | clawd_code_sdk.models.system_messages | Identifies a session transcript or subagent transcript in the store. |
| SessionMessage | clawd_code_sdk.models.session | A message from a session transcript. |
| SessionStartHookInput | clawd_code_sdk.models.hooks | Input data for SessionStart hook events. |
| SessionStartHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for SessionStart events. |
| SessionStateChangedMessage | clawd_code_sdk.models.system_messages | System message emitted when session state changes. |
| SessionWritesLostMessage | clawd_code_sdk.models.system_messages | Emitted when writes were lost due to a full disk or exceeded quota. |
| SettingsSource | clawd_code_sdk.models.control | A single settings source with its raw settings. |
| SetupHookInput | clawd_code_sdk.models.hooks | Input data for Setup hook events. |
| SideQuestionResponse | clawd_code_sdk.models.control | Response from a side question. |
| SkillInput | clawd_code_sdk.models.input_types | Input for the Skill tool. Invokes a named skill (slash command). |
| SkillOutput | clawd_code_sdk.models.output_types | tool_use_result for the Skill tool. |
| StatusSystemMessage | clawd_code_sdk.models.system_messages | System status message. |
| StopHookInput | clawd_code_sdk.models.hooks | Input data for Stop hook events. |
| StopHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for Stop events. |
| StreamEvent | clawd_code_sdk.models.messages | Stream event for partial message updates during streaming. |
| StructuredPatchHunk | clawd_code_sdk.models.output_types | A single hunk in a structured patch. |
| SubagentStartHookInput | clawd_code_sdk.models.hooks | Input data for SubagentStart hook events. |
| SubagentStartHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for SubagentStart events. |
| SubagentStopHookInput | clawd_code_sdk.models.hooks | Input data for SubagentStop hook events. |
| SubagentStopHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for SubagentStop events. |
| SyncHookJSONOutput | clawd_code_sdk.models.hooks | Synchronous hook output with control and decision fields. |
| TaskCompletedHookInput | clawd_code_sdk.models.hooks | Input data for TaskCompleted hook events. |
| TaskCreatedHookInput | clawd_code_sdk.models.hooks | Input data for TaskCreated hook events. |
| TaskInfo | clawd_code_sdk.models.output_types | Information about a background task. |
| TaskNotificationSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when a subagent task completes, fails, or stops. |
| TaskOutputResult | clawd_code_sdk.models.output_types | tool_use_result for the TaskOutput tool (background task polling). |
| TaskProgressSystemMessage | clawd_code_sdk.models.system_messages | System message emitted periodically with task progress updates. |
| TaskProgressUsage | clawd_code_sdk.models.system_messages | Usage info for a task progress update. |
| TaskStartedSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when a subagent task starts. |
| TaskStopOutput | clawd_code_sdk.models.output_types | tool_use_result for the TaskStop tool. |
| TaskUpdatedSystemMessage | clawd_code_sdk.models.system_messages | System message emitted when a subagent task was updated. |
| TeammateIdleHookInput | clawd_code_sdk.models.hooks | Input data for TeammateIdle hook events. |
| TextBlock | clawd_code_sdk.models.content_blocks | Text content block. |
| ThinkingBlock | clawd_code_sdk.models.content_blocks | Thinking/reasoning content block. |
| ThinkingConfigAdaptive | clawd_code_sdk.models.thinking | Adaptive thinking configuration - model decides thinking budget. |
| ThinkingConfigDisabled | clawd_code_sdk.models.thinking | Disabled thinking configuration. |
| ThinkingConfigEnabled | clawd_code_sdk.models.thinking | Enabled thinking configuration with explicit token budget. |
| ThinkingTokensMessage | clawd_code_sdk.models.system_messages | Running estimate of thinking tokens for the current turn. |
| TodoItem | clawd_code_sdk.models.input_types | A single todo item. |
| TodoWriteInput | clawd_code_sdk.models.input_types | Input for the TodoWrite tool. Creates and manages a structured task list. |
| TodoWriteOutput | clawd_code_sdk.models.output_types | tool_use_result for the TodoWrite tool. |
| ToolConfig | clawd_code_sdk.models.options | Per-tool configuration for built-in tools. |
| ToolPermissionContext | clawd_code_sdk.models.permissions | Context information for tool permission callbacks. |
| ToolProgressMessage | clawd_code_sdk.models.messages | Progress update for a running tool. |
| ToolResultBlock | clawd_code_sdk.models.content_blocks | Tool result content block. |
| ToolUseBlock | clawd_code_sdk.models.content_blocks | Tool use content block. |
| ToolUseMeta | clawd_code_sdk.models.messages | Display metadata for a tool_use block in an assistant message (undocumented). |
| ToolUseSummaryMessage | clawd_code_sdk.models.messages | Summary of preceding tool uses. |
| ToolsPreset | clawd_code_sdk.models.agents | Tools preset configuration. |
| TriggerMetadata | clawd_code_sdk.models.system_messages | Trigger metadata. |
| URLPDFSource | clawd_code_sdk.models.content_blocks | PDF document referenced by URL. |
| Usage | clawd_code_sdk.models.usage | Token usage counters. |
| UsageMoney | clawd_code_sdk.models.context_usage | An amount in minor units (amount_minor / 10**exponent in currency). |
| UsageRateLimits | clawd_code_sdk.models.context_usage | Plan rate-limit windows from the claude.ai usage endpoint. |
| UsageSpend | clawd_code_sdk.models.context_usage | Usage-credit spend beyond the plan windows (undocumented, server-defined). |
| UsageWindow | clawd_code_sdk.models.context_usage | Utilization of one plan rate-limit window. |
| UserDocumentPrompt | clawd_code_sdk.models.prompts | A user prompt containing a base64-encoded PDF document. |
| UserDocumentURLPrompt | clawd_code_sdk.models.prompts | A user prompt containing a PDF document referenced by URL. |
| UserFilePrompt | clawd_code_sdk.models.prompts | A user prompt referencing a file uploaded via the Anthropic Files API. |
| UserImagePrompt | clawd_code_sdk.models.prompts | A user prompt containing a single base64-encoded image. |
| UserImageURLPrompt | clawd_code_sdk.models.prompts | A user prompt containing an image referenced by URL. |
| UserMessage | clawd_code_sdk.models.messages | User message. |
| UserPlainTextDocumentPrompt | clawd_code_sdk.models.prompts | A user prompt containing a plain text document. |
| UserPromptExpansionHookInput | clawd_code_sdk.models.hooks | Input data for UserPromptExpansion hook events. |
| UserPromptExpansionHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for UserPromptExpansion events. |
| UserPromptSubmitHookInput | clawd_code_sdk.models.hooks | Input data for UserPromptSubmit hook events. |
| UserPromptSubmitHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for UserPromptSubmit events. |
| UserTextPrompt | clawd_code_sdk.models.prompts | A text-only user prompt. |
| WebFetchInput | clawd_code_sdk.models.input_types | Input for the WebFetch tool. Fetches content from a URL and processes it with AI. |
| WebFetchOutput | clawd_code_sdk.models.output_types | tool_use_result for the WebFetch tool. |
| WebSearchHit | clawd_code_sdk.models.output_types | A single search result hit. |
| WebSearchInput | clawd_code_sdk.models.input_types | Input for the WebSearch tool. Searches the web and returns formatted results. |
| WebSearchOutput | clawd_code_sdk.models.output_types | tool_use_result for the WebSearch tool. |
| WebSearchToolResult | clawd_code_sdk.models.output_types | A structured search result entry. |
| WorkerShuttingDownMessage | clawd_code_sdk.models.system_messages | Emitted when the CLI worker is shutting down. |
| WorktreeCreateHookInput | clawd_code_sdk.models.hooks | Input data for WorktreeCreate hook events. |
| WorktreeCreateHookSpecificOutput | clawd_code_sdk.models.hooks | Hook-specific output for WorktreeCreate events. |
| WorktreeRemoveHookInput | clawd_code_sdk.models.hooks | Input data for WorktreeRemove hook events. |
| WriteOutput | clawd_code_sdk.models.output_types | tool_use_result for the Write tool. |
🛈 DocStrings¶
Type definitions for Claude SDK.
AgentHooksConfig
module-attribute
¶
AgentHooksConfig = dict[HookEvent, list[HookMatcherConfig]]
Type alias for the hooks field on AgentDefinition.
Maps hook event names to lists of matcher configs. Example::
hooks: AgentHooksConfig = {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{"type": "command", "command": "./check.sh"}],
}
],
}
AssistantContentBlock
module-attribute
¶
AssistantContentBlock = Annotated[
TextBlock | ThinkingBlock | ToolUseBlock | ServerContentBlock, Discriminator("type")
]
Content blocks that appear in assistant messages (any Messages API block type).
CommandHookHandler
module-attribute
¶
CommandHookHandler = TypedDict(
"CommandHookHandler",
{
"type": Literal["command"],
"command": str,
"timeout": NotRequired[float],
"async": NotRequired[bool],
"statusMessage": NotRequired[str],
"once": NotRequired[bool],
},
)
Bash command hook handler.
See https://code.claude.com/docs/en/hooks#command-hook-fields
CommandLifecycleState
module-attribute
¶
CommandLifecycleState = Literal[
"queued", "started", "completed", "cancelled", "discarded", "refused"
]
Where a uuid-stamped user message is in the CLI's command queue.
ContentBlock
module-attribute
¶
ContentBlock = Annotated[
TextBlock
| ThinkingBlock
| ToolUseBlock
| ToolResultBlock
| ImageBlock
| DocumentBlock
| ServerContentBlock,
Discriminator("type"),
]
All content block types (used for storage/JSONL which doesn't distinguish by role).
GrepInput
module-attribute
¶
GrepInput = TypedDict(
"GrepInput",
{
"pattern": str,
"path": NotRequired[str],
"glob": NotRequired[str],
"type": NotRequired[str],
"output_mode": NotRequired[Literal["content", "files_with_matches", "count"]],
"-i": NotRequired[bool],
"-n": NotRequired[bool],
"-o": NotRequired[bool],
"-B": NotRequired[int],
"-A": NotRequired[int],
"-C": NotRequired[int],
"head_limit": NotRequired[int],
"multiline": NotRequired[bool],
},
)
Input for the Grep tool. Powerful search built on ripgrep with regex support.
HookHandler
module-attribute
¶
HookHandler = CommandHookHandler | PromptHookHandler | AgentHookHandler
Union of all declarative hook handler types.
ListMcpResourcesOutput
module-attribute
¶
ListMcpResourcesOutput = list[McpResourceEntry]
tool_use_result for the ListMcpResources tool.
McpOutput
module-attribute
¶
Output from a generic MCP tool call (plain string).
Message
module-attribute
¶
Message = Annotated[
Annotated[UserMessage, Tag("user")]
| Annotated[AssistantMessage, Tag("assistant")]
| Annotated[ResultSuccessMessage, Tag("result_success")]
| Annotated[ResultErrorMessage, Tag("result_error")]
| Annotated[StreamEvent, Tag("stream_event")]
| Annotated[RateLimitMessage, Tag("rate_limit_event")]
| Annotated[ToolProgressMessage, Tag("tool_progress")]
| Annotated[ToolUseSummaryMessage, Tag("tool_use_summary")]
| Annotated[AuthStatusMessage, Tag("auth_status")]
| Annotated[PromptSuggestionMessage, Tag("prompt_suggestion")]
| Annotated[ConversationResetMessage, Tag("conversation_reset")]
| Annotated[CommandLifecycleMessage, Tag("command_lifecycle")]
| Annotated[SystemMessageUnion, Tag("system")],
Discriminator(_message_discriminator),
]
Discriminated union of all wire-format message types.
OnElicitation
module-attribute
¶
OnElicitation = Callable[[SDKControlElicitationRequest], Awaitable[ElicitResult]]
Callback for handling MCP elicitation requests.
Called when an MCP server requests user input and no hook handles it. If not provided, elicitation requests will be declined automatically.
OnUserQuestion
module-attribute
¶
OnUserQuestion = Callable[
[AskUserQuestionInput, ToolPermissionContext], Awaitable[PermissionResult]
]
Callback for handling AskUserQuestion elicitation requests.
Called when Claude asks the user a clarifying question. The callback should return a PermissionResultAllow with updated_input containing the answers, or a PermissionResultDeny to cancel.
SERVER_CONTENT_BLOCK_TYPES
module-attribute
¶
SERVER_CONTENT_BLOCK_TYPES: tuple[type[BaseModel], ...] = get_args(ServerContentBlock.__value__)
Runtime tuple of :data:ServerContentBlock members (for isinstance checks).
SessionConfig
module-attribute
¶
SessionConfig = NewSession | ResumeSession | ContinueLatest | FromPR
Union of all session configuration types.
Can also be specified as a plain str, which is a shortcut for
ResumeSession(session_id=str).
UserContentBlock
module-attribute
¶
UserContentBlock = Annotated[
TextBlock | ToolResultBlock | ImageBlock | DocumentBlock, Discriminator("type")
]
Content blocks that appear in user messages.
UserPrompt
module-attribute
¶
UserPrompt = (
UserTextPrompt
| UserImagePrompt
| UserImageURLPrompt
| UserDocumentPrompt
| UserDocumentURLPrompt
| UserPlainTextDocumentPrompt
| UserFilePrompt
)
Union type for all user prompt dataclasses.
ServerContentBlock
¶
ServerContentBlock = (
BetaRedactedThinkingBlock
| BetaServerToolUseBlock
| BetaWebSearchToolResultBlock
| BetaWebFetchToolResultBlock
| BetaAdvisorToolResultBlock
| BetaCodeExecutionToolResultBlock
| BetaBashCodeExecutionToolResultBlock
| BetaTextEditorCodeExecutionToolResultBlock
| BetaToolSearchToolResultBlock
| BetaMCPToolUseBlock
| BetaMCPToolResultBlock
| BetaContainerUploadBlock
| BetaCompactionBlock
| BetaFallbackBlock
| BetaMCPToolListingBlock
)
Assistant content blocks produced by the API itself (server tools, MCP connector, ...).
These use the Anthropic SDK's models directly; clawd has no extra behaviour for them.
APIRetrySystemMessage
¶
Bases: BaseSystemMessage
System message emitted when an API call fails and is retried.
Source code in src/clawd_code_sdk/models/system_messages.py
no_response
class-attribute
instance-attribute
¶
no_response: NoResponseInfo | None = None
Set when the retry was triggered by the API not responding at all.
AgentAsyncLaunchedOutput
¶
Bases: TypedDict
Output from the Task tool when an agent was launched asynchronously.
Source code in src/clawd_code_sdk/models/output_types.py
canReadOutputFile
instance-attribute
¶
Whether the calling agent has Read/Bash tools to check progress.
isAsync
instance-attribute
¶
Always True for async-launched agents.
modelsUsed
instance-attribute
¶
Ordered distinct models used before backgrounding.
outputFile
instance-attribute
¶
Path to the output file for checking agent progress.
resolvedModel
instance-attribute
¶
Model in use at the backgrounding transition.
status
instance-attribute
¶
Indicates the agent was launched in the background.
AgentCacheCreation
¶
Bases: TypedDict
Cache creation token statistics.
Source code in src/clawd_code_sdk/models/output_types.py
AgentCompletedOutput
¶
Bases: TypedDict
Output from the Task tool when the agent completed successfully.
Source code in src/clawd_code_sdk/models/output_types.py
content
instance-attribute
¶
content: list[AgentOutputTextContent]
Text content blocks produced by the agent.
modelsUsed
instance-attribute
¶
Ordered distinct models used (length > 1 means a mid-run swap).
worktreeBranch
instance-attribute
¶
Branch of the agent's worktree.
worktreePath
instance-attribute
¶
Worktree the agent ran in (isolation="worktree").
AgentDefinition
¶
Bases: ClaudeCodeBaseModel
User-facing agent definition configuration.
Accepts ergonomic Python inputs (e.g. dict-style mcp_servers)
and converts to the wire format via to_wire().
Source code in src/clawd_code_sdk/models/agents.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
auto_compact_window
class-attribute
instance-attribute
¶
Token count at which this agent compacts its own conversation as a subagent.
Only lowers the inherited window. No effect on the main session agent.
background
class-attribute
instance-attribute
¶
Whether this agent runs in the background.
critical_system_reminder_experimental
class-attribute
instance-attribute
¶
critical_system_reminder_experimental: str | None = Field(
default=None, title="Critical System Reminder", alias="criticalSystemReminder_EXPERIMENTAL"
)
Critical system reminder message to display to the user.
description
class-attribute
instance-attribute
¶
A brief description of the agent's purpose.
disallowed_tools
class-attribute
instance-attribute
¶
disallowed_tools: list[ToolName | str] | None = Field(
default=None, title="Disallowed Tools", examples=["Bash"]
)
Tools this agent is not allowed to use.
effort
class-attribute
instance-attribute
¶
effort: ReasoningEffort | int | None = Field(
default=None, title="Reasoning effort", examples=["high"]
)
Effort level for thinking depth.
hooks
class-attribute
instance-attribute
¶
hooks: AgentHooksConfig | None = Field(default=None, title='Agent Hooks')
Hook configurations for this agent.
initial_prompt
class-attribute
instance-attribute
¶
Auto-submitted as the first user turn when this agent is the main thread agent.
Slash commands are processed. Prepended to any user-provided prompt.
isolation
class-attribute
instance-attribute
¶
isolation: Literal["worktree"] | None = Field(
default=None, title="Isolation Mode", examples=["worktree"]
)
Isolation mode. "worktree" runs the agent in a separate git worktree.
max_turns
class-attribute
instance-attribute
¶
Maximum number of agentic turns (API round-trips) before stopping.
mcp_servers
class-attribute
instance-attribute
¶
MCP servers for this agent.
Maps server names to configs. Use None as the value to reference
a server already configured in settings::
memory
class-attribute
instance-attribute
¶
memory: SettingSource | None = Field(
default=None, title="Agent Memory", examples=["user", "project"]
)
Persistent cross-session memory scope for this agent.
model
class-attribute
instance-attribute
¶
model: ModelName | Literal["inherit"] | str | None = Field(
default=None, title="Agent Model", examples=["sonnet"]
)
The model to use for this agent.
observer
class-attribute
instance-attribute
¶
Agent type(s) (comma-separated, max 4) auto-spawned as background observers.
observer_message
class-attribute
instance-attribute
¶
Supplemental postamble appended to each activity digest sent to the observer.
omit_claude_md
class-attribute
instance-attribute
¶
Run without user/project/local CLAUDE.md files when running as a subagent.
permission_mode
class-attribute
instance-attribute
¶
permission_mode: PermissionMode | None = Field(
default=None, title="Permission Mode", examples=["bypassPermissions"]
)
Permission mode for this agent.
prompt
class-attribute
instance-attribute
¶
The prompt to use for this agent.
skills
class-attribute
instance-attribute
¶
Skills this agent has.
tools
class-attribute
instance-attribute
¶
The tools this agent has access to.
to_wire
¶
Serialize to the wire-format dict for the CLI control protocol.
Converts dict-style mcp_servers to the array format the CLI expects:
{"git": config} -> [{"git": config}]
Returns a camelCase dict with None values excluded.
Source code in src/clawd_code_sdk/models/agents.py
to_wire_model
¶
to_wire_model() -> AgentWireDefinition
Serialize to the wire-format dict for the CLI control protocol.
Converts dict-style mcp_servers to the array format the CLI expects:
{"git": config} -> [{"git": config}]
Returns a camelCase dict with None values excluded.
Source code in src/clawd_code_sdk/models/agents.py
AgentHookHandler
¶
Bases: TypedDict
Agent hook handler with multi-turn tool access.
See https://code.claude.com/docs/en/hooks#agent-based-hooks
Source code in src/clawd_code_sdk/models/hooks.py
AgentInfo
¶
Bases: ClaudeCodeBaseModel
Information about an available subagent that can be invoked via the Agent tool.
Source code in src/clawd_code_sdk/models/agents.py
model
class-attribute
instance-attribute
¶
Model alias this agent uses. If omitted, inherits the parent's model.
AgentInput
¶
Bases: TypedDict
Input for the Task tool. Launches a new agent to handle complex, multi-step tasks.
Source code in src/clawd_code_sdk/models/input_types.py
isolation
instance-attribute
¶
Isolation mode.
"worktree" creates a temporary git worktree; "remote" launches the agent in a remote cloud environment (always runs in background).
mode
instance-attribute
¶
Deprecated; ignored. Subagents inherit the parent session's permission mode.
model
instance-attribute
¶
Optional model override for this agent.
Takes precedence over the agent definition's model frontmatter. If omitted, uses the agent definition's model, or inherits from the parent.
run_in_background
instance-attribute
¶
Whether to run the agent in the background.
subagent_type
instance-attribute
¶
The type of specialized agent to use for this task.
team_name
instance-attribute
¶
Team name for spawning. Uses current team context if omitted.
AgentOutputTextContent
¶
Bases: TypedDict
A text content block in agent output.
Source code in src/clawd_code_sdk/models/output_types.py
AgentOutputUsage
¶
Bases: TypedDict
Token usage statistics from an agent task.
Source code in src/clawd_code_sdk/models/output_types.py
cache_creation
instance-attribute
¶
cache_creation: AgentCacheCreation | None
Cache creation statistics.
cache_creation_input_tokens
instance-attribute
¶
Tokens used to create cache entries.
cache_read_input_tokens
instance-attribute
¶
Tokens read from cache.
output_tokens_details
instance-attribute
¶
output_tokens_details: NotRequired[AgentOutputTokensDetails | None]
Breakdown of output tokens.
server_tool_use
instance-attribute
¶
server_tool_use: AgentServerToolUse | None
Server-side tool usage statistics.
service_tier
instance-attribute
¶
Service tier used for the request.
AgentServerToolUse
¶
Bases: TypedDict
Server-side tool usage statistics.
Source code in src/clawd_code_sdk/models/usage.py
AgentWireDefinition
¶
Bases: ClaudeCodeBaseModel
Wire-format agent definition matching the CLI control protocol.
This is the strict camelCase representation sent over the wire in the initialize request.
The CLI's public Zod schema (sdk.d.ts) only defines::
description, prompt, tools, disallowedTools, model, mcpServers,
criticalSystemReminder_EXPERIMENTAL, skills, maxTurns
However, the CLI's internal parse schema (Rff / parseAgentFromJson)
also accepts these additional fields, which are fully functional::
memory, background, hooks, effort, permissionMode, isolation
Source code in src/clawd_code_sdk/models/agents.py
ApiErrorParams
¶
Bases: ClaudeCodeBaseModel
Parameters of an API error, present only for the error kinds that have any (undocumented).
Source code in src/clawd_code_sdk/models/messages.py
AppliedSettings
¶
Bases: BaseModel
The currently applied model and effort settings.
Source code in src/clawd_code_sdk/models/control.py
AskUserQuestion
¶
Bases: TypedDict
A single question to ask the user.
Source code in src/clawd_code_sdk/models/input_types.py
options
instance-attribute
¶
options: list[AskUserQuestionOption]
The available choices (2-4 options). An "Other" option is automatically provided.
question
instance-attribute
¶
The complete question to ask. Should be clear, specific, and end with a question mark.
AskUserQuestionInput
¶
Bases: TypedDict
Input for the AskUserQuestion tool.
Source code in src/clawd_code_sdk/models/input_types.py
answers
instance-attribute
¶
User answers populated by the permission system.
Maps question text to selected option label(s). Multi-select answers are comma-separated.
questions
instance-attribute
¶
questions: list[AskUserQuestion]
Questions to ask the user (1-4 questions).
AskUserQuestionItem
¶
AskUserQuestionOption
¶
Bases: TypedDict
A single option for a user question.
Source code in src/clawd_code_sdk/models/input_types.py
AskUserQuestionOutput
¶
Bases: TypedDict
tool_use_result for the AskUserQuestion tool.
Source code in src/clawd_code_sdk/models/output_types.py
afkTimeoutMs
instance-attribute
¶
Set when the question timed out because the user was away (ms).
annotations
instance-attribute
¶
annotations: NotRequired[dict[str, AskUserQuestionAnnotation]]
Per-question annotations from the user, keyed by question text.
answers
instance-attribute
¶
Maps question text to answer string. Multi-select answers are comma-separated.
AssistantMessage
¶
Bases: BaseModel
Assistant message with content blocks.
Source code in src/clawd_code_sdk/models/messages.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
aborted
class-attribute
instance-attribute
¶
Set when the turn was aborted while this message was streaming.
api_error_origin
class-attribute
instance-attribute
¶
first_party when Anthropic's own API sent the error response.
api_error_params
class-attribute
instance-attribute
¶
api_error_params: ApiErrorParams | None = None
Parameters of the API error, for the error kinds that have any.
api_error_status
class-attribute
instance-attribute
¶
HTTP status code of the API error when is_api_error_message is true.
api_error_type
class-attribute
instance-attribute
¶
The error.type of the API error response body, e.g. rate_limit_error.
is_api_error_message
class-attribute
instance-attribute
¶
True when this assistant message wraps an API error (undocumented).
request_id
class-attribute
instance-attribute
¶
API request ID that produced this message.
supersedes
class-attribute
instance-attribute
¶
UUIDs of previously emitted assistant messages this one replaces.
thinking_display
class-attribute
instance-attribute
¶
Active thinking display mode (undocumented).
thinking_duration_ms
class-attribute
instance-attribute
¶
How long the model spent thinking for this message (undocumented).
tool_use_meta
class-attribute
instance-attribute
¶
tool_use_meta: list[ToolUseMeta] | None = None
Display metadata for the tool_use blocks in this message (undocumented).
user_message_uuid
class-attribute
instance-attribute
¶
UUID of the user message this assistant message responds to.
user_message_uuids
class-attribute
instance-attribute
¶
UUIDs of all user messages this assistant message responds to (batched turns).
wire_ingest_context
class-attribute
instance-attribute
¶
Per-tool_use ingest context (e.g. cwd), keyed by tool_use ID (undocumented).
wire_tool_inputs
class-attribute
instance-attribute
¶
Tool inputs as sent on the wire, keyed by tool_use ID (undocumented).
raise_if_api_error
¶
Raise the appropriate API exception if error is set.
Source code in src/clawd_code_sdk/models/messages.py
to_otel
¶
Convert SDK content block objects into semconv OutputMessages.
Source code in src/clawd_code_sdk/models/messages.py
AssistantMessageContent
¶
Bases: ClaudeCodeBaseModel
Assistant message payload mirroring anthropic.types.beta.BetaMessage.
Uses our own ContentBlock types instead of the Anthropic SDK's
BetaContentBlock variants. Extra fields from the wire format
(e.g. container, context_management) are preserved via extra="allow".
Source code in src/clawd_code_sdk/models/content_blocks.py
AsyncHookJSONOutput
¶
Bases: TypedDict
Async hook output that defers hook execution.
Fields
async_: Set to True to defer hook execution. Note: This is converted to "async" when sent to the CLI - use "async_" in your Python code. asyncTimeout: Optional timeout in milliseconds for the async operation.
Source code in src/clawd_code_sdk/models/hooks.py
AuthStatusMessage
¶
Bases: BaseMessage
Authentication status update.
Source code in src/clawd_code_sdk/models/messages.py
BackgroundTasksChangedMessage
¶
Bases: BaseSystemMessage
Full snapshot of running background tasks, emitted whenever the set changes.
Source code in src/clawd_code_sdk/models/system_messages.py
Base64PDFSource
¶
Bases: BaseContentBlock
Base64-encoded PDF document.
Source code in src/clawd_code_sdk/models/content_blocks.py
BaseHookInput
¶
Bases: TypedDict
Base hook input fields present across many hook events.
Source code in src/clawd_code_sdk/models/hooks.py
prompt_id
instance-attribute
¶
ID of the user prompt that started the current turn.
BaseResultMessage
¶
Bases: BaseMessage
Base result message with cost and usage information.
Note: Fields use inconsistent scoping. See per-field docs for details.
Source code in src/clawd_code_sdk/models/messages.py
begun_message_ids
class-attribute
instance-attribute
¶
API message IDs (msg_...) the turn began (undocumented, CLI 2.1.330+).
duration_api_ms
instance-attribute
¶
Cumulative API time across the entire session.
fast_mode_state
class-attribute
instance-attribute
¶
Whether fast mode was enabled.
model_usage
class-attribute
instance-attribute
¶
model_usage: dict[str, ModelUsage] = Field(default_factory=dict, validation_alias='modelUsage')
Cumulative token usage per model across the entire session.
model_usage_since_last_result
class-attribute
instance-attribute
¶
model_usage_since_last_result: dict[str, ModelUsage] | None = None
Per-model usage accrued since the previous result (undocumented).
permission_denials
class-attribute
instance-attribute
¶
permission_denials: list[SDKPermissionDenial] = []
Permission denials from the last API call only (per-turn).
process_turn_index
class-attribute
instance-attribute
¶
Index of this turn within the CLI process (undocumented).
queued_turn_count
class-attribute
instance-attribute
¶
Number of turns still queued after this result.
safety_stops
class-attribute
instance-attribute
¶
Number of safety stops during the turn (undocumented).
subagent_stats
class-attribute
instance-attribute
¶
subagent_stats: SubagentStats | None = None
Subagent statistics for the turn (undocumented).
terminal_reason
class-attribute
instance-attribute
¶
Why the query loop terminated.
Unset when the loop was bypassed (local slash command) or interrupted externally (budget/retry limits checked between yields).
total_cost_usd
instance-attribute
¶
Cumulative cost across the entire session.
turn_start_resume_kind
class-attribute
instance-attribute
¶
How the turn started relative to a resume, e.g. "none" (undocumented).
user_message_uuid
class-attribute
instance-attribute
¶
UUID of the user message that started this turn.
user_message_uuids
class-attribute
instance-attribute
¶
UUIDs of all user messages handled in this turn.
BaseSessionConfig
dataclass
¶
Common fields for all session configurations.
Source code in src/clawd_code_sdk/models/options.py
persist
class-attribute
instance-attribute
¶
Whether to persist the session to disk.
BaseSystemMessage
¶
Bases: BaseModel
Base class for all system messages.
Source code in src/clawd_code_sdk/models/system_messages.py
BashInput
¶
Bases: TypedDict
Input for the Bash tool. Executes bash commands in a persistent shell session.
Source code in src/clawd_code_sdk/models/input_types.py
BashOutput
¶
Bases: TypedDict
tool_use_result for the Bash tool.
Source code in src/clawd_code_sdk/models/output_types.py
backgroundCwdHint
instance-attribute
¶
Note that the session cwd was not changed by a backgrounded directory-change command.
backgroundEndsWithFinalResponse
instance-attribute
¶
True when this backgrounded command is terminated at its caller's final response.
backgroundTaskId
instance-attribute
¶
Task ID when run_in_background=true was used.
backgroundWakesOwner
instance-attribute
¶
True when the subagent owning this backgrounded command is woken by its end.
backgroundedByUser
instance-attribute
¶
True if the user manually backgrounded the command with Ctrl+B.
dangerouslyDisableSandbox
instance-attribute
¶
Whether sandbox mode was overridden.
ghRateLimitHint
instance-attribute
¶
Model-facing sys-reminder appended when a gh cmd reports a GitHub API rate-limit error.
gitOperation
instance-attribute
¶
gitOperation: NotRequired[BashGitOperation]
Structured classification of git/gh operations detected in this command.
noOutputExpected
instance-attribute
¶
Whether the command is expected to produce no output on success.
persistedOutputPath
instance-attribute
¶
Path to persisted full output (when output is too large for inline).
persistedOutputSize
instance-attribute
¶
Total size of the output in bytes (when output is too large for inline).
rawOutputPath
instance-attribute
¶
Path to raw output file for large MCP tool outputs.
returnCodeInterpretation
instance-attribute
¶
Semantic interpretation for non-error exit codes with special meaning.
staleReadFileStateHint
instance-attribute
¶
Model-facing note listing readFileState entries whose mtime bumped during this command.
structuredContent
instance-attribute
¶
Structured content blocks.
timedOutAfterMs
instance-attribute
¶
Set when the command hit its timeout and was auto-backgrounded; the timeout in ms.
BashOutputInput
¶
Bases: TypedDict
Input for the BashOutput tool. Retrieves output from a background bash shell.
Source code in src/clawd_code_sdk/models/input_types.py
BashOutputOutput
¶
Bases: TypedDict
tool_use_result for the BashOutput tool (background shell output retrieval).
Not part of the official SDK ToolOutputSchemas as of SDK v0.2.62. Shape derived from: https://github.com/kzahel/yepanywhere/blob/main/packages/shared/src/claude-sdk-schema/tool/ToolResultSchemas.ts
Source code in src/clawd_code_sdk/models/output_types.py
exitCode
instance-attribute
¶
Exit code of the command, or None if still running.
ClaudeAgentOptions
dataclass
¶
Query options for Claude SDK.
Source code in src/clawd_code_sdk/models/options.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
add_dirs
class-attribute
instance-attribute
¶
Add additional working directories.
agent
class-attribute
instance-attribute
¶
Agent name for the main thread. The agent must be defined in agents or settings.
agent_progress_summaries
class-attribute
instance-attribute
¶
Enable periodic AI-generated progress summaries for running subagents.
When True, the subagent's conversation is forked every ~30s to produce a short present-tense description (e.g. 'Analyzing authentication module'), emitted on task_progress events via the summary field. The fork reuses the subagent's model and prompt cache, so cost is typically minimal.
Applies to both foreground and background subagents. Defaults to False.
agents
class-attribute
instance-attribute
¶
agents: dict[str, AgentDefinition] | None = None
SubAgent definitions.
allow_dangerously_skip_permissions
class-attribute
instance-attribute
¶
Must be True when using permission_mode='bypassPermissions'.
allowed_tools
class-attribute
instance-attribute
¶
Tools which execute without prompting for permission.
capture_sdk_mcp_manifests
class-attribute
instance-attribute
¶
Do the in-process MCP servers' handshake before connecting and send its results.
The initialize request then carries each server's initialize and first
tools/list results (sdkMcpServerManifests), so the CLI connects them without
control round trips before the first turn. A server whose handshake fails, or that the
CLI does not take, is handshaken over the control channel as before. Off when the
CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS environment variable is set (as upstream).
chrome
class-attribute
instance-attribute
¶
Add the chrome-tools MCP server (-> Claude Code browser extension) to the agent.
cli_path
class-attribute
instance-attribute
¶
CLI path override (auto-detects by default).
context_1m
class-attribute
instance-attribute
¶
Enable 1M token context window (Sonnet 4/4.5 only).
cwd
class-attribute
instance-attribute
¶
The working directory for the agent.
debug_file
class-attribute
instance-attribute
¶
Write debug logs to a specific file path. Implicitly enables debug mode.
disable_parallel_tool_use
class-attribute
instance-attribute
¶
Disable parallel too use (only one tool_use block per response).
disallowed_tools
class-attribute
instance-attribute
¶
Tools that are removed from agent context and cant be used.
effort
class-attribute
instance-attribute
¶
Effort level for thinking depth.
enable_agent_teams
class-attribute
instance-attribute
¶
Enable the experimental agent teams feature.
enable_file_checkpointing
class-attribute
instance-attribute
¶
Enable file checkpointing to track file changes during the session.
When enabled, files can be rewound to their state at any user message
using ClaudeSDKClient.rewind_files().
enable_tool_search
class-attribute
instance-attribute
¶
Enable or disable MCP tool search.
When many MCP tools are configured, tool definitions can consume a significant portion of the context window. Tool search dynamically loads tools on-demand instead of preloading all of them.
True: Always enabled.False: Always disabled, all MCP tools loaded upfront."auto": Activates when MCP tools exceed 10% of context (default behavior).int: Auto-activates at this percentage threshold (e.g.5for 5%).None(default): Uses Claude Code's default (auto at 10%).
Requires models that support tool_reference blocks (Sonnet 4+, Opus 4+).
env
class-attribute
instance-attribute
¶
Environment variables for the CLI subprocess.
exclude_dynamic_sections
class-attribute
instance-attribute
¶
Whether to exclude dynamic sections from the system prompt.
extra_args
class-attribute
instance-attribute
¶
Arbitrary extra CLI flags.
fallback_model
class-attribute
instance-attribute
¶
Fallback model in case default one is overloaded.
fine_grained_tool_streaming
class-attribute
instance-attribute
¶
Stream tool input to the client as the model writes it (fine-grained tool streaming).
With it, stream_event messages carry tool input JSON as it is generated, so a UI can
show a long Write/Edit input live and the tool call starts sooner. It saves no
tokens. The partial tool input JSON is not validated by the API, and some endpoints
reject the request with HTTP 400 (proxies / gateways, some models on Bedrock and Vertex).
"auto"(default): on when the CLI talks to Anthropic's API directly (noCLAUDE_CODE_USE_BEDROCK/_VERTEX/ other provider env,ANTHROPIC_BASE_URLunset orapi.anthropic.com); otherwise the CLI's own default applies.True/False: force it on / off.
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING in env overrides this option.
forward_subagent_text
class-attribute
instance-attribute
¶
Forward subagent text and thinking blocks as messages with parent_tool_use_id set.
By default only tool_use/tool_result blocks from subagents are emitted.
hooks
class-attribute
instance-attribute
¶
hooks: dict[HookEvent, list[HookMatcher]] | None = None
Hook configurations.
include_builtin_system_prompt
class-attribute
instance-attribute
¶
Whether to include Claude Code's builtin system prompt.
When True (default) and system_prompt is set, it is appended to the builtin system prompt. When False, the system_prompt replaces it entirely.
include_hook_events
class-attribute
instance-attribute
¶
Include hook lifecycle events in the output stream.
When True, hook_started, hook_progress, and hook_response system
messages will be emitted for all hook event types. SessionStart and Setup
hook events are always emitted regardless of this setting.
instrument
class-attribute
instance-attribute
¶
Whether to instrument the session with tracing hooks.
max_budget_usd
class-attribute
instance-attribute
¶
Maximum amount of USD budget which may be consumed.
max_buffer_size
class-attribute
instance-attribute
¶
Max bytes when buffering CLI stdout.
max_turns
class-attribute
instance-attribute
¶
Maximum allowed amount of agentic turns.
mcp_servers
class-attribute
instance-attribute
¶
MCP servers for the agent.
mcp_servers_delivery
class-attribute
instance-attribute
¶
How the mcp_servers that Claude Code runs or connects to (stdio, SSE, HTTP) reach it.
"initialize"(default): in the initialize request over stdin (the CLI is started with--await-initialize), so serverenvandheadersstay off the command line, where other users of the machine can read them. Needs Claude Code 2.1.261 or newer; connecting fails if the CLI does not take them (mcp_servers_applied)."argv": in one--mcp-configflag, for older Claude Code. Deprecated upstream.
In-process servers (McpSdkServerConfigWithInstance) and an mcp_servers file path
are not affected, and a launch with --sdk-url in extra_args always uses
--mcp-config, as that session cannot read the request at launch.
on_elicitation
class-attribute
instance-attribute
¶
on_elicitation: OnElicitation | None = None
Callback for handling MCP elicitation requests.
Called when an MCP server requests user input (form fields, URL auth, etc.) and no hook handles the request first.
If not provided, elicitation requests that aren't handled by hooks will be declined automatically.
on_permission
class-attribute
instance-attribute
¶
Permission handler for tool execution.
Accepts either:
- A callback function (CanUseTool): The SDK routes permission requests
through the control protocol to this callback. Automatically adds
--permission-prompt-tool stdio to the CLI.
- A string: Name of an MCP tool to handle permission prompts
(passed as --permission-prompt-tool <name> to the CLI).
- None: Default behavior.
Interaction with permission_mode:
"default": All tool calls are routed to this handler."acceptEdits": All tool calls are routed to this handler. The handler is responsible for implementing the auto-approve-edits policy."plan": Only the syntheticExitPlanModetool is routed here. Actual modification tools are blocked by the CLI before reaching the handler."dontAsk": This handler is NEVER invoked. The CLI auto-denies all tools not pre-approved via the permissions config internally."bypassPermissions": This handler is NEVER invoked. The CLI auto-approves all tools internally.
Tools that allowed_tools allows outright ("Read", "Read()", "Read(*)")
never reach the handler either. Connecting emits a CanUseToolShadowedWarning when
a callback is set together with "bypassPermissions" or such entries.
on_user_question
class-attribute
instance-attribute
¶
on_user_question: OnUserQuestion | None = None
Callback for handling AskUserQuestion elicitation requests.
Called when Claude asks the user a clarifying question via the AskUserQuestion tool. If not set, these requests fall through to on_permission (if it's a callback) for backwards compatibility.
output_schema
class-attribute
instance-attribute
¶
JSON schema for structured output.
Accepts either a JSON schema dict or a Python type (Pydantic model, dataclass, TypedDict, etc.) which will be converted to a JSON schema automatically.
When set, Claude will return responses conforming to this schema.
Examples:
As a dict¶
output_schema={"type": "object", "properties": {"name": {"type": "string"}}}
As a type¶
output_schema=MyPydanticModel
per_task_stop_affordance
class-attribute
instance-attribute
¶
Declare that this consumer can stop individual background tasks (stop_task).
When declared, an interrupt only aborts the current turn and spares running background agents/workflows.
permission_mode
class-attribute
instance-attribute
¶
Permission mode.
permission_prompts
class-attribute
instance-attribute
¶
Who answers permission prompts.
"host" (default): this process, through on_permission.
"none": nobody - permission mode, rules and hooks still decide, and anything
that would otherwise prompt is denied immediately.
plan_mode_instructions
class-attribute
instance-attribute
¶
Custom workflow body for the plan-mode system reminder.
plugin_delivery
class-attribute
instance-attribute
¶
How plugins reach Claude Code.
"argv"(default): one--plugin-dirflag per plugin. Works with any Claude Code version, but the command line grows with the plugin count (Windows refuses one past 32,767 characters)."initialize": in the initialize request over stdin (the CLI is started with--await-initialize); connecting fails if the CLI does not load them (plugins_applied). A launch with--sdk-urlinextra_argsalways uses argv.
plugins
class-attribute
instance-attribute
¶
plugins: list[SdkPluginConfig] = field(default_factory=list)
"Plugin configurations to load.
project_config_root
class-attribute
instance-attribute
¶
The trusted checkout that cwd is a worktree of.
Project settings, .mcp.json, the .claude config trees and
CLAUDE_PROJECT_DIR come from here instead of cwd. Absolute path.
prompt_suggestions
class-attribute
instance-attribute
¶
Whether to create prompt suggestions.
replay_user_messages
class-attribute
instance-attribute
¶
Whether to replay user messages in the session.
sandbox
class-attribute
instance-attribute
¶
sandbox: Sandbox | None = None
Sandbox configuration for bash command isolation.
Filesystem and network restrictions are derived from permission rules (Read/Edit/WebFetch), not from these sandbox settings.
session
class-attribute
instance-attribute
¶
session: str | SessionConfig | None = None
Session configuration.
Controls how the CLI session is started:
- None or NewSession(): Start a fresh session.
- "session-id" or ResumeSession(session_id="..."): Resume by ID.
- ContinueLatest(): Continue the most recent conversation.
setting_sources
class-attribute
instance-attribute
¶
Sources to load filesystem settings from.
None loads the CLI's defaults (user, project, local); [] loads none.
settings
class-attribute
instance-attribute
¶
settings: str | Path | ClaudeCodeSettings | None = None
Settings configuration.
Accepts:
- A str or Path: interpreted as a path to a settings JSON file.
- A ClaudeCodeSettings instance: serialized to JSON automatically.
- None: no explicit settings.
skills
class-attribute
instance-attribute
¶
List of skills to use for the agent.
stderr
class-attribute
instance-attribute
¶
Callback for stderr output from CLI.
strict_mcp_config
class-attribute
instance-attribute
¶
Enforce strict validation of MCP server configurations.
system_prompt
class-attribute
instance-attribute
¶
System prompt for the agent.
system_prompt_snapshot
class-attribute
instance-attribute
¶
Snapshot the system prompt on the first request and reuse it verbatim.
Keeps the prompt byte-identical across requests and resumes (better cache hits).
task_budget
class-attribute
instance-attribute
¶
API-side task budget in tokens.
When set, the model is made aware of its remaining token budget so it can
pace tool use and wrap up before the limit. The CLI sends this as
output_config.task_budget with the task-budgets-2026-03-13 beta
header automatically.
thinking
class-attribute
instance-attribute
¶
Controls thinking behavior.
tool_aliases
class-attribute
instance-attribute
¶
Redirect built-in tool names to other tools, e.g. {"Bash": "mcp__ws__bash"}.
Single-hop; complementary to disallowed_tools, not a replacement.
tool_config
class-attribute
instance-attribute
¶
tool_config: ToolConfig | None = None
Per-tool configuration for built-in tools.
tools
class-attribute
instance-attribute
¶
tools: list[ToolName | str] | ToolsPreset | None = None
Tools available to the agent.
verbatim_prompts
class-attribute
instance-attribute
¶
Send every user message with client_composed: true.
The CLI then delivers the prompt text as written: no @path expansion and
no slash-command dispatch. Requires Claude Code 2.1.248+.
worktree
class-attribute
instance-attribute
¶
Create a new git worktree for the session (with optional name).
argv_mcp_servers
¶
The servers for --mcp-config.
All of them, or only the in-process ones when the others go in the initialize request.
Source code in src/clawd_code_sdk/models/options.py
build_settings_value
¶
Build the CLI --settings value, merging sandbox if provided.
Returns:
| Type | Description |
|---|---|
str | None
|
A JSON string, a file path, or None. |
Source code in src/clawd_code_sdk/models/options.py
initialize_mcp_servers
¶
The servers to send in the initialize request, or None to send none there.
Source code in src/clawd_code_sdk/models/options.py
initialize_plugins
¶
The plugins to send in the initialize request, or None to pass them as flags.
Source code in src/clawd_code_sdk/models/options.py
reads_initialize_at_launch
¶
Whether the CLI waits for the initialize request (--await-initialize).
sdk_mcp_server_configs
¶
Settings of the in-process MCP servers (timeout, tool policy), by server name.
Source code in src/clawd_code_sdk/models/options.py
ClaudeCodeAgentInfo
¶
Bases: ClaudeCodeBaseModel
Information about an available subagent from Claude Code server.
Source code in src/clawd_code_sdk/models/server_info.py
model
class-attribute
instance-attribute
¶
Model alias this agent uses. If omitted, inherits the parent's model.
ClaudeCodeCommandInfo
¶
Bases: ClaudeCodeBaseModel
Information about an available slash command from Claude Code.
Source code in src/clawd_code_sdk/models/server_info.py
aliases
class-attribute
instance-attribute
¶
Alternate names that resolve to the command (e.g., /cost / /stats both resolve to /usage).
argument_hint
instance-attribute
¶
Usage hint for command arguments (may be empty string).
builtin
class-attribute
instance-attribute
¶
Whether this is a built-in command (as opposed to a skill/plugin/custom command).
ClaudeCodeModelInfo
¶
Bases: ClaudeCodeBaseModel
Information about an available AI model from Claude Code.
Source code in src/clawd_code_sdk/models/server_info.py
description
instance-attribute
¶
Full description including capabilities and pricing.
disabled
class-attribute
instance-attribute
¶
Visible but not selectable (only set for entries in unavailable_models).
display_name
instance-attribute
¶
Human-readable display name (e.g., "Opus", "Default (recommended)").
resolved_model
class-attribute
instance-attribute
¶
Concrete model ID this entry resolves to (e.g. for aliases).
supported_effort_levels
class-attribute
instance-attribute
¶
Supported effort levels.
supports_adaptive_thinking
class-attribute
instance-attribute
¶
Whether the model supports adaptive thinking.
supports_auto_mode
class-attribute
instance-attribute
¶
Whether the model supports auto mode.
supports_effort
class-attribute
instance-attribute
¶
Whether the model supports effort setting.
supports_fast_mode
class-attribute
instance-attribute
¶
Whether the model supports fast mode.
supports_thinking_off
class-attribute
instance-attribute
¶
Whether thinking can be turned off for the model.
value
instance-attribute
¶
Model identifier used in API calls (e.g., "default", "opus", "haiku").
ClaudeCodeServerInfo
¶
Bases: ClaudeCodeBaseModel
Complete server initialization info from Claude Code.
This is returned by the Claude Code server during initialization and contains all available capabilities including models, commands, output styles, and account information.
Source code in src/clawd_code_sdk/models/server_info.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
account
class-attribute
instance-attribute
¶
account: ClaudeCodeAccountInfo | None = Field(default=None)
Account and authentication information.
agents
class-attribute
instance-attribute
¶
agents: list[ClaudeCodeAgentInfo] = Field(default_factory=list)
List of available subagents.
auth_conflict
class-attribute
instance-attribute
¶
auth_conflict: AuthConflict | None = None
Set when both an auth token and an API key are configured (source names only).
auto_default_nudge
class-attribute
instance-attribute
¶
IDE hosts only: the defaultMode the auto-default nudge offers to replace.
available_output_styles
class-attribute
instance-attribute
¶
List of all available output styles.
capabilities
class-attribute
instance-attribute
¶
Feature capability tags supported by the CLI (undocumented, informational).
claude_code_version
class-attribute
instance-attribute
¶
Version of the Claude Code process answering initialize.
claude_in_chrome_at_startup
class-attribute
instance-attribute
¶
Whether an IDE host should connect Claude in Chrome when the session starts.
claude_in_chrome_prompt_disabled
class-attribute
instance-attribute
¶
True when CLAUDE_CODE_DISABLE_CFC_PROMPT is set.
code_running_mcp_tools_applied
class-attribute
instance-attribute
¶
MCP tools declared via codeRunningMcpTools, keyed by server name.
commands
class-attribute
instance-attribute
¶
commands: list[ClaudeCodeCommandInfo] = Field(default_factory=list)
List of available slash commands.
current_model
class-attribute
instance-attribute
¶
The CLI's active model at connect time.
current_permission_mode
class-attribute
instance-attribute
¶
Permission mode the session is currently in (undocumented).
fast_mode_disabled_reason
class-attribute
instance-attribute
¶
Why fast mode is unavailable, if it is.
fast_mode_state
class-attribute
instance-attribute
¶
Fast mode state: off, in cooldown after rate limit, or actively enabled.
feedback_mode
class-attribute
instance-attribute
¶
feedback_mode: FeedbackMode | None = None
How the CLI collects feedback (undocumented).
feedback_survey_config
class-attribute
instance-attribute
¶
Present only when the host may show the feedback survey (undocumented structure).
footer_indicator
class-attribute
instance-attribute
¶
The terminal's configured footer pill (undocumented structure).
hook_on_failure_supported
class-attribute
instance-attribute
¶
Whether the CLI honors on_failure on hook matchers.
hooks_applied
class-attribute
instance-attribute
¶
False when the process was already running and did not register SDK hooks.
hooks_when_unanswered_kept
class-attribute
instance-attribute
¶
Number of registered hook matchers whose whenUnanswered the CLI kept.
host_worded_asks
class-attribute
instance-attribute
¶
Desktop host only: PreToolUse asks are sent to the host as can_use_tool requests.
inbound_read_receipts
class-attribute
instance-attribute
¶
Remote Control hosts only: client messages get processing/processed receipts.
managed_settings_applied
class-attribute
instance-attribute
¶
Whether the initialize's managedSettings match the ones stored at launch.
mcp_servers_applied
class-attribute
instance-attribute
¶
Whether the initialize's mcpServers match the set read at launch.
models
class-attribute
instance-attribute
¶
models: list[ClaudeCodeModelInfo] = Field(default_factory=list)
List of available AI models.
output_style
class-attribute
instance-attribute
¶
Current output style setting.
permission_mode_from_default_fallback
class-attribute
instance-attribute
¶
IDE hosts only: permission mode is auto because no settings source configured one.
plugins_applied
class-attribute
instance-attribute
¶
Whether every plugin sent via initialize is loaded.
session_state
class-attribute
instance-attribute
¶
Current session state, e.g. "idle" (undocumented).
survey_followup_box
class-attribute
instance-attribute
¶
Survey follow-up config for VS Code/desktop hosts (undocumented structure).
unavailable_models
class-attribute
instance-attribute
¶
unavailable_models: list[ClaudeCodeModelInfo] | None = None
Models the account can see but not select (e.g. excluded by org ZDR settings).
user_output_styles_dir
class-attribute
instance-attribute
¶
Directory for user-defined output styles (undocumented).
workspace_trust_recorded
class-attribute
instance-attribute
¶
Outcome of the workspaceTrust attestation.
ClaudeCodeSettings
¶
Bases: ClaudeCodeBaseModel
Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings.
Source code in src/clawd_code_sdk/models/settings.py
3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 | |
advisor_model
class-attribute
instance-attribute
¶
Model for the server-side advisor tool. Accepts a model alias ("opus", "sonnet", or "fable" on v2.1.170+) or a full model ID. Overridden by the --advisor CLI flag for the session, and blocked when the model is outside the availableModels allowlist. See https://code.claude.com/docs/en/advisor
agent
class-attribute
instance-attribute
¶
Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model. See https://code.claude.com/docs/en/sub-agents
agent_push_notif_enabled
class-attribute
instance-attribute
¶
When Remote Control is connected, allow Claude to send proactive push notifications to your phone, for example when a long task finishes. Requires Claude Code v2.1.119 or later. See https://code.claude.com/docs/en/remote-control#mobile-push-notifications
allow_all_claude_ai_mcps
class-attribute
instance-attribute
¶
(Managed settings only) Load claude.ai connectors alongside a deployed managed-mcp.json, which otherwise takes exclusive control and suppresses them. See https://code.claude.com/docs/en/managed-mcp
allow_managed_hooks_only
class-attribute
instance-attribute
¶
(Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See https://code.claude.com/docs/en/settings#hook-configuration
allow_managed_mcp_servers_only
class-attribute
instance-attribute
¶
(Managed settings only) When true, only allowedMcpServers from managed settings are respected; MCP servers defined in user, project, or local settings are ignored. deniedMcpServers still merges from all sources. See https://code.claude.com/docs/en/managed-mcp
allow_managed_permission_rules_only
class-attribute
instance-attribute
¶
allow_managed_permission_rules_only: bool | None = Field(
None, alias="allowManagedPermissionRulesOnly"
)
(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings
allowed_channel_plugins
class-attribute
instance-attribute
¶
allowed_channel_plugins: list[AllowedChannelPlugin] | None = Field(
None, alias="allowedChannelPlugins"
)
(Managed settings only) Allowlist of channel plugins that may run, each identified by its marketplace and plugin name. When set, only the listed plugins can push inbound channel messages while channelsEnabled is true. Replaces the default Anthropic allowlist when set; undefined falls back to the default and an empty array blocks all channel plugins. Requires channelsEnabled: true. See https://code.claude.com/docs/en/channels#restrict-which-channel-plugins-can-run
allowed_http_hook_urls
class-attribute
instance-attribute
¶
allowed_http_hook_urls: list[AllowedHttpHookUrl] | None = Field(
None,
alias="allowedHttpHookUrls",
examples=[["https://hooks.example.com/*", "http://localhost:*"]],
)
Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration
allowed_mcp_servers
class-attribute
instance-attribute
¶
allowed_mcp_servers: (
list[
AllowedMcpServerByServerName | AllowedMcpServerByServerCommand | AllowedMcpServerByServerUrl
]
| None
) = Field(None, alias="allowedMcpServers")
Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options
always_thinking_enabled
class-attribute
instance-attribute
¶
Enable extended thinking by default for all sessions. Typically configured via the /config command rather than editing directly. See https://code.claude.com/docs/en/common-workflows#use-extended-thinking-thinking-mode
api_key_helper
class-attribute
instance-attribute
¶
api_key_helper: str | None = Field(
None, alias="apiKeyHelper", examples=["/bin/generate_temp_api_key.sh"], min_length=1
)
Path to a script that outputs authentication values. See https://code.claude.com/docs/en/settings#available-settings
ask_user_question_timeout
class-attribute
instance-attribute
¶
ask_user_question_timeout: Literal["60s", "5m", "10m", "never"] | None = Field(
"never", alias="askUserQuestionTimeout"
)
Idle time before an unanswered AskUserQuestion dialog auto-continues with whatever options you had already selected. Accepts "60s", "5m", "10m", or "never" (default: "never", which waits until you answer). Appears in /config as Question auto-continue timeout, which writes this key to user settings. Not read from project or local settings. Requires Claude Code v2.1.200 or later. See https://code.claude.com/docs/en/settings#available-settings
attribution
class-attribute
instance-attribute
¶
attribution: Attribution | None = None
Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings
auto_compact_enabled
class-attribute
instance-attribute
¶
Automatically compact the conversation when context approaches the limit. Also configurable via the DISABLE_AUTO_COMPACT environment variable. See https://code.claude.com/docs/en/settings#available-settings
auto_connect_ide
class-attribute
instance-attribute
¶
Automatically connect to a running IDE when Claude Code starts from an external terminal (default: false). Appears in /config as Auto-connect to IDE (external terminal) when running outside a VS Code or JetBrains terminal. Also configurable via the CLAUDE_CODE_AUTO_CONNECT_IDE environment variable, which overrides this when set. See https://code.claude.com/docs/en/settings#global-config-settings
auto_install_ide_extension
class-attribute
instance-attribute
¶
Automatically install the Claude Code IDE extension when running from a VS Code terminal (default: true). Appears in /config as Auto-install IDE extension when running inside a VS Code or JetBrains terminal. You can also set the CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL environment variable to 1. See https://code.claude.com/docs/en/settings#global-config-settings
auto_memory_directory
class-attribute
instance-attribute
¶
Custom directory path for auto-memory storage. Supports ~/ prefix for home-directory expansion. Ignored if set in checked-in project settings (.claude/settings.json) for security. Defaults to ~/.claude/projects/<sanitized-cwd>/memory/ when unset. See https://code.claude.com/docs/en/memory
auto_memory_enabled
class-attribute
instance-attribute
¶
Enable automatic memory saves that capture useful context to ~/.claude/projects/<project>/memory/ (derived from the git repository, shared across worktrees). Also configurable via CLAUDE_CODE_DISABLE_AUTO_MEMORY environment variable (set to 1 to disable, 0 to enable). See https://code.claude.com/docs/en/memory#storage-location
auto_mode
class-attribute
instance-attribute
¶
auto_mode: AutoMode | None = Field(None, alias='autoMode')
Customization for the auto mode classifier prompt. Typically configured in managed settings to tune the allow/deny rules used when permissions.defaultMode is "auto". By default, allow, soft_deny, and environment REPLACE the corresponding built-in classifier section entirely. Include the literal string "$defaults" as an array entry (added in v2.1.118) to splice the built-in defaults in at that position alongside your custom rules. See https://code.claude.com/docs/en/permissions
auto_scroll_enabled
class-attribute
instance-attribute
¶
In fullscreen rendering, follow new output to the bottom of the conversation. Appears in /config as Auto-scroll. Permission prompts still scroll into view when this is off. See https://code.claude.com/docs/en/fullscreen
auto_updates_channel
class-attribute
instance-attribute
¶
auto_updates_channel: Literal["stable", "latest"] | None = Field(
"latest", alias="autoUpdatesChannel"
)
Release channel to follow for updates. Use "stable" for a version that is typically about one week old and skips versions with major regressions, or "latest" (default) for the most recent release. Set DISABLE_AUTOUPDATER=1 to disable background auto-updates, or DISABLE_UPDATES=1 (added in v2.1.118) to block all update paths including manual claude update.
available_models
class-attribute
instance-attribute
¶
available_models: list[str] | None = Field(
None, alias="availableModels", examples=[["sonnet", "haiku"]]
)
Restrict which models users can select. When defined at multiple settings levels (user, project, etc.), arrays are merged and deduplicated. See https://code.claude.com/docs/en/model-config#restrict-model-selection
away_summary_enabled
class-attribute
instance-attribute
¶
Show a one-line session recap when you return to the terminal after a few minutes away. Set to false (or turn off Session recap in /config) to disable. See https://code.claude.com/docs/en/settings#available-settings
aws_auth_refresh
class-attribute
instance-attribute
¶
aws_auth_refresh: str | None = Field(
None, alias="awsAuthRefresh", examples=["aws sso login --profile myprofile"], min_length=1
)
Command to run when AWS credentials are expired or unavailable; its output is shown to the user but interactive input is not supported. Also drives the "Claude Platform on AWS · refresh credentials" option in /login when configured. See https://code.claude.com/docs/en/amazon-bedrock#advanced-credential-configuration
aws_credential_export
class-attribute
instance-attribute
¶
aws_credential_export: str | None = Field(
None, alias="awsCredentialExport", examples=["/bin/generate_aws_grant.sh"], min_length=1
)
Command that outputs AWS credentials as JSON (in the form {"Credentials": {"AccessKeyId": ..., "SecretAccessKey": ..., "SessionToken": ...}}). The output is captured silently. Use when you cannot modify the .aws directory and must return credentials directly. See https://code.claude.com/docs/en/amazon-bedrock#advanced-credential-configuration
ax_screen_reader
class-attribute
instance-attribute
¶
Render screen-reader-friendly output: flat text without decorative borders or animations screen-reader mode always uses the classic renderer, so the tui setting has no effect while it is active. The CLAUDE_AX_SCREEN_READER environment variable and --ax-screen-reader flag take precedence. Requires Claude Code v2.1.181 or later. See https://code.claude.com/docs/en/settings#available-settings
blocked_marketplaces
class-attribute
instance-attribute
¶
blocked_marketplaces: (
list[
BlockedMarketplaceUrl
| BlockedMarketplaceGithub
| BlockedMarketplaceGit
| BlockedMarketplaceNpm
| BlockedMarketplaceFile
| BlockedMarketplaceDirectory
| BlockedMarketplaceHostPattern
| BlockedMarketplacePathPattern
| BlockedMarketplaceSkillsDir
]
| None
) = Field(None, alias="blockedMarketplaces")
(Managed settings only) Blocklist of marketplace sources. These exact sources are blocked from being added as marketplaces. The check happens before downloading, so blocked sources never touch the filesystem.
browser_external_page_tools
class-attribute
instance-attribute
¶
browser_external_page_tools: Literal["disabled"] | None = Field(
None, alias="browserExternalPageTools"
)
(Managed settings only) Set to "disabled" to prevent Claude from using tools to read or act on external pages in the desktop app's Browser pane. Users can still navigate to external sites themselves, and local dev server previews are unaffected. See https://code.claude.com/docs/en/desktop#browse-external-sites
channels_enabled
class-attribute
instance-attribute
¶
(Managed settings only) Allow channels for the organization. On claude.ai Team and Enterprise plans, channels are blocked when this is unset or false. For Anthropic Console accounts using API key authentication, channels are allowed by default unless the organization deploys managed settings, in which case this key must be set to true. See https://code.claude.com/docs/en/channels#enterprise-controls
claude_md
class-attribute
instance-attribute
¶
(Managed settings only) CLAUDE.md-style instructions injected as organization-managed memory. Honored only from managed/policy settings. See https://code.claude.com/docs/en/settings#available-settings
claude_md_excludes
class-attribute
instance-attribute
¶
claude_md_excludes: list[ClaudeMdExclude] | None = Field(
None,
alias="claudeMdExcludes",
examples=[["**/monorepo/CLAUDE.md", "/home/user/monorepo/other-team/.claude/rules/**"]],
)
Glob patterns for CLAUDE.md files to exclude from loading. Useful in monorepos to skip irrelevant instructions from other teams. Patterns match against absolute file paths. Arrays merge across settings layers. Managed policy CLAUDE.md files cannot be excluded. See https://code.claude.com/docs/en/memory#exclude-specific-claude-md-files
cleanup_period_days
class-attribute
instance-attribute
¶
Number of days to retain sessions, orphaned subagent worktrees, tasks, shell snapshots, and backups. Minimum is 1; setting 0 is rejected with a validation error. See https://code.claude.com/docs/en/settings#available-settings
company_announcements
class-attribute
instance-attribute
¶
Company announcements to display at startup (one will be randomly selected if multiple are provided)
default_shell
class-attribute
instance-attribute
¶
Default shell for input-box ! commands. Default: bash. Using "powershell" routes ! commands through PowerShell on Windows and requires CLAUDE_CODE_USE_POWERSHELL_TOOL=1 with pwsh on PATH. See https://code.claude.com/docs/en/settings#available-settings
denied_mcp_servers
class-attribute
instance-attribute
¶
denied_mcp_servers: (
list[DeniedMcpServerByServerName | DeniedMcpServerByServerCommand | DeniedMcpServerByServerUrl]
| None
) = Field(None, alias="deniedMcpServers")
Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options
diff_tool
class-attribute
instance-attribute
¶
Where to display file diffs when an IDE is connected: "auto" (default) opens diffs in the IDE's diff viewer, "terminal" keeps them in the terminal. Appears in /config as Diff tool only when Claude Code is connected to a VS Code or JetBrains IDE. See https://code.claude.com/docs/en/settings#global-config-settings
disable_agent_view
class-attribute
instance-attribute
¶
(Managed settings) Turn off background agents and the agent view: claude agents, --bg, /background, and the on-demand supervisor. Also configurable via the CLAUDE_CODE_DISABLE_AGENT_VIEW environment variable (set to 1 to disable). See https://code.claude.com/docs/en/agent-view
disable_all_hooks
class-attribute
instance-attribute
¶
Disable all hooks and statusLine execution. When true in managed settings, user and project-level disableAllHooks cannot override it. See https://code.claude.com/docs/en/hooks#disable-or-remove-hooks
disable_artifact
class-attribute
instance-attribute
¶
Disable the Artifact tool, which publishes session output as a private web page on claude.ai. Also configurable via the CLAUDE_CODE_DISABLE_ARTIFACT environment variable. See https://code.claude.com/docs/en/settings#available-settings
disable_auto_mode
class-attribute
instance-attribute
¶
Set to "disable" to prevent auto mode from being activated: removes auto from the Shift+Tab cycle and rejects --permission-mode auto at startup. See https://code.claude.com/docs/en/settings#available-settings
disable_browser_external_navigation
class-attribute
instance-attribute
¶
disable_browser_external_navigation: bool | None = Field(
None, alias="disableBrowserExternalNavigation"
)
(Managed settings only) Set to true to turn off external browsing in the desktop app's Browser pane. Neither users nor Claude can navigate to external sites, and localhost dev server previews are unaffected. The value must be the JSON boolean true; the string "true" is ignored. See https://code.claude.com/docs/en/desktop#browse-external-sites
disable_bundled_skills
class-attribute
instance-attribute
¶
Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely, while built-in slash commands like /init stay typable but are hidden from the model. Skills from plugins, .claude/skills/, and .claude/commands/ are unaffected. Also configurable via the CLAUDE_CODE_DISABLE_BUNDLED_SKILLS environment variable. See https://code.claude.com/docs/en/settings#available-settings
disable_claude_ai_connectors
class-attribute
instance-attribute
¶
Disable claude.ai MCP connectors so they are not auto-fetched or connected. A value of true in any settings source takes precedence. Requires Claude Code v2.1.182 or later. See https://code.claude.com/docs/en/settings#available-settings
disable_deep_link_registration
class-attribute
instance-attribute
¶
disable_deep_link_registration: Literal["disable"] | None = Field(
None, alias="disableDeepLinkRegistration"
)
Set to "disable" to prevent Claude Code from registering the claude-cli:// deep-link protocol handler on startup. Most useful in managed settings where users cannot override it. See https://code.claude.com/docs/en/settings#available-settings
disable_mobile_simulator_tools
class-attribute
instance-attribute
¶
(Managed settings only) Set to true to block Claude's tools for the desktop app's iOS Simulator pane. Users keep manual use of the pane; only Claude's access is removed. The value must be the JSON boolean true; any other value is ignored, and a malformed value such as "true" or 1 logs a warning. See https://code.claude.com/docs/en/desktop-ios-simulator#turn-off-simulator-access
disable_remote_control
class-attribute
instance-attribute
¶
Disable Remote Control: blocks claude remote-control, the --remote-control flag, auto-start, and the in-session toggle. Requires Claude Code v2.1.128 or later. See https://code.claude.com/docs/en/remote-control
disable_sideload_flags
class-attribute
instance-attribute
¶
(Managed settings only) Reject the --plugin-dir, --plugin-url, --agents, and --mcp-config CLI flags at startup, which users could otherwise pass to bypass strictKnownMarketplaces for a single run. Also rejects these flags from any surface that spawns the CLI with them internally, currently Cowork local sessions in the desktop app. A --mcp-config whose servers are all in-process type: "sdk" entries is still accepted, so the Agent SDK and VS Code extension keep working. Does not block claude mcp add, .mcp.json, or SDK setMcpServers(); pair with allowedMcpServers for per-server MCP control. Requires Claude Code v2.1.193 or later. See https://code.claude.com/docs/en/settings#available-settings
disable_skill_shell_execution
class-attribute
instance-attribute
¶
Disable inline shell execution for !`...` and ```! blocks in skills and custom slash commands from user, project, plugin, or additional-directory sources. Commands are replaced with [shell command execution disabled by policy] instead of being run. Bundled and managed skills are not affected. Most useful in managed settings where users cannot override it. See https://code.claude.com/docs/en/settings#available-settings
disable_workflows
class-attribute
instance-attribute
¶
Disable dynamic workflows and bundled workflow commands. Also configurable via the CLAUDE_CODE_DISABLE_WORKFLOWS environment variable. See https://code.claude.com/docs/en/settings#available-settings
disabled_mcpjson_servers
class-attribute
instance-attribute
¶
disabled_mcpjson_servers: list[DisabledMcpjsonServer] | None = Field(
None, alias="disabledMcpjsonServers", examples=[["filesystem"]]
)
List of rejected MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp
editor_mode
class-attribute
instance-attribute
¶
Key binding mode for the input prompt: "normal" or "vim". Appears in /config as Editor mode. See https://code.claude.com/docs/en/terminal-config#edit-prompts-with-vim-keybindings
effort_level
class-attribute
instance-attribute
¶
effort_level: Literal["low", "medium", "high", "xhigh", "max"] | None = Field(
None, alias="effortLevel"
)
Persist adaptive reasoning effort across sessions. Set to low, medium, high, or xhigh; max and ultracode are session-only and are not accepted in the settings file (use the CLAUDE_CODE_EFFORT_LEVEL environment variable or /effort for a session-only max). Effort is supported on Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6, with xhigh sitting between high and max (added in v2.1.111). Defaults: Fable 5 and Opus 4.8 default to high; Opus 4.6 and Sonnet 4.6 default to high on all plans (Pro/Max raised from medium to high in v2.1.117); Opus 4.7 defaults to xhigh. Use /effort auto to reset to model default. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level
emoji_completion_enabled
class-attribute
instance-attribute
¶
Show emoji suggestions when you type : plus a shortcode in the prompt input, and replace a completed shortcode such as
with its emoji (default: true). Set to false to disable both. Requires Claude Code v2.1.217 or later. See https://code.claude.com/docs/en/interactive-mode#emoji-shortcodes
enable_all_project_mcp_servers
class-attribute
instance-attribute
¶
enable_all_project_mcp_servers: bool | None = Field(
None, alias="enableAllProjectMcpServers", examples=[True]
)
Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp
enable_artifact
class-attribute
instance-attribute
¶
Enable or disable the Artifact tool for this user. When unset, the default follows the feature's availability for your account. The Artifacts row in /config writes this key. A managed disableArtifact and your organization's admin setting take precedence, and the key is ignored in project and local settings (.claude/settings.json, .claude/settings.local.json), which a repository could otherwise commit. Requires Claude Code v2.1.196 or later. See https://code.claude.com/docs/en/artifacts
enabled_mcpjson_servers
class-attribute
instance-attribute
¶
enabled_mcpjson_servers: list[EnabledMcpjsonServer] | None = Field(
None, alias="enabledMcpjsonServers", examples=[["memory", "github"]]
)
List of approved MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp
enabled_plugins
class-attribute
instance-attribute
¶
Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. See https://code.claude.com/docs/en/plugins
enforce_available_models
class-attribute
instance-attribute
¶
(Managed settings) Extend the availableModels allowlist to the Default model option (requires v2.1.175+). Requires a non-empty availableModels list; when the account-type default is not in the allowlist, Default resolves to the first allowed entry instead. Has no effect when availableModels is unset or empty. See https://code.claude.com/docs/en/model-config#enforce-the-allowlist-for-the-default-model
env
class-attribute
instance-attribute
¶
env: Env | None = Field(
default_factory=lambda: Env.model_validate({}),
examples=[
{
"ANTHROPIC_MODEL": "claude-opus-4-1",
"ANTHROPIC_SMALL_FAST_MODEL": "claude-3-5-haiku-latest",
}
],
)
Environment variables to set for Claude Code sessions. Many environment variables provide settings dimensions not available as dedicated settings.json properties (e.g., thinking tokens, prompt caching, bash timeouts, shell configuration). See https://code.claude.com/docs/en/settings#environment-variables for the full list.
external_editor_context
class-attribute
instance-attribute
¶
Prepend Claude's previous response as #-commented context when you open the external editor with Ctrl+G (default: false). Appears in /config as Show last response in external editor. See https://code.claude.com/docs/en/settings#global-config-settings
extra_known_marketplaces
class-attribute
instance-attribute
¶
extra_known_marketplaces: dict[str, ExtraKnownMarketplaces] | None = Field(
None, alias="extraKnownMarketplaces"
)
Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. See https://code.claude.com/docs/en/plugin-marketplaces
fallback_model
class-attribute
instance-attribute
¶
Fallback model chain tried in order when the primary model is overloaded, unavailable, or returns a non-retryable server error. Capped at three entries after deduplication; accepts model names or aliases, and "default" expands to the account-type default. Overridden by the --fallback-model CLI flag for the session. See https://code.claude.com/docs/en/model-config#fallback-model-chains
fast_mode
class-attribute
instance-attribute
¶
Enable fast mode, which uses Claude Opus 5 by default (since v2.1.219) for faster output at higher per-token cost without downgrading to a smaller model. Requires extra usage enabled. Toggle with the /fast command. Supported on Opus 5 and Opus 4.8; fast mode for Opus 4.7 was deprecated on June 25, 2026 and removed on July 24, 2026. Before v2.1.219 fast mode defaulted to Opus 4.8 (v2.1.154 through v2.1.218) and to Opus 4.7 (v2.1.142 through v2.1.153). See https://code.claude.com/docs/en/fast-mode
fast_mode_per_session_opt_in
class-attribute
instance-attribute
¶
Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode
feedback_survey_rate
class-attribute
instance-attribute
¶
feedback_survey_rate: float | None = Field(
None, alias="feedbackSurveyRate", examples=[0.05], ge=0.0, le=1.0
)
Probability (0–1) that the session quality survey appears when eligible. A value of 0.05 means 5% of eligible sessions. See https://code.claude.com/docs/en/settings#available-settings
field_schema
class-attribute
instance-attribute
¶
JSON Schema reference for Claude Code settings
file_checkpointing_enabled
class-attribute
instance-attribute
¶
Snapshot edited files so /rewind can restore them. Also configurable via the CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING environment variable (set to 1 to disable). See https://code.claude.com/docs/en/checkpointing
file_suggestion
class-attribute
instance-attribute
¶
file_suggestion: FileSuggestion | None = Field(
None,
alias="fileSuggestion",
examples=[{"type": "command", "command": "~/.claude/file-suggestion.sh"}],
)
Configure a custom script for @ file autocomplete. See https://code.claude.com/docs/en/settings#file-suggestion-settings
footer_links_regexes
class-attribute
instance-attribute
¶
footer_links_regexes: list[FooterLinksRegex] | None = Field(None, alias='footerLinksRegexes')
Render extra clickable badges in the footer when a regex matches turn output (tool results and assistant responses). Read from user, --settings flag, and managed settings only; ignored in project and local settings. Requires Claude Code v2.1.176 or later. See https://code.claude.com/docs/en/settings#available-settings
force_login_gateway_url
class-attribute
instance-attribute
¶
force_login_gateway_url: str | None = Field(
None, alias="forceLoginGatewayUrl", examples=["https://claude-gateway.example.com"]
)
Pre-fills and locks the gateway URL on the /login Cloud gateway screen. Either this key or forceLoginMethod: "gateway" surfaces that screen; set both so the URL is filled in. Honored only at the managed policy tier; ignored in user and project settings. See https://code.claude.com/docs/en/claude-apps-gateway#set-the-gateway-url
force_login_method
class-attribute
instance-attribute
¶
force_login_method: Literal["claudeai", "console", "gateway"] | None = Field(
None, alias="forceLoginMethod", examples=["claudeai"]
)
Use "claudeai" to restrict login to Claude.ai accounts, "console" to restrict login to Claude Console accounts, or "gateway" to restrict login to a cloud gateway. On Claude Code v2.1.212 or later, every first-party login path enforces the restriction, including the VS Code extension, the Agent SDK, claude setup-token, and /install-github-app; before v2.1.212, only terminal logins enforced it. See https://code.claude.com/docs/en/authentication#restrict-login-to-your-organization
force_login_org_uuid
class-attribute
instance-attribute
¶
force_login_org_uuid: ForceLoginOrgUuid | list[ForceLoginOrgUuidItem] | None = Field(
None, alias="forceLoginOrgUUID", examples=["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
)
Organization UUID to use for OAuth login, or an array of UUIDs to allow several organizations. An empty array fails closed and blocks every login. See https://code.claude.com/docs/en/authentication#restrict-login-to-your-organization
force_remote_settings_refresh
class-attribute
instance-attribute
¶
(Managed settings only) Block CLI startup until remote managed settings are freshly fetched from the server. If the fetch fails, the CLI exits (fail-closed) rather than continuing with cached settings. When not set, startup continues without waiting for remote settings. See https://code.claude.com/docs/en/server-managed-settings
gcp_auth_refresh
class-attribute
instance-attribute
¶
gcp_auth_refresh: str | None = Field(
None, alias="gcpAuthRefresh", examples=["gcloud auth application-default login"], min_length=1
)
Command to run when GCP credentials are expired or cannot be loaded. The command's output is displayed to the user but interactive input is not supported; it times out after three minutes. See https://code.claude.com/docs/en/google-vertex-ai#advanced-credential-configuration
hooks
class-attribute
instance-attribute
¶
hooks: Hooks | None = Field(
None,
examples=[
{
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [{"type": "command", "command": "prettier --write", "timeout": 5}],
}
]
}
],
)
Lifecycle event hooks that run at configurable points during Claude Code operation (tool use, session start/end, notifications, prompt submit, message display, and more), not just before/after tool executions. See https://code.claude.com/docs/en/hooks
http_hook_allowed_env_vars
class-attribute
instance-attribute
¶
http_hook_allowed_env_vars: list[HttpHookAllowedEnvVar] | None = Field(
None, alias="httpHookAllowedEnvVars", examples=[["MY_TOKEN", "HOOK_SECRET"]]
)
Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. Undefined = no restriction. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration
include_co_authored_by
class-attribute
instance-attribute
¶
DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)
include_git_instructions
class-attribute
instance-attribute
¶
Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings
input_needed_notif_enabled
class-attribute
instance-attribute
¶
When Remote Control is connected, send a push notification to your phone when a permission prompt or question is waiting for input. Requires Claude Code v2.1.119 or later. See https://code.claude.com/docs/en/settings#available-settings
language
class-attribute
instance-attribute
¶
Configure Claude's preferred response language (e.g., "japanese", "spanish", "french"). Claude will respond in this language by default. Also sets the voice dictation language and terminal tab session title generation. See https://code.claude.com/docs/en/settings#available-settings
managed_mcp_servers
class-attribute
instance-attribute
¶
(Managed settings, third-party Desktop deployments only) MCP server configurations pushed to all users. Each entry specifies the transport and connection details, plus an optional toolPolicy map. Delivered through the managed settings file or MDM. See https://code.claude.com/docs/en/desktop#enterprise-configuration
minimum_version
class-attribute
instance-attribute
¶
Minimum Claude Code version to stay on. Prevents downgrades when switching release channels. See https://code.claude.com/docs/en/settings#available-settings
model
class-attribute
instance-attribute
¶
Override the default model used by Claude Code. For finer control, use environment variables: ANTHROPIC_MODEL (runtime override), ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL (per-class pinning), CLAUDE_CODE_SUBAGENT_MODEL (subagent model). See https://code.claude.com/docs/en/model-config
model_overrides
class-attribute
instance-attribute
¶
model_overrides: dict[str, str] | None = Field(
None,
alias="modelOverrides",
examples=[
{
"claude-opus-4-6": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod"
}
],
)
Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs, Vertex AI version names, or Foundry deployment names. Each model picker entry uses its mapped value when calling the provider API. Unknown keys are ignored. See https://code.claude.com/docs/en/model-config#override-model-ids-per-version
otel_headers_helper
class-attribute
instance-attribute
¶
Path to an executable, or a shell command line with arguments, that outputs OpenTelemetry headers as a JSON object. Runs at startup and re-runs on the interval set by CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS. Requires CLAUDE_CODE_ENABLE_TELEMETRY=1. See https://code.claude.com/docs/en/monitoring-usage#dynamic-headers
output_style
class-attribute
instance-attribute
¶
output_style: str | None = Field(
None,
alias="outputStyle",
examples=["default", "Proactive", "Explanatory", "Learning"],
min_length=1,
)
Controls the output style for assistant responses. Built-in styles: default, Proactive, Explanatory, Learning. Custom styles can be added in ~/.claude/output-styles/ or .claude/output-styles/. See https://code.claude.com/docs/en/output-styles
parent_settings_behavior
class-attribute
instance-attribute
¶
parent_settings_behavior: Literal["first-wins", "merge"] | None = Field(
"first-wins", alias="parentSettingsBehavior"
)
(Admin/managed settings only) Controls how SDK managedSettings (parent tier) merge with inherited settings. 'first-wins': first non-empty value applies (default). 'merge': merge arrays and objects. See https://code.claude.com/docs/en/server-managed-settings
permission_explainer_enabled
class-attribute
instance-attribute
¶
Show a model-generated explanation of the command when you press Ctrl+E on a Bash or PowerShell permission prompt (default: true). Set to false to turn the shortcut off. See https://code.claude.com/docs/en/permissions#permission-system
permissions
class-attribute
instance-attribute
¶
permissions: Permissions | None = Field(
None,
examples=[
{
"allow": ["Bash(git add:*)"],
"ask": ["Bash(gh pr create:*)", "Bash(git commit:*)"],
"deny": ["Read(*.env)", "Bash(rm:*)", "Bash(curl:*)"],
"defaultMode": "default",
}
],
)
Tool usage permissions configuration. See https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings See https://code.claude.com/docs/en/tools-reference for full list of tools available to Claude.
plans_directory
class-attribute
instance-attribute
¶
plans_directory: str | None = Field("~/.claude/plans", alias="plansDirectory", examples=["./plans"])
Customize where plan files are stored. Path is relative to project root (default: ~/.claude/plans)
plugin_configs
class-attribute
instance-attribute
¶
plugin_configs: dict[str, PluginConfigs] | None = Field(None, alias='pluginConfigs')
Per-plugin configuration including MCP server user configs and plugin options, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins
plugin_suggestion_marketplaces
class-attribute
instance-attribute
¶
plugin_suggestion_marketplaces: list[str] | None = Field(None, alias="pluginSuggestionMarketplaces")
(Managed settings only) Allowlist of marketplace names whose plugins may surface as contextual "suggested for this directory" tips in the /plugin Discover tab. No marketplace-declared suggestions surface without this allowlist. The built-in first-party frontend-design tip is unaffected. See https://code.claude.com/docs/en/settings#available-settings
plugin_trust_message
class-attribute
instance-attribute
¶
(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings
policy_helper
class-attribute
instance-attribute
¶
policy_helper: PolicyHelper | None = Field(None, alias='policyHelper')
Admin-deployed executable that computes managed settings dynamically at startup. Honored only from MDM or the system managed-settings.json. Requires Claude Code v2.1.136 or later. See https://code.claude.com/docs/en/settings#available-settings
pr_url_template
class-attribute
instance-attribute
¶
pr_url_template: str | None = Field(
None,
alias="prUrlTemplate",
examples=["https://reviews.example.com/{owner}/{repo}/pull/{number}"],
)
URL template for the PR badge shown in the footer and in tool-result summaries. Substitutes placeholders {host}, {owner}, {repo}, {number}, {url} from the gh-reported PR URL. Use this to point PR links at an internal code-review tool instead of github.com. Does not affect #123 autolinks in Claude's prose. See https://code.claude.com/docs/en/settings#available-settings
preferred_notif_channel
class-attribute
instance-attribute
¶
preferred_notif_channel: (
Literal[
"auto",
"terminal_bell",
"iterm2",
"iterm2_with_bell",
"kitty",
"ghostty",
"notifications_disabled",
]
| None
) = Field("auto", alias="preferredNotifChannel")
Method for task-complete and permission-prompt notifications. "auto" (default) sends a desktop notification in iTerm2, Ghostty, and Kitty and does nothing in other terminals; "terminal_bell" rings the bell in any terminal; "notifications_disabled" turns them off. See https://code.claude.com/docs/en/terminal-config#get-a-terminal-bell-or-notification
prefers_reduced_motion
class-attribute
instance-attribute
¶
Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility
process_wrapper
class-attribute
instance-attribute
¶
process_wrapper: str | None = Field(
None, alias="processWrapper", examples=["/opt/corp/launcher --profile claude"]
)
Corporate launcher command placed in front of the background processes Claude Code starts. Honored from managed settings, a --settings file, and user settings only; the CLAUDE_CODE_PROCESS_WRAPPER environment variable takes precedence when both are set. Requires Claude Code v2.1.210 or later. See https://code.claude.com/docs/en/corporate-launcher
remote_control_at_startup
class-attribute
instance-attribute
¶
Connect Remote Control automatically when each interactive session starts. true = always, false = never, unset = organization default. Requires Claude Code v2.1.119 or later. See https://code.claude.com/docs/en/remote-control#enable-remote-control-for-all-sessions
require_cowork_full_vm_sandbox
class-attribute
instance-attribute
¶
(Managed settings only) Run Claude's tools inside an isolated virtual machine instead of on your Mac. Disables the desktop app's iOS Simulator pane and Claude's simulator tools entirely, so the pane cannot attach a device while it is set. See https://code.claude.com/docs/en/desktop-ios-simulator#turn-off-simulator-access
required_maximum_version
class-attribute
instance-attribute
¶
(Managed settings only) Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. See https://code.claude.com/docs/en/admin-setup#decide-what-to-enforce
required_minimum_version
class-attribute
instance-attribute
¶
(Managed settings only) Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup rather than only warning. See https://code.claude.com/docs/en/admin-setup#decide-what-to-enforce
respect_gitignore
class-attribute
instance-attribute
¶
Control whether the @ file picker respects .gitignore patterns. When true (default), files matching .gitignore patterns are excluded from suggestions
respond_to_bash_commands
class-attribute
instance-attribute
¶
Whether Claude responds after an input-box ! shell command runs (v2.1.186+). Set to false to add the command output to context without a response. See https://code.claude.com/docs/en/interactive-mode#shell-mode-with--prefix
sandbox
class-attribute
instance-attribute
¶
sandbox: Sandbox | None = None
Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing
show_clear_context_on_plan_accept
class-attribute
instance-attribute
¶
When true, the plan-approval dialog offers a "clear context" option. Defaults to false.
show_thinking_summaries
class-attribute
instance-attribute
¶
Show thinking summaries in the transcript view (Ctrl+O). Thinking summaries are not generated by default in interactive sessions; set to true to restore. See https://code.claude.com/docs/en/settings#available-settings
show_turn_duration
class-attribute
instance-attribute
¶
Show turn duration messages after responses (e.g., "Cooked for 1m 6s"). Set to false to hide these messages (default: true)
skill_listing_budget_fraction
class-attribute
instance-attribute
¶
skill_listing_budget_fraction: float | None = Field(
0.01, alias="skillListingBudgetFraction", gt=0.0, le=1.0
)
Fraction of the model context window reserved for the skill listing sent to Claude (default 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Also configurable via the SLASH_COMMAND_TOOL_CHAR_BUDGET environment variable (fixed character count). See https://code.claude.com/docs/en/skills#skill-descriptions-are-cut-short
skill_listing_max_desc_chars
class-attribute
instance-attribute
¶
Per-skill character cap on the combined description and when_to_use text in the skill listing Claude sees each turn. Text longer than this is truncated. See https://code.claude.com/docs/en/skills#skill-descriptions-are-cut-short
skill_overrides
class-attribute
instance-attribute
¶
skill_overrides: dict[str, Literal["on", "name-only", "user-invocable-only", "off"]] | None = Field(
None, alias="skillOverrides", examples=[{"legacy-context": "name-only", "deploy": "off"}]
)
Per-skill visibility overrides. Controls whether skills appear to Claude and in the / picker. Values: 'on' (name and description shown, default), 'name-only' (name only), 'user-invocable-only' (hidden from Claude, visible in /), 'off' (hidden everywhere). Plugin skills are not affected by this setting. See https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings
skip_dangerous_mode_permission_prompt
class-attribute
instance-attribute
¶
skip_dangerous_mode_permission_prompt: bool | None = Field(
None, alias="skipDangerousModePermissionPrompt"
)
Whether the user has accepted the bypass permissions mode dialog. Typically managed by the CLI rather than set by hand.
skip_web_fetch_preflight
class-attribute
instance-attribute
¶
Skip the WebFetch blocklist check for enterprise environments with restrictive security policies. See https://code.claude.com/docs/en/settings#available-settings
skipped_marketplaces
class-attribute
instance-attribute
¶
List of marketplace names the user has chosen not to install when prompted. See https://code.claude.com/docs/en/discover-plugins
skipped_plugins
class-attribute
instance-attribute
¶
List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted. See https://code.claude.com/docs/en/discover-plugins
spinner_tips_enabled
class-attribute
instance-attribute
¶
Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)
spinner_tips_override
class-attribute
instance-attribute
¶
spinner_tips_override: SpinnerTipsOverride | None = Field(None, alias='spinnerTipsOverride')
Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings
spinner_verbs
class-attribute
instance-attribute
¶
spinner_verbs: SpinnerVerbs | None = Field(None, alias='spinnerVerbs')
Customize the verbs shown in spinner progress messages
ssh_configs
class-attribute
instance-attribute
¶
ssh_configs: list[SshConfig] | None = Field(None, alias='sshConfigs')
(Managed settings) Pre-configured SSH connections distributed to Desktop users. See https://code.claude.com/docs/en/desktop#ssh-sessions
ssh_host_allowlist
class-attribute
instance-attribute
¶
(Managed settings only) Allowlist restricting Desktop SSH sessions to approved hosts. Patterns are case-insensitive; * matches any host and *.example.com matches example.com and any subdomain. See https://code.claude.com/docs/en/desktop#ssh-sessions
status_line
class-attribute
instance-attribute
¶
status_line: StatusLine | None = Field(
None, alias="statusLine", examples=[{"type": "command", "command": "~/.claude/statusline.sh"}]
)
Custom status line display configuration. See https://code.claude.com/docs/en/statusline
strict_known_marketplaces
class-attribute
instance-attribute
¶
strict_known_marketplaces: (
list[
StrictMarketplaceHostPattern
| StrictMarketplaceGithub
| StrictMarketplaceGit
| StrictMarketplaceUrl
| StrictMarketplaceNpm
| StrictMarketplaceFile
| StrictMarketplaceDirectory
| StrictMarketplacePathPattern
| StrictMarketplaceSkillsDir
]
| None
) = Field(
None,
alias="strictKnownMarketplaces",
examples=[
[
{"source": "github", "repo": "acme-corp/approved-plugins"},
{"source": "npm", "package": "@acme-corp/compliance-plugins"},
]
],
)
(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/plugin-marketplaces#managed-marketplace-restrictions
strict_plugin_only_customization
class-attribute
instance-attribute
¶
strict_plugin_only_customization: bool | StrictPluginOnlyCustomization | None = Field(
None, alias="strictPluginOnlyCustomization"
)
(Managed settings) Block non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g., ["skills", "hooks"]); true locks all four; false is an explicit no-op. See https://code.claude.com/docs/en/plugins-reference
subagent_status_line
class-attribute
instance-attribute
¶
subagent_status_line: SubagentStatusLine | None = Field(None, alias='subagentStatusLine')
Status line configuration for subagent sessions. See https://code.claude.com/docs/en/statusline#subagent-status-lines
syntax_highlighting_disabled
class-attribute
instance-attribute
¶
Disable syntax highlighting in diffs, code blocks, and file previews. See https://code.claude.com/docs/en/settings#available-settings
teammate_default_model
class-attribute
instance-attribute
¶
Default model for agent team teammates when the spawn prompt does not specify one. Set to a model alias such as "sonnet", or null to inherit the lead's current /model selection. Appears in /config as Default teammate model. See https://code.claude.com/docs/en/agent-teams
teammate_mode
class-attribute
instance-attribute
¶
teammate_mode: Literal["auto", "in-process", "tmux", "iterm2"] | None = Field(
"in-process", alias="teammateMode"
)
How agent team teammates display: "auto" picks split panes in tmux or iTerm2, in-process otherwise; "iterm2" (added in v2.1.186) forces iTerm2 native split panes and requires the it2 CLI (it shows an error with the install command if it2 is missing). The default is "in-process" (it was "auto" before v2.1.179). Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams#choose-a-display-mode
terminal_progress_bar_enabled
class-attribute
instance-attribute
¶
Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: true)
theme
class-attribute
instance-attribute
¶
theme: (
Literal[
"auto", "dark", "light", "dark-daltonized", "light-daltonized", "dark-ansi", "light-ansi"
]
| Theme
| None
) = None
Color theme for the interface: auto, dark, light, the daltonized variants (deuteranopia-friendly), the ansi variants (16-color terminals), or a custom theme reference such as custom:<slug> or custom:<plugin-name>:<slug>. See https://code.claude.com/docs/en/terminal-config#match-the-color-theme
tui
class-attribute
instance-attribute
¶
TUI rendering mode. Use "fullscreen" for the flicker-free alt-screen renderer with virtualized scrollback; "default" for the classic main-screen renderer. Corresponds to the /tui command. See https://code.claude.com/docs/en/settings#available-settings
use_auto_mode_during_plan
class-attribute
instance-attribute
¶
When true, apply the auto mode classifier during plan mode to auto-approve safe read-only tool calls while planning. Has no effect unless permissions.defaultMode allows auto. See https://code.claude.com/docs/en/permissions
verbose
class-attribute
instance-attribute
¶
Show full tool output instead of truncated summaries. The --verbose flag overrides this for a single session. Requires Claude Code v2.1.119 or later. See https://code.claude.com/docs/en/settings#available-settings
view_mode
class-attribute
instance-attribute
¶
Transcript view mode. "default" shows standard interactive view; "verbose" shows expanded tool details; "focus" shows prompt, one-line tool summaries, and final response only (Ctrl+O toggle). See https://code.claude.com/docs/en/settings#available-settings
vim_insert_mode_remaps
class-attribute
instance-attribute
¶
vim_insert_mode_remaps: dict[str, str] | None = Field(
None, alias="vimInsertModeRemaps", examples=[{"jj": "<Esc>"}]
)
Map two-key INSERT-mode sequences to Escape in vim editor mode. Each key is exactly two printable characters typed in sequence, and <Esc> is the only supported target; other entries are ignored. Read from user, --settings flag, and managed settings only, so a repository's checked-in settings cannot remap your keystrokes. Has no effect unless editorMode is "vim". Requires Claude Code v2.1.208 or later. See https://code.claude.com/docs/en/interactive-mode#remap-insert-mode-key-sequences
voice
class-attribute
instance-attribute
¶
voice: Voice | None = None
Voice dictation settings: enabled turns dictation on, mode selects "hold" or "tap", and autoSubmit sends the prompt on key release in hold mode. Written automatically when you run /voice. Requires a Claude.ai account. See https://code.claude.com/docs/en/voice-dictation
voice_enabled
class-attribute
instance-attribute
¶
Legacy alias for voice.enabled; prefer the voice object. Requires a Claude.ai account. See https://code.claude.com/docs/en/settings#available-settings
wheel_scroll_acceleration_enabled
class-attribute
instance-attribute
¶
wheel_scroll_acceleration_enabled: bool | None = Field(None, alias="wheelScrollAccelerationEnabled")
In fullscreen rendering, accelerate mouse-wheel scroll speed during fast scrolls (v2.1.174+). Set to false for a constant scroll rate per wheel notch. See https://code.claude.com/docs/en/fullscreen#mouse-wheel-scrolling
workflow_keyword_trigger_enabled
class-attribute
instance-attribute
¶
Whether including the keyword "ultracode" in a prompt triggers a dynamic workflow. Requires Claude Code v2.1.157 or later. See https://code.claude.com/docs/en/settings#available-settings
workflow_size_guideline
class-attribute
instance-attribute
¶
workflow_size_guideline: Literal["unrestricted", "small", "medium", "large"] | None = Field(
"unrestricted", alias="workflowSizeGuideline"
)
Sets the agent count Claude aims for in the dynamic workflows it writes. Claude Code sends the value to Claude as advice, not an enforced cap. Accepts "unrestricted" (default, which sends no guideline), "small", "medium", or "large". Appears in /config as Dynamic workflow size, and can be set with /config workflowSizeGuideline=small. Requires Claude Code v2.1.202 or later. On v2.1.203 or later the guideline's agent count also replaces the default threshold for the Large workflow warning. See https://code.claude.com/docs/en/workflows#set-a-size-guideline
worktree
class-attribute
instance-attribute
¶
worktree: Worktree | None = None
Configuration for --worktree sessions. See https://code.claude.com/docs/en/settings#worktree-settings
wsl_inherits_windows_settings
class-attribute
instance-attribute
¶
(Windows managed settings only) When true, Claude Code on WSL reads managed settings from the Windows policy chain in addition to /etc/claude-code, with Windows sources taking priority. Only honored when set in the HKLM registry key or C:\Program Files\ClaudeCode\managed-settings.json, both of which require Windows admin to write. For HKCU policy to also apply on WSL, the flag must additionally be set in HKCU itself. Has no effect on native Windows. See https://code.claude.com/docs/en/settings#available-settings
ClaudeOAuthWaitForCompletionResponse
¶
Bases: ClaudeCodeBaseModel
Response from waiting for a Claude OAuth flow to complete.
Source code in src/clawd_code_sdk/models/control.py
CommandLifecycleMessage
¶
Bases: BaseMessage
Progress of a user message that was sent with a uuid (capability msg_lifecycle_v1).
queued: waiting behind the running work. started: taken in (the cycle it starts,
or the running cycle it was folded into). completed: its work ended (after the
result for a message that started a cycle, before it for one folded into a cycle).
cancelled: an interrupt stopped it. discarded / refused: dropped before it ran.
Source code in src/clawd_code_sdk/models/messages.py
CommandsChangedMessage
¶
Bases: BaseSystemMessage
Emitted when the set of available slash commands changes.
Source code in src/clawd_code_sdk/models/system_messages.py
CompactBoundarySystemMessage
¶
Bases: BaseSystemMessage
System message emitted at compaction boundaries.
Source code in src/clawd_code_sdk/models/system_messages.py
ConfigOutput
¶
Bases: TypedDict
Output from the Config tool.
Source code in src/clawd_code_sdk/models/output_types.py
ContentDocumentSource
¶
Bases: BaseContentBlock
Document made of content blocks (text / images).
Source code in src/clawd_code_sdk/models/content_blocks.py
ContextUsageAgent
¶
Bases: ClaudeCodeBaseModel
An agent contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageAttachmentBreakdown
¶
ContextUsageCategory
¶
Bases: ClaudeCodeBaseModel
A single category in the context usage breakdown.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageDeferredBuiltinTool
¶
Bases: ClaudeCodeBaseModel
A deferred builtin tool contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageGridCell
¶
Bases: ClaudeCodeBaseModel
A single cell in the context usage grid visualization.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageMcpInstructions
¶
ContextUsageMcpTool
¶
Bases: ClaudeCodeBaseModel
An MCP tool contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageMemoryFile
¶
ContextUsageMessageBreakdown
¶
Bases: ClaudeCodeBaseModel
Breakdown of message tokens by category.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageSkillFrontmatter
¶
Bases: ClaudeCodeBaseModel
A single skill's frontmatter contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageSkills
¶
Bases: ClaudeCodeBaseModel
Skills context usage summary.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageSlashCommands
¶
ContextUsageSystemPromptSection
¶
ContextUsageSystemTool
¶
ContextUsageToolCallBreakdown
¶
Bases: ClaudeCodeBaseModel
Token breakdown for a specific tool call type.
Source code in src/clawd_code_sdk/models/context_usage.py
ContinueLatest
dataclass
¶
Bases: BaseSessionConfig
Continue the most recent conversation.
Source code in src/clawd_code_sdk/models/options.py
fork
class-attribute
instance-attribute
¶
If True, fork to a new session ID instead of continuing in-place.
ControlErrorResponse
¶
ControlRequestProgressMessage
¶
Bases: BaseSystemMessage
Progress for a long-running control request (e.g. side question).
Source code in src/clawd_code_sdk/models/system_messages.py
ControlResponse
¶
ConversationResetMessage
¶
Bases: BaseMessage
Emitted when the CLI starts a new conversation within the same session.
E.g. after /clear, exiting plan mode into a fresh context, or onboarding.
Source code in src/clawd_code_sdk/models/messages.py
CwdChangedHookInput
¶
CwdChangedHookSpecificOutput
¶
DirectoryAddedHookInput
¶
Bases: BaseHookInput
Input data for DirectoryAdded hook events.
Source code in src/clawd_code_sdk/models/hooks.py
DocumentBlock
¶
Bases: BaseContentBlock
Document content block (e.g. an attached PDF) in a user message.
Source code in src/clawd_code_sdk/models/content_blocks.py
EditOutput
¶
Bases: TypedDict
tool_use_result for the Edit tool.
Source code in src/clawd_code_sdk/models/output_types.py
staged
instance-attribute
¶
Whether the edit was staged instead of written.
ElicitationCompleteMessage
¶
Bases: BaseSystemMessage
System message emitted when an MCP elicitation completes.
Source code in src/clawd_code_sdk/models/system_messages.py
ElicitationHookInput
¶
Bases: BaseHookInput
Input data for Elicitation hook events.
Source code in src/clawd_code_sdk/models/hooks.py
ElicitationHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for Elicitation events.
Source code in src/clawd_code_sdk/models/hooks.py
ElicitationResultHookInput
¶
Bases: BaseHookInput
Input data for ElicitationResult hook events.
Source code in src/clawd_code_sdk/models/hooks.py
ElicitationResultHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for ElicitationResult events.
Source code in src/clawd_code_sdk/models/hooks.py
EnterPlanModeInput
¶
Bases: TypedDict
Input for the EnterPlanMode tool. Enters planning mode.
Not part of the official SDK ToolInputSchemas as of SDK v0.2.62. Shape derived from empirical testing.
EnterPlanModeOutput
¶
Bases: TypedDict
tool_use_result for the EnterPlanMode tool.
Not part of the official SDK ToolOutputSchemas as of SDK v0.2.62. Shape derived from empirical testing.
Source code in src/clawd_code_sdk/models/output_types.py
EnterWorktreeOutput
¶
Bases: TypedDict
tool_use_result for the EnterWorktree tool.
Source code in src/clawd_code_sdk/models/output_types.py
ExitPlanModeInput
¶
Bases: TypedDict
Input for the ExitPlanMode tool. Exits planning mode for user approval.
Source code in src/clawd_code_sdk/models/input_types.py
ExitPlanModeOutput
¶
Bases: TypedDict
tool_use_result for the ExitPlanMode tool.
Source code in src/clawd_code_sdk/models/output_types.py
awaitingLeaderApproval
instance-attribute
¶
When true, the teammate has sent a plan approval request to the team leader.
hasTaskTool
instance-attribute
¶
Whether the Task tool is available in the current context.
planWasEdited
instance-attribute
¶
Whether the plan was edited by the user.
requestId
instance-attribute
¶
Unique identifier for the plan approval request.
ExitWorktreeInput
¶
Bases: TypedDict
Input for the ExitWorktree tool.
Source code in src/clawd_code_sdk/models/input_types.py
ExitWorktreeOutput
¶
Bases: TypedDict
tool_use_result for the ExitWorktree tool.
Source code in src/clawd_code_sdk/models/output_types.py
FileChangedHookInput
¶
Bases: BaseHookInput
Input data for FileChanged hook events.
Source code in src/clawd_code_sdk/models/hooks.py
FileChangedHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for FileChanged events.
Source code in src/clawd_code_sdk/models/hooks.py
FileDocumentSource
¶
FileEditInput
¶
Bases: TypedDict
Input for the Edit tool. Performs exact string replacements in files.
Source code in src/clawd_code_sdk/models/input_types.py
FileReadInput
¶
Bases: TypedDict
Input for the Read tool. Reads files including text, images, PDFs, and notebooks.
Source code in src/clawd_code_sdk/models/input_types.py
allow_large
instance-attribute
¶
Read a text file (or line range) that is over the usual size limits.
limit
instance-attribute
¶
The number of lines to read. Only provide if the file is too large to read at once
offset
instance-attribute
¶
The line number to start reading from.
Only provide if the file is too large to read at once.
pages
instance-attribute
¶
Page range for PDF files (e.g., "1-5", "3", "10-20"). Only applicable to PDF files.
Maximum 20 pages per request.
FileWriteInput
¶
Bases: TypedDict
Input for the Write tool. Writes a file to the local filesystem.
Source code in src/clawd_code_sdk/models/input_types.py
FilesPersistedSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when files have been persisted.
Source code in src/clawd_code_sdk/models/system_messages.py
Filesystem
¶
Bases: ClaudeCodeBaseModel
Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation.
Source code in src/clawd_code_sdk/models/settings.py
allow_managed_read_paths_only
class-attribute
instance-attribute
¶
(Managed settings only) When true, only allowRead paths from managed settings are used; user, project, and local allowRead entries are ignored. denyRead still merges from all sources. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation
allow_read
class-attribute
instance-attribute
¶
Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. See https://code.claude.com/docs/en/sandboxing#granting-subprocess-write-access-to-specific-paths
allow_write
class-attribute
instance-attribute
¶
Paths where subprocesses are allowed to write. Supports prefixes: // (absolute), ~/ (home directory), / (relative to settings file), ./ or no prefix (relative path). See https://code.claude.com/docs/en/sandboxing#granting-subprocess-write-access-to-specific-paths
deny_read
class-attribute
instance-attribute
¶
Paths where subprocesses are explicitly denied read access. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation
deny_write
class-attribute
instance-attribute
¶
Paths where subprocesses are explicitly denied write access. Takes precedence over allowWrite. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation
disabled
class-attribute
instance-attribute
¶
Skip filesystem isolation while keeping network isolation: sandboxed commands get unrestricted read and write access to the host filesystem, and network egress stays confined to network.allowedDomains. Only honored from user, managed, or CLI --settings settings (default: false). Requires Claude Code v2.1.216 or later. See https://code.claude.com/docs/en/sandboxing#disable-filesystem-isolation
FromPR
dataclass
¶
Bases: BaseSessionConfig
Resume sessions linked to a specific GitHub PR.
Accepts a PR number or URL. Sessions are automatically linked
when created via gh pr create.
Source code in src/clawd_code_sdk/models/options.py
GetSettingsResponse
¶
Bases: BaseModel
Response from get_settings() containing effective and per-source settings.
Source code in src/clawd_code_sdk/models/control.py
effective
instance-attribute
¶
The merged effective settings (ClaudeCodeSettings shape, camelCase keys).
GitDiff
¶
Bases: TypedDict
Git diff information for a file change.
Source code in src/clawd_code_sdk/models/output_types.py
GlobInput
¶
Bases: TypedDict
Input for the Glob tool. Fast file pattern matching.
Source code in src/clawd_code_sdk/models/input_types.py
GlobOutput
¶
Bases: TypedDict
tool_use_result for the Glob tool.
Source code in src/clawd_code_sdk/models/output_types.py
countIsComplete
instance-attribute
¶
Whether totalMatches is exact.
timedOut
instance-attribute
¶
Whether the search timed out (results may be partial).
totalMatches
instance-attribute
¶
Total matches before truncation (a lower bound when countIsComplete is false).
truncated
instance-attribute
¶
Whether results were truncated (limited to 100 files).
GrepOutput
¶
Bases: TypedDict
tool_use_result for the Grep tool (all modes).
Source code in src/clawd_code_sdk/models/output_types.py
HookContext
¶
Bases: TypedDict
Context information for hook callbacks.
Fields
signal: Reserved for future abort signal support. Currently always None.
Source code in src/clawd_code_sdk/models/hooks.py
HookMatcher
¶
Bases: BaseModel
Hook matcher configuration.
Source code in src/clawd_code_sdk/models/hooks.py
on_failure
class-attribute
instance-attribute
¶
What to do when a hook callback fails (raises, times out).
"continue" ignores the failure, "block" fails closed and blocks the action.
Requires a CLI that reports hook_on_failure_supported.
HookMatcherConfig
¶
Bases: TypedDict
Declarative hook matcher for agent/skill/settings hook configuration.
See https://code.claude.com/docs/en/hooks#matcher-patterns
Source code in src/clawd_code_sdk/models/hooks.py
HookProgressSystemMessage
¶
Bases: BaseSystemMessage
Progress update from a running hook.
Source code in src/clawd_code_sdk/models/system_messages.py
HookResponseSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when a hook completes.
Source code in src/clawd_code_sdk/models/system_messages.py
HookStartedSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when a hook starts.
Source code in src/clawd_code_sdk/models/system_messages.py
Hooks
¶
Bases: ClaudeCodeBaseModel
Lifecycle event hooks that run at configurable points during Claude Code operation (tool use, session start/end, notifications, prompt submit, message display, and more), not just before/after tool executions. See https://code.claude.com/docs/en/hooks.
Source code in src/clawd_code_sdk/models/settings.py
3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 | |
config_change
class-attribute
instance-attribute
¶
config_change: list[HookMatcher] | None = Field(None, alias='ConfigChange')
Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange
cwd_changed
class-attribute
instance-attribute
¶
cwd_changed: list[HookMatcher] | None = Field(None, alias='CwdChanged')
Hooks that run when the working directory changes. Provides cwd (new directory) and previous_cwd. Matchers are ignored; fires on every directory change. See https://code.claude.com/docs/en/hooks#cwdchanged
directory_added
class-attribute
instance-attribute
¶
directory_added: list[HookMatcher] | None = Field(None, alias='DirectoryAdded')
UNDOCUMENTED. Hooks that run after /add-dir or the SDK register_repo_root control request registers a new working directory mid-session (added v2.1.219)
elicitation
class-attribute
instance-attribute
¶
elicitation: list[HookMatcher] | None = Field(None, alias='Elicitation')
Hooks that run when an MCP server requests user input during a tool call. See https://code.claude.com/docs/en/hooks
elicitation_result
class-attribute
instance-attribute
¶
elicitation_result: list[HookMatcher] | None = Field(None, alias='ElicitationResult')
Hooks that run after a user responds to an MCP elicitation, before the response is sent back to the server. See https://code.claude.com/docs/en/hooks
file_changed
class-attribute
instance-attribute
¶
file_changed: list[HookMatcher] | None = Field(None, alias='FileChanged')
Hooks that run when a watched file is created, modified, or deleted. Supports filename matchers. Provides file_path and file_event_type (created, modified, deleted). See https://code.claude.com/docs/en/hooks#filechanged
instructions_loaded
class-attribute
instance-attribute
¶
instructions_loaded: list[HookMatcher] | None = Field(None, alias='InstructionsLoaded')
Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded
message_display
class-attribute
instance-attribute
¶
message_display: list[HookMatcher] | None = Field(None, alias='MessageDisplay')
Hooks that run while assistant message text is displayed
notification
class-attribute
instance-attribute
¶
notification: list[HookMatcher] | None = Field(None, alias='Notification')
Hooks that trigger on notifications
permission_denied
class-attribute
instance-attribute
¶
permission_denied: list[HookMatcher] | None = Field(None, alias='PermissionDenied')
Hooks that run when a tool call is denied by the auto mode classifier. Supports matchers on tool name. See https://code.claude.com/docs/en/hooks
permission_request
class-attribute
instance-attribute
¶
permission_request: list[HookMatcher] | None = Field(None, alias='PermissionRequest')
Hooks that run when a permission dialog appears
post_compact
class-attribute
instance-attribute
¶
post_compact: list[HookMatcher] | None = Field(None, alias='PostCompact')
Hooks that run after the context is compacted. See https://code.claude.com/docs/en/hooks
post_tool_batch
class-attribute
instance-attribute
¶
post_tool_batch: list[HookMatcher] | None = Field(None, alias='PostToolBatch')
Hooks that run after a full batch of parallel tool calls resolves, before the next model call. Exit code 2 blocks the agentic loop. Does not support matchers. See https://code.claude.com/docs/en/hooks
post_tool_use
class-attribute
instance-attribute
¶
post_tool_use: list[HookMatcher] | None = Field(None, alias='PostToolUse')
Hooks that run after tool completion
post_tool_use_failure
class-attribute
instance-attribute
¶
post_tool_use_failure: list[HookMatcher] | None = Field(None, alias='PostToolUseFailure')
Hooks that run after a tool fails
pre_compact
class-attribute
instance-attribute
¶
pre_compact: list[HookMatcher] | None = Field(None, alias='PreCompact')
Hooks that run before the context is compacted
pre_tool_use
class-attribute
instance-attribute
¶
pre_tool_use: list[HookMatcher] | None = Field(None, alias='PreToolUse')
Hooks that run before tool calls
session_end
class-attribute
instance-attribute
¶
session_end: list[HookMatcher] | None = Field(None, alias='SessionEnd')
Hooks that run when a session ends
session_start
class-attribute
instance-attribute
¶
session_start: list[HookMatcher] | None = Field(None, alias='SessionStart')
Hooks that run when a new session starts
setup
class-attribute
instance-attribute
¶
setup: list[HookMatcher] | None = Field(None, alias='Setup')
UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)
stop
class-attribute
instance-attribute
¶
stop: list[HookMatcher] | None = Field(None, alias='Stop')
Hooks that run when agents finish responding. Does not run on user interrupt
stop_failure
class-attribute
instance-attribute
¶
stop_failure: list[HookMatcher] | None = Field(None, alias='StopFailure')
Hooks that run when a turn ends due to an API error (e.g., rate_limit, authentication_failed, billing_error, invalid_request, server_error, max_output_tokens, unknown). Matcher can scope to specific error types. Hook output and exit code are ignored. See https://code.claude.com/docs/en/hooks
subagent_start
class-attribute
instance-attribute
¶
subagent_start: list[HookMatcher] | None = Field(None, alias='SubagentStart')
Hooks that run when a subagent is spawned
subagent_stop
class-attribute
instance-attribute
¶
subagent_stop: list[HookMatcher] | None = Field(None, alias='SubagentStop')
Hooks that run when subagents finish responding
task_completed
class-attribute
instance-attribute
¶
task_completed: list[HookMatcher] | None = Field(None, alias='TaskCompleted')
Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted
task_created
class-attribute
instance-attribute
¶
task_created: list[HookMatcher] | None = Field(None, alias='TaskCreated')
Hooks that run when a task is being created via TaskCreate. Exit code 2 rolls back task creation. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcreated
teammate_idle
class-attribute
instance-attribute
¶
teammate_idle: list[HookMatcher] | None = Field(None, alias='TeammateIdle')
Hooks that run when an agent team teammate is about to go idle. Exit code 2 sends feedback and keeps the teammate working. Does not support matchers. Agent teams are experimental. See https://code.claude.com/docs/en/hooks#teammateidle
user_prompt_expansion
class-attribute
instance-attribute
¶
user_prompt_expansion: list[HookMatcher] | None = Field(None, alias='UserPromptExpansion')
Hooks that run when a user-typed command expands into a prompt, before it reaches Claude. Exit code 2 blocks the expansion. Supports matchers on command name. See https://code.claude.com/docs/en/hooks
user_prompt_submit
class-attribute
instance-attribute
¶
user_prompt_submit: list[HookMatcher] | None = Field(None, alias='UserPromptSubmit')
Hooks that run when a user submits a prompt
worktree_create
class-attribute
instance-attribute
¶
worktree_create: list[HookMatcher] | None = Field(None, alias='WorktreeCreate')
Hooks that run when a worktree is created via --worktree or isolation: "worktree" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate
worktree_remove
class-attribute
instance-attribute
¶
worktree_remove: list[HookMatcher] | None = Field(None, alias='WorktreeRemove')
Hooks that run when a worktree is being removed at session exit or when a subagent finishes. Command handlers only, no matchers. Used for cleanup tasks; cannot block removal. See https://code.claude.com/docs/en/hooks#worktreeremove
ImageBlock
¶
Bases: BaseContentBlock
Image content block (storage-only, not emitted on the wire).
Source code in src/clawd_code_sdk/models/content_blocks.py
ImageSource
¶
InformationalSystemMessage
¶
Bases: BaseSystemMessage
Informational text from the CLI (notices, suggestions, warnings).
Source code in src/clawd_code_sdk/models/system_messages.py
InitSystemMessage
¶
Bases: BaseSystemMessage
System init message with session metadata.
Source code in src/clawd_code_sdk/models/system_messages.py
additional_directories
class-attribute
instance-attribute
¶
Extra working directories added to the session (undocumented).
fast_mode_state
class-attribute
instance-attribute
¶
Whether fast mode was enabled.
memory_paths
class-attribute
instance-attribute
¶
Auto-memory directories by kind (undocumented).
messaging_socket_path
class-attribute
instance-attribute
¶
Path of the CLI's local messaging socket (undocumented).
original_cwd
class-attribute
instance-attribute
¶
The cwd the session was started in (undocumented).
served_by_anthropic
class-attribute
instance-attribute
¶
Whether requests are served by Anthropic directly (undocumented).
startup_timing
class-attribute
instance-attribute
¶
Startup timing diagnostics (undocumented, nested phase timings).
user_message_uuids
class-attribute
instance-attribute
¶
Client uuids of the user messages the turn takes in (undocumented, CLI 2.1.330+).
InstructionsLoadedHookInput
¶
Bases: BaseHookInput
Input data for InstructionsLoaded hook events.
Source code in src/clawd_code_sdk/models/hooks.py
JSONRPCError
¶
JSONRPCErrorResponse
¶
Bases: TypedDict
A response to a request that indicates an error occurred.
Source code in src/clawd_code_sdk/models/mcp.py
JSONRPCNotification
¶
Bases: TypedDict
A JSON-RPC notification which does not expect a response.
Source code in src/clawd_code_sdk/models/mcp.py
JSONRPCRequest
¶
JSONRPCResultResponse
¶
KillShellInput
¶
Bases: TypedDict
Input for the KillBash tool. Kills a running background bash shell.
Source code in src/clawd_code_sdk/models/input_types.py
KillShellOutput
¶
Bases: TypedDict
tool_use_result for the KillBash tool.
Not part of the official SDK ToolOutputSchemas as of SDK v0.2.62. Shape derived from: https://github.com/kzahel/yepanywhere/blob/main/packages/shared/src/claude-sdk-schema/tool/ToolResultSchemas.ts
Source code in src/clawd_code_sdk/models/output_types.py
ListMcpResourcesInput
¶
Bases: TypedDict
Input for the ListMcpResources tool. Lists available MCP resources.
Source code in src/clawd_code_sdk/models/input_types.py
LocalCommandOutputMessage
¶
Bases: BaseSystemMessage
Output from a local slash command (e.g. /voice, /cost).
Displayed as assistant-style text in the transcript.
Source code in src/clawd_code_sdk/models/system_messages.py
McpAuthenticateResponse
¶
Bases: ClaudeCodeBaseModel
Response from authenticating with an MCP server.
Source code in src/clawd_code_sdk/models/control.py
McpClaudeAIProxyServerConfig
dataclass
¶
MCP Claude AI proxy server configuration.
Source code in src/clawd_code_sdk/models/mcp.py
McpHttpServerConfig
dataclass
¶
Bases: BaseMcpServerConfig
MCP HTTP server configuration.
Source code in src/clawd_code_sdk/models/mcp.py
McpResourceContents
¶
Bases: BaseModel
A single resource content entry.
Source code in src/clawd_code_sdk/models/control.py
McpResourceEntry
¶
Bases: TypedDict
A single MCP resource entry.
Source code in src/clawd_code_sdk/models/output_types.py
McpSSEServerConfig
dataclass
¶
Bases: BaseMcpServerConfig
MCP SSE server configuration.
Source code in src/clawd_code_sdk/models/mcp.py
McpSdkServerConfig
dataclass
¶
SDK MCP server configuration (serializable, no instance).
Source code in src/clawd_code_sdk/models/mcp.py
timeout
class-attribute
instance-attribute
¶
Per-request timeout for this server in milliseconds.
McpSdkServerConfigWithInstance
dataclass
¶
Bases: McpSdkServerConfig
SDK MCP server config with a live McpServer instance. Not serializable.
Source code in src/clawd_code_sdk/models/mcp.py
McpServerProvenance
¶
McpServerStatus
¶
McpServerStatusEntry
¶
Bases: ClaudeCodeBaseModel
Status information for a single MCP server.
Source code in src/clawd_code_sdk/models/mcp.py
McpServerVersionInfo
¶
McpSetServersResult
¶
Bases: ClaudeCodeBaseModel
Result of a setMcpServers operation.
Source code in src/clawd_code_sdk/models/mcp.py
McpStatusResponse
¶
Bases: ClaudeCodeBaseModel
Response from get_mcp_status() containing all MCP server statuses.
Source code in src/clawd_code_sdk/models/mcp.py
McpStdioServerConfig
dataclass
¶
Bases: BaseMcpServerConfig
MCP stdio server configuration.
Source code in src/clawd_code_sdk/models/mcp.py
McpToolStatus
¶
Bases: ClaudeCodeBaseModel
Status information for a single MCP tool.
Source code in src/clawd_code_sdk/models/mcp.py
MemoryRecallSystemMessage
¶
Bases: BaseSystemMessage
Emitted when the memory recall supervisor surfaces relevant memories into the turn.
Mirrors the CLI relevant_memories attachment so SDK renderers can show "Recalled from memory" inline.
Source code in src/clawd_code_sdk/models/system_messages.py
MessageDisplayHookInput
¶
Bases: BaseHookInput
Input data for MessageDisplay hook events (assistant text being displayed).
Source code in src/clawd_code_sdk/models/hooks.py
MessageDisplayHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for MessageDisplay events.
Source code in src/clawd_code_sdk/models/hooks.py
displayContent
instance-attribute
¶
Replacement text to display instead of the delta.
MessageParam
¶
Bases: ClaudeCodeBaseModel
User message payload wrapping content blocks.
Only used for user-role messages; assistant messages use
:class:AssistantMessageContent.
Source code in src/clawd_code_sdk/models/content_blocks.py
MirrorErrorSystemMessage
¶
Bases: BaseSystemMessage
Emitted when SessionStore.append() rejects or times out for a transcript-mirror batch.
The batch is dropped (at-most-once delivery); this surfaces the failure so consumers are not silent on data loss.
Source code in src/clawd_code_sdk/models/system_messages.py
ModelRefusalFallbackMessage
¶
Bases: BaseSystemMessage
Emitted when a model refusal triggered a switch to a fallback model.
Source code in src/clawd_code_sdk/models/system_messages.py
ModelRefusalNoFallbackMessage
¶
Bases: BaseSystemMessage
Emitted when the model refused and no fallback model is available.
Source code in src/clawd_code_sdk/models/system_messages.py
ModelScopedUsageWindow
¶
Bases: UsageWindow
Per-model weekly window.
Source code in src/clawd_code_sdk/models/context_usage.py
ModelUsage
¶
Bases: ClaudeCodeBaseModel
Cumulative token usage per model, accumulated across the entire session.
Source code in src/clawd_code_sdk/models/usage.py
Network
¶
Bases: ClaudeCodeBaseModel
Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.
Source code in src/clawd_code_sdk/models/settings.py
allow_all_unix_sockets
class-attribute
instance-attribute
¶
Allow all Unix domain socket connections. If true, this overrides allowUnixSockets. See https://code.claude.com/docs/en/sandboxing#network-isolation
allow_local_binding
class-attribute
instance-attribute
¶
Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified. See https://code.claude.com/docs/en/sandboxing#network-isolation
allow_mach_lookup
class-attribute
instance-attribute
¶
allow_mach_lookup: list[AllowMachLookupItem] | None = Field(
None, alias="allowMachLookup", examples=[["com.apple.coresimulator.*"]]
)
macOS only. Additional XPC/Mach service names the sandbox may look up. Supports a single trailing * for prefix matching. Needed for tools that communicate via XPC such as the iOS Simulator or Playwright. See https://code.claude.com/docs/en/sandboxing#network-isolation
allow_managed_domains_only
class-attribute
instance-attribute
¶
(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts. See https://code.claude.com/docs/en/sandboxing#network-isolation
allow_unix_sockets
class-attribute
instance-attribute
¶
Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified. See https://code.claude.com/docs/en/sandboxing#network-isolation
allowed_domains
class-attribute
instance-attribute
¶
Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com. See https://code.claude.com/docs/en/sandboxing#network-isolation
denied_domains
class-attribute
instance-attribute
¶
Blocklist of network domains for sandboxed commands. Blocks specific domains even when a broader allowedDomains wildcard would otherwise permit them. Supports wildcard patterns like *.example.com. See https://code.claude.com/docs/en/sandboxing#network-isolation
http_proxy_port
class-attribute
instance-attribute
¶
HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically. See https://code.claude.com/docs/en/sandboxing#custom-proxy-configuration
socks_proxy_port
class-attribute
instance-attribute
¶
SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically. See https://code.claude.com/docs/en/sandboxing#custom-proxy-configuration
strict_allowlist
class-attribute
instance-attribute
¶
UNDOCUMENTED. Deny non-allowlisted hosts for sandboxed commands without prompting (added v2.1.219). See https://code.claude.com/docs/en/sandboxing#network-isolation
tls_terminate
class-attribute
instance-attribute
¶
tls_terminate: TlsTerminate | None = Field(None, alias='tlsTerminate')
Experimental. Terminate TLS inside the sandbox proxy so it can read the contents of HTTPS requests. Required for mask credential substitution. Set {} to generate an ephemeral certificate authority for the session, or set caCertPath and caKeyPath to use your own. Only honored from user, managed, or CLI --settings settings, not from .claude/settings.json or .claude/settings.local.json. Requires Claude Code v2.1.199 or later. See https://code.claude.com/docs/en/sandboxing#protect-credentials
NewSession
dataclass
¶
Bases: BaseSessionConfig
Start a fresh session.
Source code in src/clawd_code_sdk/models/options.py
NotebookEditInput
¶
Bases: TypedDict
Input for the NotebookEdit tool. Edits cells in Jupyter notebook files.
Source code in src/clawd_code_sdk/models/input_types.py
NotebookEditOutput
¶
Bases: TypedDict
tool_use_result for the NotebookEdit tool.
Source code in src/clawd_code_sdk/models/output_types.py
NotificationHookInput
¶
Bases: BaseHookInput
Input data for Notification hook events.
Source code in src/clawd_code_sdk/models/hooks.py
NotificationHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for Notification events.
Source code in src/clawd_code_sdk/models/hooks.py
NotificationSystemMessage
¶
Bases: BaseSystemMessage
Loop-side text notification.
Mirrors the interactive REPL notification queue (key/priority/timeout). JSX notifications are not emitted on this channel.
Source code in src/clawd_code_sdk/models/system_messages.py
PermissionDeniedHookInput
¶
Bases: BaseHookInput
Input data for PermissionDenied hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PermissionDeniedHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PermissionDenied events.
Source code in src/clawd_code_sdk/models/hooks.py
PermissionDeniedSystemMessage
¶
Bases: BaseSystemMessage
Emitted when a tool call was denied by the permission system.
Source code in src/clawd_code_sdk/models/system_messages.py
PermissionRequestHookInput
¶
Bases: BaseHookInput
Input data for PermissionRequest hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PermissionRequestHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PermissionRequest events.
Source code in src/clawd_code_sdk/models/hooks.py
PermissionResultAllow
¶
Bases: ClaudeCodeBaseModel
Allow permission result.
Source code in src/clawd_code_sdk/models/permissions.py
PermissionResultDeny
¶
Bases: ClaudeCodeBaseModel
Deny permission result.
Source code in src/clawd_code_sdk/models/permissions.py
PermissionRuleValue
¶
Permissions
¶
Bases: ClaudeCodeBaseModel
Tool usage permissions configuration. See https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings See https://code.claude.com/docs/en/tools-reference for full list of tools available to Claude.
Source code in src/clawd_code_sdk/models/settings.py
3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 | |
additional_directories
class-attribute
instance-attribute
¶
additional_directories: list[AdditionalDirectory] | None = Field(
None, alias="additionalDirectories", examples=[["//Users/alice/Documents", "~/projects"]]
)
Additional directories to include in the permission scope
allow
class-attribute
instance-attribute
¶
allow: list[PermissionRule] | None = None
List of permission rules for allowed operations
ask
class-attribute
instance-attribute
¶
ask: list[PermissionRule] | None = None
List of permission rules that should always prompt for confirmation
block_writes_outside_working_directories
class-attribute
instance-attribute
¶
block_writes_outside_working_directories: bool | None = Field(
None, alias="blockWritesOutsideWorkingDirectories"
)
When true, the Write, Edit, and NotebookEdit tools refuse paths outside the working directories in every permission mode, including bypassPermissions, apart from some of Claude Code's own files. Does not limit shell commands, MCP tools, or the programs hooks run; use sandboxing for those. A true in any settings file applies; false is the same as unset. Requires Claude Code v2.1.314 or later. See https://code.claude.com/docs/en/settings-reference#permissions-blockwritesoutsideworkingdirectories
default_mode
class-attribute
instance-attribute
¶
default_mode: (
Literal[
"acceptEdits",
"bypassPermissions",
"default",
"delegate",
"dontAsk",
"plan",
"auto",
"manual",
]
| None
) = Field(None, alias="defaultMode")
Default permission mode. "default": prompts on first use. UNDOCUMENTED. "manual": accepted alias for "default" (the CLI/VS Code/JetBrains UI now labels this mode "Manual" as of v2.1.200; permission-modes.md has not yet been updated to mention it). "acceptEdits": auto-accepts file edits. "plan": read-only, no modifications. UNDOCUMENTED. "delegate": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS). "dontAsk": auto-denies unless pre-approved via permissions. "bypassPermissions": skips all prompts (use only in isolated environments). "auto": auto-approves tool calls with background safety checks that verify actions align with your request. See https://code.claude.com/docs/en/permissions
deny
class-attribute
instance-attribute
¶
deny: list[PermissionRule] | None = None
List of permission rules for denied operations
disable_auto_mode
class-attribute
instance-attribute
¶
Set to "disable" to prevent auto mode from being activated. Removes auto from the Shift+Tab cycle and rejects --permission-mode auto at startup. Most useful in managed settings where users cannot override it. See https://code.claude.com/docs/en/permissions
disable_bypass_permissions_mode
class-attribute
instance-attribute
¶
disable_bypass_permissions_mode: Literal["disable"] | None = Field(
None, alias="disableBypassPermissionsMode"
)
Disable the ability to bypass permission prompts
PlainTextSource
¶
PluginInstallSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when a plugin is installed.
Source code in src/clawd_code_sdk/models/system_messages.py
PostCompactHookInput
¶
Bases: BaseHookInput
Input data for PostCompact hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PostModelSwitchHookInput
¶
Bases: BaseHookInput
Input data for PostModelSwitch hook events (after the session model changed).
Source code in src/clawd_code_sdk/models/hooks.py
PostModelSwitchHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PostModelSwitch events.
Source code in src/clawd_code_sdk/models/hooks.py
PostToolUseFailureHookInput
¶
Bases: BaseHookInput
Input data for PostToolUseFailure hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PostToolUseFailureHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PostToolUseFailure events.
Source code in src/clawd_code_sdk/models/hooks.py
PostToolUseHookInput
¶
Bases: BaseHookInput
Input data for PostToolUse hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PostToolUseHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PostToolUse events.
Source code in src/clawd_code_sdk/models/hooks.py
updatedToolOutput
instance-attribute
¶
Replace the tool output the model sees (any tool).
PreCompactHookInput
¶
Bases: BaseHookInput
Input data for PreCompact hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PreModelSwitchHookInput
¶
Bases: BaseHookInput
Input data for PreModelSwitch hook events (before the session model changes).
Source code in src/clawd_code_sdk/models/hooks.py
PreModelSwitchHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PreModelSwitch events.
Source code in src/clawd_code_sdk/models/hooks.py
PreSkillShellCommandHookInput
¶
Bases: BaseHookInput
Input data for PreSkillShellCommand hook events.
Fires for each inline shell command of a skill or slash command as it loads.
Source code in src/clawd_code_sdk/models/hooks.py
command_name
instance-attribute
¶
The skill or command whose text holds the shell command.
invoked_by
instance-attribute
¶
Who started the load (user: typed or sent by an SDK host, claude: the Skill tool).
tool_name
instance-attribute
¶
The shell tool that runs the command: Bash or PowerShell.
tool_use_id
instance-attribute
¶
Identifies this command. It names no tool call in the transcript.
PreSkillShellCommandHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PreSkillShellCommand events (refuse or rewrite the command).
Source code in src/clawd_code_sdk/models/hooks.py
PreSkillShellCommandToolInput
¶
Bases: TypedDict
Tool input of a PreSkillShellCommand hook.
Source code in src/clawd_code_sdk/models/hooks.py
PreToolUseHookInput
¶
Bases: BaseHookInput
Input data for PreToolUse hook events.
Source code in src/clawd_code_sdk/models/hooks.py
PreToolUseHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for PreToolUse events.
Source code in src/clawd_code_sdk/models/hooks.py
PromptHookHandler
¶
Bases: TypedDict
LLM prompt hook handler.
See https://code.claude.com/docs/en/hooks#prompt-and-agent-hook-fields
Source code in src/clawd_code_sdk/models/hooks.py
PromptRequest
¶
Bases: TypedDict
Prompt request sent to the SDK consumer.
Source code in src/clawd_code_sdk/models/prompt_requests.py
options
instance-attribute
¶
options: list[PromptRequestOption]
Available options for the user to choose from.
prompt
instance-attribute
¶
Request ID. Presence of this key marks the line as a prompt request.
PromptRequestOption
¶
Bases: TypedDict
An option in a prompt request.
Source code in src/clawd_code_sdk/models/prompt_requests.py
PromptResponse
¶
Bases: TypedDict
Response to a prompt request.
Source code in src/clawd_code_sdk/models/prompt_requests.py
PromptSuggestionMessage
¶
Bases: BaseMessage
Predicted next user prompt, emitted after each turn when promptSuggestions is enabled.
Source code in src/clawd_code_sdk/models/messages.py
RateLimitInfo
¶
Bases: ClaudeCodeBaseModel
Rate limit information.
Source code in src/clawd_code_sdk/models/messages.py
unified_windows
class-attribute
instance-attribute
¶
Per-window utilization/status (e.g. five_hour, seven_day); undocumented.
RateLimitMessage
¶
ReadFileInfo
¶
Bases: TypedDict
Nested file info inside a Read tool result (text mode).
Source code in src/clawd_code_sdk/models/output_types.py
truncatedByTokenCap
instance-attribute
¶
True when a whole-file read was auto-paginated because it exceeded the token cap.
ReadImageDimensions
¶
Bases: TypedDict
Image dimension info for coordinate mapping.
Source code in src/clawd_code_sdk/models/output_types.py
ReadImageFileInfo
¶
Bases: TypedDict
Nested file info for image reads.
Source code in src/clawd_code_sdk/models/output_types.py
ReadImageOutput
¶
ReadMcpResourceContentItem
¶
Bases: TypedDict
A single content item from an MCP resource.
Source code in src/clawd_code_sdk/models/output_types.py
ReadMcpResourceInput
¶
Bases: TypedDict
Input for the ReadMcpResource tool. Reads a specific MCP resource from a server.
Source code in src/clawd_code_sdk/models/input_types.py
ReadMcpResourceOutput
¶
Bases: TypedDict
tool_use_result for the ReadMcpResource tool.
Source code in src/clawd_code_sdk/models/output_types.py
error
instance-attribute
¶
Error message when the resource could not be read.
ReadNotebookFileInfo
¶
ReadNotebookOutput
¶
Bases: TypedDict
tool_use_result for the Read tool (Jupyter notebooks).
Source code in src/clawd_code_sdk/models/output_types.py
ReadPartsFileInfo
¶
Bases: TypedDict
Nested file info for PDF parts (extracted page images).
Source code in src/clawd_code_sdk/models/output_types.py
ReadPartsOutput
¶
Bases: TypedDict
tool_use_result for the Read tool (PDF parts extraction).
Source code in src/clawd_code_sdk/models/output_types.py
firstPage
instance-attribute
¶
First page number included as page images in the model-facing tool_result.
pages
instance-attribute
¶
pages: NotRequired[list[ReadPartsPage]]
Page images (only present transiently in-process, absent on emitted results).
ReadPdfFileInfo
¶
Bases: TypedDict
Nested file info for PDF reads.
Source code in src/clawd_code_sdk/models/output_types.py
ReadPdfOutput
¶
ReadTextOutput
¶
Bases: TypedDict
tool_use_result for the Read tool (text files).
Source code in src/clawd_code_sdk/models/output_types.py
artifactRead
instance-attribute
¶
artifactRead: NotRequired[ArtifactReadMarker]
Set when the read file is an artifact that now counts as viewed.
ReloadPluginsCacheImpact
¶
Bases: BaseModel
How a reload would change the session's tool list.
Source code in src/clawd_code_sdk/models/control.py
RemoteControlResponse
¶
Bases: BaseModel
Response from enabling remote control.
Contains the URLs and identifiers needed for remote clients to connect to the session.
Source code in src/clawd_code_sdk/models/control.py
ResultErrorMessage
¶
ResultSuccessMessage
¶
Bases: BaseResultMessage
Successful result message.
Source code in src/clawd_code_sdk/models/messages.py
first_request_cache_read_input_tokens
class-attribute
instance-attribute
¶
The cache-read part of first_request_input_tokens (internal, CLI 2.1.330+).
first_request_input_tokens
class-attribute
instance-attribute
¶
Input tokens (cache reads and writes included) of the model call sent at
request_sent_wall_ms; only with it, and only when above zero (internal, CLI 2.1.330+).
local_command
class-attribute
instance-attribute
¶
Set when the turn was a local slash command (no model call).
ResumeSession
dataclass
¶
Bases: BaseSessionConfig
Resume an existing session by ID.
Source code in src/clawd_code_sdk/models/options.py
at_message
class-attribute
instance-attribute
¶
Resume from a specific message UUID within the session.
drops_turn
class-attribute
instance-attribute
¶
Guard for truncating resume (--resume-drops-turn).
Declares the user message UUID of the turn that at_message is expected to
drop. The CLI refuses the resume if the truncation would discard anything else.
Only meaningful together with at_message.
fork
class-attribute
instance-attribute
¶
If True, fork to a new session ID instead of continuing in-place.
SDKContextUsage
¶
Bases: ClaudeCodeBaseModel
Compact context usage snapshot, attached to assistant messages.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKControlApplyFlagSettingsRequest
¶
Bases: _ControlBase
SDK control apply flag settings request.
Source code in src/clawd_code_sdk/models/control.py
SDKControlBackgroundTasksRequest
¶
Bases: _ControlBase
Moves running foreground tasks (or one tool use) to the background.
Source code in src/clawd_code_sdk/models/control.py
SDKControlCancelAsyncMessageRequest
¶
Bases: _ControlBase
Drops a pending async user message from the command queue by uuid.
Source code in src/clawd_code_sdk/models/control.py
SDKControlChannelEnableRequest
¶
Bases: _ControlBase
Enables MCP channel notifications for a marketplace plugin server.
Source code in src/clawd_code_sdk/models/control.py
SDKControlClaudeOAuthWaitForCompletionRequest
¶
Bases: _ControlBase
Waits for an in-progress Claude OAuth flow to complete.
Unlike claude_oauth_callback, this does not provide an authorization
code — it simply waits for the existing OAuth flow (started by
claude_authenticate) to finish. The response contains the
authenticated account details.
Source code in src/clawd_code_sdk/models/control.py
SDKControlElicitationRequest
¶
Bases: _ControlBase
Requests the SDK consumer to handle an MCP elicitation (user input request).
Source code in src/clawd_code_sdk/models/control.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | |
description
class-attribute
instance-attribute
¶
Permission-display description from _meta['anthropic/permissionDisplay'].description.
display_name
class-attribute
instance-attribute
¶
Short tool/server label from _meta['anthropic/permissionDisplay'].displayName.
elicitation_id
class-attribute
instance-attribute
¶
Elicitation ID for correlating URL elicitations with completion notifications.
mcp_server_name
instance-attribute
¶
Name of the MCP server requesting elicitation.
mode
class-attribute
instance-attribute
¶
Elicitation mode: 'form' for structured input, 'url' for browser-based auth.
requested_schema
class-attribute
instance-attribute
¶
JSON Schema for the requested input (only for 'form' mode).
title
class-attribute
instance-attribute
¶
Permission-display title from the MCP server's _meta['anthropic/permissionDisplay'].
Mirrors can_use_tool.title so SDK consumers can render elicitation-driven permission prompts
with structured headers instead of parsing message.
from_mcp
classmethod
¶
from_mcp(params: ElicitRequestParams, mcp_server_name: str) -> SDKControlElicitationRequest
Create from MCP elicitation request params (mcp 1.x or 2.x).
Source code in src/clawd_code_sdk/models/control.py
to_mcp
¶
Convert to the corresponding MCP elicitation request params.
Built from the wire format (camelCase keys, _meta), which both
mcp 1.x and 2.x accept, so this works on either major.
Source code in src/clawd_code_sdk/models/control.py
SDKControlEndSessionRequest
¶
SDKControlFileSuggestionsRequest
¶
Bases: _ControlBase
Requests at-mention file autocomplete suggestions for a partial path prefix.
Returns the same fuzzy-matched results the TUI shows.
Source code in src/clawd_code_sdk/models/control.py
SDKControlGenerateSessionTitleRequest
¶
Bases: _ControlBase
Generates a title for a session from a description of it.
Source code in src/clawd_code_sdk/models/control.py
description
instance-attribute
¶
Text to title, e.g. the conversation's latest user and assistant text.
persist
class-attribute
instance-attribute
¶
Store the title as the current session's title. A session that has one already (the CLI titles new sessions itself) returns it instead of generating another.
SDKControlGetBinaryVersionRequest
¶
Bases: _ControlBase
Requests the version of the running Claude Code binary.
Source code in src/clawd_code_sdk/models/control.py
SDKControlGetContextUsageRequest
¶
Bases: _ControlBase
Requests a breakdown of current context window usage by category.
Source code in src/clawd_code_sdk/models/control.py
SDKControlGetContextUsageResponse
¶
Bases: ClaudeCodeBaseModel
Breakdown of current context window usage by category.
Source code in src/clawd_code_sdk/models/context_usage.py
autocompact_source
class-attribute
instance-attribute
¶
Where the auto-compact threshold came from, e.g. "model-default" (undocumented).
SDKControlGetHooksListingRequest
¶
Bases: _ControlBase
Requests the listing of configured hooks (same data as /hooks).
Source code in src/clawd_code_sdk/models/control.py
SDKControlGetSettingsRequest
¶
Bases: _ControlBase
Returns the effective merged settings and the raw per-source settings.
Source code in src/clawd_code_sdk/models/control.py
SDKControlGetTaskOutputRequest
¶
Bases: _ControlBase
Reads the output collected so far for a background task.
Source code in src/clawd_code_sdk/models/control.py
SDKControlGetTaskOutputResponse
¶
SDKControlGetUsageRequest
¶
Bases: _ControlBase
Requests the structured usage report (session cost + rate limits). Experimental.
Source code in src/clawd_code_sdk/models/control.py
SDKControlGetUsageResponse
¶
Bases: ClaudeCodeBaseModel
Structured /usage data: session totals and plan rate-limit windows. Experimental.
Source code in src/clawd_code_sdk/models/control.py
behaviors
class-attribute
instance-attribute
¶
What contributes to usage, from a scan of local transcripts (None if skipped).
rate_limits_available
instance-attribute
¶
False when plan limits do not apply (API key, Bedrock, Vertex, ...).
session
instance-attribute
¶
session: UsageReportSession
Cost and usage accumulated by the current session.
subscription_type
instance-attribute
¶
claude.ai plan (e.g. "pro", "max"), None without a subscription.
SDKControlInitializeRequest
¶
Bases: _ControlBase
SDK control initialize request.
Source code in src/clawd_code_sdk/models/control.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
exclude_dynamic_sections
class-attribute
instance-attribute
¶
exclude_dynamic_sections: bool | None = Field(
default=None, serialization_alias="excludeDynamicSections"
)
When true, omit per-user dynamic sections from the cached system prompt.
Omits info like working directory, auto-memory path and re-inject them as the first usermessage. Lets cross-user prompt caching hit on a static system prompt prefix. Tradeoff: the model sees this context slightly later in the prompt, so steering on the working directory and memory location is marginally less authoritative. Has no effect when a custom (non-preset) system prompt is in use.
mcp_servers
class-attribute
instance-attribute
¶
mcp_servers: dict[str, dict[str, Any]] | None = Field(
default=None, serialization_alias="mcpServers"
)
Servers for Claude Code to run or connect to, as one --mcp-config item would hold
them; read only at launch under --await-initialize (mcp_servers_applied).
plan_mode_instructions
class-attribute
instance-attribute
¶
plan_mode_instructions: str | None = Field(default=None, serialization_alias="planModeInstructions")
Custom workflow body for the plan-mode system reminder.
plugins
class-attribute
instance-attribute
¶
Plugins to load at launch (plugin_delivery="initialize", --await-initialize).
sdk_mcp_server_configs
class-attribute
instance-attribute
¶
sdk_mcp_server_configs: dict[str, dict[str, Any]] | None = Field(
default=None, serialization_alias="sdkMcpServerConfigs"
)
Settings of the in-process servers in sdk_mcp_servers, by name: timeout (ms per
tool call, when first registered) and tools (per-tool permission policy).
sdk_mcp_server_manifests
class-attribute
instance-attribute
¶
sdk_mcp_server_manifests: dict[str, SdkMcpServerManifest] | None = Field(
default=None, serialization_alias="sdkMcpServerManifests"
)
The in-process servers' handshake results, captured by the host (a one-shot cache
for the connect that follows; sdk_mcp_manifests_parked reports each entry).
sdk_mcp_server_manifests_origin
class-attribute
instance-attribute
¶
sdk_mcp_server_manifests_origin: Literal["host_per_send"] | None = Field(
default=None, serialization_alias="sdkMcpServerManifestsOrigin"
)
That the manifests were captured for this send (only needed over a remote session transport; the CLI's own stdio transport needs no marker).
skills
class-attribute
instance-attribute
¶
When provided, only given skills are loaded into the main session system prompt.
Uses the same rules as AgentDefinition.skills: exact name, plugin-qualified name, or ":name" suffix. Omit to load every discovered skill. Applies to the main session only; subagents use AgentDefinition.skills.
title
class-attribute
instance-attribute
¶
Custom session title.
When provided, the session uses this title and skips automatic title generation. Has no effect on the persisted title when resuming an existing session.
SDKControlInterruptRequest
¶
Bases: _ControlBase
SDK control interrupt request.
Source code in src/clawd_code_sdk/models/control.py
cancel_queued
class-attribute
instance-attribute
¶
Also cancel queued (not yet started) user messages.
SDKControlInterruptResponse
¶
Bases: BaseModel
Response to an interrupt request.
Source code in src/clawd_code_sdk/models/control.py
SDKControlListModelsRequest
¶
SDKControlListPermissionRulesRequest
¶
SDKControlMcpAuthenticateRequest
¶
SDKControlMcpCallRequest
¶
Bases: _ControlBase
Invokes an MCP tool via the subprocess MCP client without a model turn.
No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpClearAuthRequest
¶
Bases: _ControlBase
Clears authentication for an MCP server.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpMessageRequest
¶
Bases: _ControlBase
SDK control MCP message request.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpOAuthCallbackUrlRequest
¶
Bases: _ControlBase
Provides an OAuth redirect callback URL to complete an MCP server OAuth flow.
Sent by the SDK to the CLI with the full redirect URL (containing the authorization code) after the user completes browser-based OAuth.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpReadResourceRequest
¶
Bases: _ControlBase
Reads a resource from a connected MCP server.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpReadResourceResponse
¶
SDKControlMcpReconnectRequest
¶
Bases: _ControlBase
Reconnects a disconnected or failed MCP server.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpSetServersRequest
¶
Bases: _ControlBase
Replaces the set of dynamically managed MCP servers.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpStatusRequest
¶
Bases: _ControlBase
Requests the current status of all MCP server connections.
Source code in src/clawd_code_sdk/models/control.py
SDKControlMcpToggleRequest
¶
Bases: _ControlBase
Enables or disables an MCP server.
Source code in src/clawd_code_sdk/models/control.py
SDKControlPermissionRequest
¶
Bases: _ControlBase
SDK control permission request.
Source code in src/clawd_code_sdk/models/control.py
classifier_approvable
class-attribute
instance-attribute
¶
Set when a safetyCheck is present anywhere in the decision reason (including nested inside subcommandResults for compound bash). false = at least one safety check requires manual approval (e.g. Windows path bypass, dangerous rm); true = all safety checks MAY be classifier-approved (e.g. sensitive-file paths). Absent when no safetyCheck is involved.
decision_reason_type
class-attribute
instance-attribute
¶
Structured discriminator for why auto-mode escalated.
Lets SDK hosts make policy (e.g. auto-deny safetyCheck) without parsing decision_reason text. For compound bash commands this is "subcommandResults" even when a safetyCheck is nested inside — check classifier_approvable for that case.
SDKControlReadFileRequest
¶
Bases: _ControlBase
Read a file from the session filesystem for the remote sidebar viewer.
Path is resolved against cwd and gated by the same read-permission rules as the Read tool.
Source code in src/clawd_code_sdk/models/control.py
SDKControlReadFileResponse
¶
Bases: _ControlBase
File contents for the remote sidebar viewer.
Source code in src/clawd_code_sdk/models/control.py
lossy
class-attribute
instance-attribute
¶
True when non-UTF-8 bytes were replaced while decoding.
SDKControlRegisterRepoRootRequest
¶
Bases: _ControlBase
Registers an additional repository root (like /add-dir).
Source code in src/clawd_code_sdk/models/control.py
SDKControlReloadOutputStylesRequest
¶
SDKControlReloadOutputStylesResponse
¶
SDKControlReloadSkillsRequest
¶
SDKControlReloadSkillsResponse
¶
SDKControlRemoteControlRequest
¶
Bases: _ControlBase
Toggles the remote control REPL bridge for external session access.
When enabled, starts a bridge that allows remote clients to send prompts,
permission responses, interrupts, and model changes into the session.
The response includes session_url, connect_url, and
environment_id when enabling.
Source code in src/clawd_code_sdk/models/control.py
SDKControlRequest
¶
SDKControlResponse
¶
SDKControlRewindFilesRequest
¶
Bases: _ControlBase
SDK control rewind files request.
Source code in src/clawd_code_sdk/models/control.py
SDKControlSeedReadStateRequest
¶
Bases: _ControlBase
Seeds the readFileState cache with a path+mtime entry.
Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read.
Source code in src/clawd_code_sdk/models/control.py
SDKControlSetHasSubscribersRequest
¶
Bases: _ControlBase
Tells the CLI whether anyone is watching the session output.
Source code in src/clawd_code_sdk/models/control.py
SDKControlSetMaxThinkingTokensRequest
¶
Bases: _ControlBase
Sets the maximum number of thinking tokens for extended thinking.
Source code in src/clawd_code_sdk/models/control.py
SDKControlSetModelRequest
¶
Bases: _ControlBase
Sets the model to use for subsequent conversation turns.
Source code in src/clawd_code_sdk/models/control.py
SDKControlSetPermissionModeRequest
¶
Bases: _ControlBase
SDK control set permission mode request.
Source code in src/clawd_code_sdk/models/control.py
SDKControlSetPermissionModeResponse
¶
Bases: BaseModel
Response to a set_permission_mode request.
Source code in src/clawd_code_sdk/models/control.py
mode
class-attribute
instance-attribute
¶
The permission mode now in effect, which can differ from the one asked for.
SDKControlSetProactiveRequest
¶
SDKControlSideQuestionRequest
¶
Bases: _ControlBase
Sends a side question to the model using the current conversation context.
This allows the SDK consumer to ask the model a question without adding it to the main conversation history. The CLI executes the question against the current context and returns the model's response.
Source code in src/clawd_code_sdk/models/control.py
SDKControlStopTaskRequest
¶
SDKControlUpdateSettingsRequest
¶
Bases: _ControlBase
Writes settings to the local or user settings file.
Source code in src/clawd_code_sdk/models/control.py
SDKDeferredToolUse
¶
Bases: TypedDict
A deferred tool use from a completed agent result.
Source code in src/clawd_code_sdk/models/output_types.py
SDKHookCallbackRequest
¶
Bases: _ControlBase
SDK hook callback request.
Source code in src/clawd_code_sdk/models/control.py
SDKPermissionDenial
¶
Bases: TypedDict
Permission denial from Claude API response.
Source code in src/clawd_code_sdk/models/messages.py
SDKSessionInfo
¶
Bases: BaseModel
Session metadata returned by list_sessions.
Source code in src/clawd_code_sdk/models/session.py
archived
class-attribute
instance-attribute
¶
Whether the session has been archived.
created_at
class-attribute
instance-attribute
¶
Creation time in milliseconds since epoch.
custom_title
class-attribute
instance-attribute
¶
User-set session title via /rename.
file_size
class-attribute
instance-attribute
¶
Session file size in bytes.
first_prompt
class-attribute
instance-attribute
¶
First meaningful user prompt in the session.
git_branch
class-attribute
instance-attribute
¶
Git branch at the end of the session.
last_modified
instance-attribute
¶
Last modified time in milliseconds since epoch.
summary
instance-attribute
¶
Display title for the session: custom title, auto-generated summary, or first prompt.
SDKUsageReport
¶
Bases: ClaudeCodeBaseModel
Session usage report (same data as /usage).
Source code in src/clawd_code_sdk/models/context_usage.py
Sandbox
¶
Bases: ClaudeCodeBaseModel
Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing.
Source code in src/clawd_code_sdk/models/settings.py
2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 | |
allow_apple_events
class-attribute
instance-attribute
¶
Allow sandboxed commands to send Apple Events on macOS (v2.1.181+). Honored only from user, managed, or CLI settings; project settings cannot enable it. See https://code.claude.com/docs/en/sandboxing#limitations
allow_unsandboxed_commands
class-attribute
instance-attribute
¶
Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true. See https://code.claude.com/docs/en/sandboxing#limitations
auto_allow_bash_if_sandboxed
class-attribute
instance-attribute
¶
Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed. See https://code.claude.com/docs/en/sandboxing#sandbox-modes
bwrap_path
class-attribute
instance-attribute
¶
(Managed setting only) Path to custom bubblewrap (bwrap) binary for Linux/WSL sandbox. Overrides default. See https://code.claude.com/docs/en/server-managed-settings
credentials
class-attribute
instance-attribute
¶
credentials: Credentials | None = None
Block sandboxed commands from reading credential files and secret environment variables (v2.1.187+). Entries merge across settings scopes. See https://code.claude.com/docs/en/sandboxing#protect-credentials
enable_weaker_nested_sandbox
class-attribute
instance-attribute
¶
Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable. Default: false (secure). See https://code.claude.com/docs/en/sandboxing#limitations
enable_weaker_network_isolation
class-attribute
instance-attribute
¶
macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/sandboxing
enabled
class-attribute
instance-attribute
¶
Enable sandboxed bash. See https://code.claude.com/docs/en/sandboxing#enable-sandboxing
enabled_platforms
class-attribute
instance-attribute
¶
enabled_platforms: list[Literal["macos", "linux", "wsl", "windows"]] | None = Field(
None, alias="enabledPlatforms"
)
Limit the entire sandbox configuration to the listed platforms. On platforms not in the list the sandbox config is inert: no sandbox, no auto-allow, no startup warning, and no failIfUnavailable exit. When omitted, all supported platforms are included. Only honored from managed (policy) settings.
excluded_commands
class-attribute
instance-attribute
¶
Commands that should never run in the sandbox (e.g., ["git", "docker"]). See https://code.claude.com/docs/en/sandboxing#configure-sandboxing
fail_if_unavailable
class-attribute
instance-attribute
¶
When true, make sandbox startup a hard failure if required sandbox dependencies are missing. Default: false (sandbox is skipped with a warning). See https://code.claude.com/docs/en/sandboxing#enable-sandboxing
filesystem
class-attribute
instance-attribute
¶
filesystem: Filesystem | None = None
Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation
ignore_violations
class-attribute
instance-attribute
¶
Map of command patterns to filesystem paths to ignore violations for. Use "*" to match all commands
network
class-attribute
instance-attribute
¶
network: Network | None = None
Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.
ripgrep
class-attribute
instance-attribute
¶
ripgrep: Ripgrep | None = None
Custom ripgrep configuration for Claude Code's bundled ripgrep support. Overrides the bundled binary and arguments.
socat_path
class-attribute
instance-attribute
¶
(Managed setting only) Path to custom socat binary for Linux/WSL network proxying. Overrides default. See https://code.claude.com/docs/en/server-managed-settings
SdkPluginConfig
¶
Bases: ClaudeCodeBaseModel
SDK plugin configuration.
Currently only local plugins are supported via the 'local' type.
Source code in src/clawd_code_sdk/models/mcp.py
skip_mcp_discovery
class-attribute
instance-attribute
¶
Load skills/hooks/agents/commands but not the plugin's MCP servers.
Use when the SDK host owns this plugin's MCP connections.
SessionEndHookInput
¶
SessionKey
¶
Bases: TypedDict
Identifies a session transcript or subagent transcript in the store.
Source code in src/clawd_code_sdk/models/system_messages.py
SessionMessage
¶
Bases: BaseModel
A message from a session transcript.
Returned by get_session_messages for reading historical session data.
Source code in src/clawd_code_sdk/models/session.py
parent_agent_id
class-attribute
instance-attribute
¶
For messages of nested subagents: agent id of the subagent that spawned this one.
parent_tool_use_id
class-attribute
instance-attribute
¶
For subagent messages: id of the Agent tool_use in the parent session that spawned
the subagent (from its .meta.json sidecar). None for top-level session messages.
SessionStartHookInput
¶
Bases: BaseHookInput
Input data for SessionStart hook events.
Source code in src/clawd_code_sdk/models/hooks.py
SessionStartHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for SessionStart events.
Source code in src/clawd_code_sdk/models/hooks.py
SessionStateChangedMessage
¶
Bases: BaseSystemMessage
System message emitted when session state changes.
'idle' fires after heldBackResult flushes and the bg-agent do-while exits — authoritative turn-over signal.
Source code in src/clawd_code_sdk/models/system_messages.py
SessionWritesLostMessage
¶
Bases: BaseSystemMessage
Emitted when writes were lost due to a full disk or exceeded quota.
Source code in src/clawd_code_sdk/models/system_messages.py
SettingsSource
¶
Bases: BaseModel
A single settings source with its raw settings.
Source code in src/clawd_code_sdk/models/control.py
SetupHookInput
¶
SideQuestionResponse
¶
Bases: ClaudeCodeBaseModel
Response from a side question.
Source code in src/clawd_code_sdk/models/control.py
response
class-attribute
instance-attribute
¶
The model's answer, or None if no context was available.
SkillInput
¶
Bases: TypedDict
Input for the Skill tool. Invokes a named skill (slash command).
Not part of the official SDK ToolInputSchemas as of SDK v0.2.62. Shape derived from empirical testing.
Source code in src/clawd_code_sdk/models/input_types.py
SkillOutput
¶
Bases: TypedDict
tool_use_result for the Skill tool.
Not part of the official SDK ToolOutputSchemas as of SDK v0.2.62. Shape derived from empirical testing.
Source code in src/clawd_code_sdk/models/output_types.py
StatusSystemMessage
¶
Bases: BaseSystemMessage
System status message.
Source code in src/clawd_code_sdk/models/system_messages.py
user_message_uuids
class-attribute
instance-attribute
¶
Client uuids of the user messages the turn takes in (undocumented, CLI 2.1.330+).
StopHookInput
¶
StopHookSpecificOutput
¶
StreamEvent
¶
Bases: BaseMessage
Stream event for partial message updates during streaming.
Source code in src/clawd_code_sdk/models/messages.py
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | |
api_message_id
class-attribute
instance-attribute
¶
ID of the API message this event belongs to (undocumented).
owed_rows
class-attribute
instance-attribute
¶
Uuids of transcript rows the turn wrote before its first model request that change what Claude holds of a claude.ai Project or an attached PDF (internal, CLI 2.1.330+).
thinking_display
class-attribute
instance-attribute
¶
Active thinking display mode (undocumented).
block_start_text
classmethod
¶
block_start_text(*, index: int, session_id: str, uuid: str) -> StreamEvent
Create a synthetic content_block_start StreamEvent for a text block.
Source code in src/clawd_code_sdk/models/messages.py
block_start_thinking
classmethod
¶
block_start_thinking(*, index: int, session_id: str, uuid: str) -> StreamEvent
Create a synthetic content_block_start StreamEvent for a thinking block.
Source code in src/clawd_code_sdk/models/messages.py
block_start_tool_use
classmethod
¶
block_start_tool_use(
*, tool_use_id: str, name: str, index: int, session_id: str, uuid: str
) -> StreamEvent
Create a synthetic content_block_start StreamEvent for a tool_use block.
Source code in src/clawd_code_sdk/models/messages.py
block_stop
classmethod
¶
block_stop(*, index: int, session_id: str, uuid: str) -> StreamEvent
Create a synthetic content_block_stop StreamEvent.
Source code in src/clawd_code_sdk/models/messages.py
block_text_delta
classmethod
¶
block_text_delta(*, text: str, index: int, session_id: str, uuid: str) -> StreamEvent
Create a synthetic content_block_delta StreamEvent with full block content.
Source code in src/clawd_code_sdk/models/messages.py
block_thinking_delta
classmethod
¶
block_thinking_delta(*, thinking: str, index: int, session_id: str, uuid: str) -> StreamEvent
Create a synthetic content_block_delta StreamEvent with full block content.
Source code in src/clawd_code_sdk/models/messages.py
block_tool_json_delta
classmethod
¶
block_tool_json_delta(*, partial_json: str, index: int, session_id: str, uuid: str) -> StreamEvent
Create a synthetic content_block_delta StreamEvent with full block content.
Source code in src/clawd_code_sdk/models/messages.py
message_delta
classmethod
¶
message_delta(*, stop_reason: BetaStopReason | None, session_id: str, uuid: str) -> StreamEvent
Create a synthetic message_delta StreamEvent.
Source code in src/clawd_code_sdk/models/messages.py
message_stop
classmethod
¶
message_stop(*, session_id: str, uuid: str) -> StreamEvent
Create a synthetic message_stop StreamEvent.
Source code in src/clawd_code_sdk/models/messages.py
StructuredPatchHunk
¶
Bases: TypedDict
A single hunk in a structured patch.
Source code in src/clawd_code_sdk/models/output_types.py
lines
instance-attribute
¶
Diff lines prefixed with ' ' (context), '+' (added), or '-' (removed).
SubagentStartHookInput
¶
Bases: BaseHookInput
Input data for SubagentStart hook events.
Source code in src/clawd_code_sdk/models/hooks.py
SubagentStartHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for SubagentStart events.
Source code in src/clawd_code_sdk/models/hooks.py
SubagentStopHookInput
¶
Bases: BaseHookInput
Input data for SubagentStop hook events.
Source code in src/clawd_code_sdk/models/hooks.py
SubagentStopHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for SubagentStop events.
Source code in src/clawd_code_sdk/models/hooks.py
SyncHookJSONOutput
¶
Bases: TypedDict
Synchronous hook output with control and decision fields.
This defines the structure for hook callbacks to control execution and provide feedback to Claude.
Common Control Fields
continue_: Whether Claude should proceed after hook execution (default: True). Note: This is converted to "continue" when sent to the CLI. suppressOutput: Hide stdout from transcript mode (default: False). stopReason: Message shown when continue is False.
Decision Fields
decision: Set to "block" to indicate blocking behavior. systemMessage: Warning message displayed to the user. reason: Feedback message for Claude about the decision.
Hook-Specific Output
hookSpecificOutput: Event-specific controls (e.g., permissionDecision for PreToolUse, additionalContext for PostToolUse).
Note: The CLI documentation shows field names without underscores ("async", "continue"), but Python code should use the underscore versions ("async_", "continue_") as they are automatically converted.
Source code in src/clawd_code_sdk/models/hooks.py
TaskCompletedHookInput
¶
Bases: BaseHookInput
Input data for TaskCompleted hook events.
Source code in src/clawd_code_sdk/models/hooks.py
TaskCreatedHookInput
¶
Bases: BaseHookInput
Input data for TaskCreated hook events.
Source code in src/clawd_code_sdk/models/hooks.py
TaskInfo
¶
Bases: TypedDict
Information about a background task.
Source code in src/clawd_code_sdk/models/output_types.py
TaskNotificationSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when a subagent task completes, fails, or stops.
Source code in src/clawd_code_sdk/models/system_messages.py
skip_transcript
class-attribute
instance-attribute
¶
Whether to skip this message in the transcript.
TaskOutputResult
¶
Bases: TypedDict
tool_use_result for the TaskOutput tool (background task polling).
Source code in src/clawd_code_sdk/models/output_types.py
retrieval_status
instance-attribute
¶
Status of the retrieval.
TaskProgressSystemMessage
¶
Bases: BaseSystemMessage
System message emitted periodically with task progress updates.
Source code in src/clawd_code_sdk/models/system_messages.py
summary
class-attribute
instance-attribute
¶
AI-generated progress summary when agentProgressSummaries is enabled.
TaskProgressUsage
¶
TaskStartedSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when a subagent task starts.
Source code in src/clawd_code_sdk/models/system_messages.py
TaskStopOutput
¶
TaskUpdatedSystemMessage
¶
Bases: BaseSystemMessage
System message emitted when a subagent task was updated.
Source code in src/clawd_code_sdk/models/system_messages.py
TeammateIdleHookInput
¶
Bases: BaseHookInput
Input data for TeammateIdle hook events.
Source code in src/clawd_code_sdk/models/hooks.py
TextBlock
¶
Bases: BaseContentBlock
Text content block.
Source code in src/clawd_code_sdk/models/content_blocks.py
ThinkingBlock
¶
Bases: BaseContentBlock
Thinking/reasoning content block.
Source code in src/clawd_code_sdk/models/content_blocks.py
ThinkingConfigAdaptive
¶
Bases: ClaudeCodeBaseModel
Adaptive thinking configuration - model decides thinking budget.
Source code in src/clawd_code_sdk/models/thinking.py
display
class-attribute
instance-attribute
¶
Controls how thinking content appears in the response.
When set to summarized, thinking is returned normally. When set to omitted,
thinking content is redacted but a signature is returned for multi-turn
continuity. Defaults to summarized.
ThinkingConfigDisabled
¶
Bases: ClaudeCodeBaseModel
Disabled thinking configuration.
Source code in src/clawd_code_sdk/models/thinking.py
ThinkingConfigEnabled
¶
Bases: ClaudeCodeBaseModel
Enabled thinking configuration with explicit token budget.
Source code in src/clawd_code_sdk/models/thinking.py
budget_tokens
instance-attribute
¶
Determines how many tokens Claude can use for its internal reasoning process.
Larger budgets can enable more thorough analysis for complex problems, improving
response quality.
Must be ≥1024 and less than max_tokens.
See
extended thinking
for details.
display
class-attribute
instance-attribute
¶
Controls how thinking content appears in the response.
When set to summarized, thinking is returned normally. When set to omitted,
thinking content is redacted but a signature is returned for multi-turn
continuity. Defaults to summarized.
ThinkingTokensMessage
¶
Bases: BaseSystemMessage
Running estimate of thinking tokens for the current turn.
Source code in src/clawd_code_sdk/models/system_messages.py
TodoItem
¶
Bases: TypedDict
A single todo item.
Source code in src/clawd_code_sdk/models/input_types.py
TodoWriteInput
¶
Bases: TypedDict
Input for the TodoWrite tool. Creates and manages a structured task list.
Source code in src/clawd_code_sdk/models/input_types.py
TodoWriteOutput
¶
ToolConfig
dataclass
¶
ToolPermissionContext
dataclass
¶
Context information for tool permission callbacks.
Source code in src/clawd_code_sdk/models/permissions.py
agent_id
class-attribute
instance-attribute
¶
The agent that initiated the tool call, if in a multi-agent setup.
blocked_path
class-attribute
instance-attribute
¶
The file path that triggered the permission request, if applicable.
For example, when a Bash command tries to access a path outside allowed directories.
decision_reason
class-attribute
instance-attribute
¶
Why the CLI triggered the permission check.
description
class-attribute
instance-attribute
¶
Human-readable subtitle from the bridge.
E.g. "Claude will have read and write access to files in ~/Downloads".
display_name
class-attribute
instance-attribute
¶
Short noun phrase for the tool action (e.g. "Read file").
Suitable for button labels or compact UI.
input
class-attribute
instance-attribute
¶
The input to the tool that generated this permission request.
suggestions
class-attribute
instance-attribute
¶
Permission suggestions from CLI for updating permissions.
So the user won't be prompted again for this tool during this session.
title
class-attribute
instance-attribute
¶
Full permission prompt sentence rendered by the bridge.
E.g. "Claude wants to read foo.txt". Use this as the primary prompt text when present instead of reconstructing from toolName+input.
tool_name
class-attribute
instance-attribute
¶
The name of the tool that generated this permission request.
tool_use_id
instance-attribute
¶
Unique identifier for this specific tool call within the assistant message.
Multiple tool calls in the same assistant message will have different tool_use_ids.
from_permission_request
classmethod
¶
from_permission_request(req: SDKControlPermissionRequest) -> Self
Create a PermissionContext from a permission request.
Source code in src/clawd_code_sdk/models/permissions.py
ToolProgressMessage
¶
Bases: BaseMessage
Progress update for a running tool.
Source code in src/clawd_code_sdk/models/messages.py
heartbeat
class-attribute
instance-attribute
¶
Keep-alive tick with no new progress.
ToolResultBlock
¶
Bases: BaseContentBlock
Tool result content block.
Source code in src/clawd_code_sdk/models/content_blocks.py
extract_text
¶
Extract text content from this tool result.
Source code in src/clawd_code_sdk/models/content_blocks.py
ToolUseBlock
¶
Bases: BaseContentBlock
Tool use content block.
Source code in src/clawd_code_sdk/models/content_blocks.py
ToolUseMeta
¶
Bases: ClaudeCodeBaseModel
Display metadata for a tool_use block in an assistant message (undocumented).
Source code in src/clawd_code_sdk/models/messages.py
ToolUseSummaryMessage
¶
Bases: BaseMessage
Summary of preceding tool uses.
Source code in src/clawd_code_sdk/models/messages.py
ToolsPreset
¶
TriggerMetadata
¶
Bases: TypedDict
Trigger metadata.
Source code in src/clawd_code_sdk/models/system_messages.py
URLPDFSource
¶
Usage
¶
Bases: BaseModel
Token usage counters.
Used both for per-turn snapshots (on ResultMessage) and as an accumulator (on ClaudeSDKClient.query_usage / session_usage).
Source code in src/clawd_code_sdk/models/usage.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
cache_creation
class-attribute
instance-attribute
¶
cache_creation: CacheCreationUsage | None = None
Cache-write tokens split by TTL.
cache_creation_input_tokens
class-attribute
instance-attribute
¶
The number of input tokens used to create the cache entry.
cache_read_input_tokens
class-attribute
instance-attribute
¶
The number of input tokens read from the cache.
fallback_credit
class-attribute
instance-attribute
¶
Fallback credit info (may be null).
inference_geo
class-attribute
instance-attribute
¶
Inference geography (e.g. "global").
input_tokens
class-attribute
instance-attribute
¶
The number of input tokens which were used.
iterations
class-attribute
instance-attribute
¶
iterations: list[UsageIteration] | None = None
Per-iteration usage for the turn.
output_tokens
class-attribute
instance-attribute
¶
The number of output tokens which were used.
output_tokens_details
class-attribute
instance-attribute
¶
output_tokens_details: OutputTokensDetails | None = None
Breakdown of output tokens.
server_tool_use
class-attribute
instance-attribute
¶
server_tool_use: AgentServerToolUse | None = None
Server-side tool usage counters.
service_tier
class-attribute
instance-attribute
¶
Service tier the request was served on (e.g. "standard").
speed
class-attribute
instance-attribute
¶
Speed mode (e.g. "standard", "fast").
accumulate
¶
accumulate(usage: Usage) -> None
Add another Usage's values to this one.
Source code in src/clawd_code_sdk/models/usage.py
reset
¶
to_otel
¶
Extract usage metrics from a Claude usage object or dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
usage
|
A usage object or dict from the SDK. |
required | |
partial
|
bool
|
If True, prefix attribute names with |
False
|
Source code in src/clawd_code_sdk/models/usage.py
UsageMoney
¶
Bases: ClaudeCodeBaseModel
An amount in minor units (amount_minor / 10**exponent in currency).
Source code in src/clawd_code_sdk/models/context_usage.py
UsageRateLimits
¶
Bases: ClaudeCodeBaseModel
Plan rate-limit windows from the claude.ai usage endpoint.
Only the fields documented by the TypeScript SDK are modelled; the endpoint carries many experimental extras, which are ignored.
Source code in src/clawd_code_sdk/models/context_usage.py
limits
class-attribute
instance-attribute
¶
limits: list[UsageReportLimit] | None = None
The server's usage rows, in the server's order (render verbatim).
model_scoped
class-attribute
instance-attribute
¶
model_scoped: list[ModelScopedUsageWindow] | None = None
Per-model weekly windows (absent when unknown, empty when there are none).
spend
class-attribute
instance-attribute
¶
spend: UsageSpend | None = None
Usage-credit spend (not documented by the TypeScript SDK; may change).
UsageSpend
¶
Bases: ClaudeCodeBaseModel
Usage-credit spend beyond the plan windows (undocumented, server-defined).
Source code in src/clawd_code_sdk/models/context_usage.py
percent
class-attribute
instance-attribute
¶
Share of the spend limit used, 0-100.
UsageWindow
¶
Bases: ClaudeCodeBaseModel
Utilization of one plan rate-limit window.
Source code in src/clawd_code_sdk/models/context_usage.py
UserDocumentPrompt
dataclass
¶
A user prompt containing a base64-encoded PDF document.
Source code in src/clawd_code_sdk/models/prompts.py
context
class-attribute
instance-attribute
¶
Optional context about the document.
media_type
class-attribute
instance-attribute
¶
MIME type of the document.
to_content_block
¶
Return the Anthropic API content block dict.
Source code in src/clawd_code_sdk/models/prompts.py
UserDocumentURLPrompt
dataclass
¶
A user prompt containing a PDF document referenced by URL.
Source code in src/clawd_code_sdk/models/prompts.py
context
class-attribute
instance-attribute
¶
Optional context about the document.
to_content_block
¶
Return the Anthropic API content block dict.
Source code in src/clawd_code_sdk/models/prompts.py
UserFilePrompt
dataclass
¶
A user prompt referencing a file uploaded via the Anthropic Files API.
Source code in src/clawd_code_sdk/models/prompts.py
context
class-attribute
instance-attribute
¶
Optional context about the document.
to_content_block
¶
Return the Anthropic API content block dict.
Source code in src/clawd_code_sdk/models/prompts.py
UserImagePrompt
dataclass
¶
A user prompt containing a single base64-encoded image.
Source code in src/clawd_code_sdk/models/prompts.py
to_content_block
¶
Return the Anthropic API content block dict.
Source code in src/clawd_code_sdk/models/prompts.py
UserImageURLPrompt
dataclass
¶
A user prompt containing an image referenced by URL.
Source code in src/clawd_code_sdk/models/prompts.py
to_content_block
¶
Return the Anthropic API content block dict.
UserMessage
¶
Bases: BaseModel
User message.
Source code in src/clawd_code_sdk/models/messages.py
agent_id
class-attribute
instance-attribute
¶
Subagent ID when this message belongs to a subagent transcript.
client_composed
class-attribute
instance-attribute
¶
Set when the host composed this message (as opposed to the user typing it).
tool_result_meta
class-attribute
instance-attribute
¶
tool_result_meta: list[ToolResultMeta] | None = None
Per-tool-result metadata, e.g. how permission was decided (undocumented).
uuid
class-attribute
instance-attribute
¶
Always set for incoming user messages, can be omitted for objects created in query().
parse_command_output
¶
Extract output from legacy XML-tagged command output in user messages.
Source code in src/clawd_code_sdk/models/messages.py
UserPlainTextDocumentPrompt
dataclass
¶
A user prompt containing a plain text document.
Source code in src/clawd_code_sdk/models/prompts.py
context
class-attribute
instance-attribute
¶
Optional context about the document.
media_type
class-attribute
instance-attribute
¶
MIME type (always text/plain).
to_content_block
¶
Return the Anthropic API content block dict.
Source code in src/clawd_code_sdk/models/prompts.py
UserPromptExpansionHookInput
¶
Bases: BaseHookInput
Input data for UserPromptExpansion hook events.
Source code in src/clawd_code_sdk/models/hooks.py
UserPromptExpansionHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for UserPromptExpansion events.
Source code in src/clawd_code_sdk/models/hooks.py
UserPromptSubmitHookInput
¶
Bases: BaseHookInput
Input data for UserPromptSubmit hook events.
Source code in src/clawd_code_sdk/models/hooks.py
UserPromptSubmitHookSpecificOutput
¶
Bases: TypedDict
Hook-specific output for UserPromptSubmit events.
Source code in src/clawd_code_sdk/models/hooks.py
suppressOriginalPrompt
instance-attribute
¶
When decision is "block", omit the original prompt from the block message.
UserTextPrompt
dataclass
¶
WebFetchInput
¶
Bases: TypedDict
Input for the WebFetch tool. Fetches content from a URL and processes it with AI.
Source code in src/clawd_code_sdk/models/input_types.py
WebFetchOutput
¶
Bases: TypedDict
tool_use_result for the WebFetch tool.
Source code in src/clawd_code_sdk/models/output_types.py
artifactRead
instance-attribute
¶
artifactRead: NotRequired[ArtifactReadMarker]
Set when the fetched URL is an artifact that now counts as viewed.
WebSearchHit
¶
Bases: TypedDict
A single search result hit.
Source code in src/clawd_code_sdk/models/output_types.py
WebSearchInput
¶
Bases: TypedDict
Input for the WebSearch tool. Searches the web and returns formatted results.
Source code in src/clawd_code_sdk/models/input_types.py
WebSearchOutput
¶
Bases: TypedDict
tool_use_result for the WebSearch tool.
Source code in src/clawd_code_sdk/models/output_types.py
results
instance-attribute
¶
results: list[WebSearchToolResult | str]
Search results and/or text commentary from the model.
WebSearchToolResult
¶
WorkerShuttingDownMessage
¶
Bases: BaseSystemMessage
Emitted when the CLI worker is shutting down.
Source code in src/clawd_code_sdk/models/system_messages.py
WorktreeCreateHookInput
¶
WorktreeCreateHookSpecificOutput
¶
WorktreeRemoveHookInput
¶
WriteOutput
¶
Bases: TypedDict
tool_use_result for the Write tool.
Source code in src/clawd_code_sdk/models/output_types.py
staged
instance-attribute
¶
Whether the write was staged instead of written.