Skip to content

hooks

Class info

Classes

Name Children Inherits
AgentHookHandler
clawd_code_sdk.models.hooks
Agent hook handler with multi-turn tool access.
    AsyncHookJSONOutput
    clawd_code_sdk.models.hooks
    Async hook output that defers hook execution.
      BaseHookInput
      clawd_code_sdk.models.hooks
      Base hook input fields present across many hook events.
        CommandHookHandler
        clawd_code_sdk.models.hooks
          ConfigChangeHookInput
          clawd_code_sdk.models.hooks
          Input data for ConfigChange hook events.
            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.
                  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.
                          FileChangedHookInput
                          clawd_code_sdk.models.hooks
                          Input data for FileChanged hook events.
                            FileChangedHookSpecificOutput
                            clawd_code_sdk.models.hooks
                            Hook-specific output for FileChanged events.
                              HookContext
                              clawd_code_sdk.models.hooks
                              Context information for hook callbacks.
                                HookEffort
                                clawd_code_sdk.models.hooks
                                Effort level active when the hook fired.
                                  HookMatcher
                                  clawd_code_sdk.models.hooks
                                  Hook matcher configuration.
                                    HookMatcherConfig
                                    clawd_code_sdk.models.hooks
                                    Declarative hook matcher for agent/skill/settings hook configuration.
                                      InstructionsLoadedHookInput
                                      clawd_code_sdk.models.hooks
                                      Input data for InstructionsLoaded hook events.
                                        McpServerProvenance
                                        clawd_code_sdk.models.hooks
                                        Which MCP server (and config source) a tool call belongs to.
                                          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.
                                              NotificationHookInput
                                              clawd_code_sdk.models.hooks
                                              Input data for Notification hook events.
                                                NotificationHookSpecificOutput
                                                clawd_code_sdk.models.hooks
                                                Hook-specific output for Notification events.
                                                  PermissionDeniedHookInput
                                                  clawd_code_sdk.models.hooks
                                                  Input data for PermissionDenied hook events.
                                                    PermissionDeniedHookSpecificOutput
                                                    clawd_code_sdk.models.hooks
                                                    Hook-specific output for PermissionDenied events.
                                                      PermissionRequestHookInput
                                                      clawd_code_sdk.models.hooks
                                                      Input data for PermissionRequest hook events.
                                                        PermissionRequestHookSpecificOutput
                                                        clawd_code_sdk.models.hooks
                                                        Hook-specific output for PermissionRequest events.
                                                          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.
                                                                PostToolBatchHookInput
                                                                clawd_code_sdk.models.hooks
                                                                Input data for PostToolBatch hook events.
                                                                  PostToolBatchHookSpecificOutput
                                                                  clawd_code_sdk.models.hooks
                                                                  Hook-specific output for PostToolBatch events.
                                                                    PostToolBatchToolCall
                                                                    clawd_code_sdk.models.hooks
                                                                    Represents a tool call in a PostToolBatch hook event.
                                                                      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.
                                                                                                SessionEndHookInput
                                                                                                clawd_code_sdk.models.hooks
                                                                                                Input data for SessionEnd hook events.
                                                                                                  SessionStartHookInput
                                                                                                  clawd_code_sdk.models.hooks
                                                                                                  Input data for SessionStart hook events.
                                                                                                    SessionStartHookSpecificOutput
                                                                                                    clawd_code_sdk.models.hooks
                                                                                                    Hook-specific output for SessionStart events.
                                                                                                      SetupHookInput
                                                                                                      clawd_code_sdk.models.hooks
                                                                                                      Input data for Setup hook events.
                                                                                                        StopFailureHookInput
                                                                                                        clawd_code_sdk.models.hooks
                                                                                                        Input data for StopFailure hook events.
                                                                                                          StopHookInput
                                                                                                          clawd_code_sdk.models.hooks
                                                                                                          Input data for Stop hook events.
                                                                                                            StopHookSpecificOutput
                                                                                                            clawd_code_sdk.models.hooks
                                                                                                            Hook-specific output for Stop events.
                                                                                                              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.
                                                                                                                            TeammateIdleHookInput
                                                                                                                            clawd_code_sdk.models.hooks
                                                                                                                            Input data for TeammateIdle hook events.
                                                                                                                              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.
                                                                                                                                      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.

                                                                                                                                            🛈 DocStrings

                                                                                                                                            Hook system types: inputs, outputs, matchers, and callbacks.

                                                                                                                                            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"}],
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                            }
                                                                                                                                            

                                                                                                                                            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

                                                                                                                                            HookHandler module-attribute

                                                                                                                                            Union of all declarative hook handler types.

                                                                                                                                            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
                                                                                                                                            class AgentHookHandler(TypedDict):
                                                                                                                                                """Agent hook handler with multi-turn tool access.
                                                                                                                                            
                                                                                                                                                See https://code.claude.com/docs/en/hooks#agent-based-hooks
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                type: Literal["agent"]
                                                                                                                                                prompt: str
                                                                                                                                                model: NotRequired[str]
                                                                                                                                                timeout: NotRequired[float]
                                                                                                                                                statusMessage: NotRequired[str]
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class AsyncHookJSONOutput(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.
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                async_: Literal[True]  # Using async_ to avoid Python keyword (converted to "async" for CLI)
                                                                                                                                                asyncTimeout: NotRequired[int]
                                                                                                                                            

                                                                                                                                            BaseHookInput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Base hook input fields present across many hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class BaseHookInput(TypedDict):
                                                                                                                                                """Base hook input fields present across many hook events."""
                                                                                                                                            
                                                                                                                                                session_id: str
                                                                                                                                                transcript_path: str
                                                                                                                                                cwd: str
                                                                                                                                                prompt_id: NotRequired[str]
                                                                                                                                                """ID of the user prompt that started the current turn."""
                                                                                                                                                permission_mode: NotRequired[str]
                                                                                                                                                effort: NotRequired[HookEffort]
                                                                                                                                            

                                                                                                                                            prompt_id instance-attribute

                                                                                                                                            prompt_id: NotRequired[str]
                                                                                                                                            

                                                                                                                                            ID of the user prompt that started the current turn.

                                                                                                                                            ConfigChangeHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for ConfigChange hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class ConfigChangeHookInput(BaseHookInput):
                                                                                                                                                """Input data for ConfigChange hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["ConfigChange"]
                                                                                                                                                source: Literal[
                                                                                                                                                    "user_settings", "project_settings", "local_settings", "policy_settings", "skills"
                                                                                                                                                ]
                                                                                                                                                file_path: NotRequired[str]
                                                                                                                                            

                                                                                                                                            CwdChangedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for CwdChanged hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class CwdChangedHookInput(BaseHookInput):
                                                                                                                                                """Input data for CwdChanged hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["CwdChanged"]
                                                                                                                                                old_cwd: str
                                                                                                                                                new_cwd: str
                                                                                                                                            

                                                                                                                                            CwdChangedHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for CwdChanged events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class CwdChangedHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for CwdChanged events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["CwdChanged"]
                                                                                                                                                watchPaths: NotRequired[list[str]]
                                                                                                                                            

                                                                                                                                            DirectoryAddedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for DirectoryAdded hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class DirectoryAddedHookInput(BaseHookInput):
                                                                                                                                                """Input data for DirectoryAdded hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["DirectoryAdded"]
                                                                                                                                                directory: str
                                                                                                                                                source: Literal["slash_command", "register_repo_root"]
                                                                                                                                            

                                                                                                                                            ElicitationHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for Elicitation hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class ElicitationHookInput(BaseHookInput):
                                                                                                                                                """Input data for Elicitation hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["Elicitation"]
                                                                                                                                                mcp_server_name: str
                                                                                                                                                message: str
                                                                                                                                                mode: NotRequired[ElicitationMode]
                                                                                                                                                url: NotRequired[str]
                                                                                                                                                elicitation_id: NotRequired[str]
                                                                                                                                                requested_schema: NotRequired[dict[str, Any]]
                                                                                                                                            

                                                                                                                                            ElicitationHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for Elicitation events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class ElicitationHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for Elicitation events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["Elicitation"]
                                                                                                                                                action: NotRequired[ElicitationAction]
                                                                                                                                                content: NotRequired[dict[str, Any]]
                                                                                                                                            

                                                                                                                                            ElicitationResultHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for ElicitationResult hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class ElicitationResultHookInput(BaseHookInput):
                                                                                                                                                """Input data for ElicitationResult hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["ElicitationResult"]
                                                                                                                                                mcp_server_name: str
                                                                                                                                                elicitation_id: NotRequired[str]
                                                                                                                                                mode: NotRequired[ElicitationMode]
                                                                                                                                                action: ElicitationAction
                                                                                                                                                content: NotRequired[dict[str, Any]]
                                                                                                                                            

                                                                                                                                            ElicitationResultHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for ElicitationResult events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class ElicitationResultHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for ElicitationResult events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["ElicitationResult"]
                                                                                                                                                action: NotRequired[ElicitationAction]
                                                                                                                                                content: NotRequired[dict[str, Any]]
                                                                                                                                            

                                                                                                                                            FileChangedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for FileChanged hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class FileChangedHookInput(BaseHookInput):
                                                                                                                                                """Input data for FileChanged hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["FileChanged"]
                                                                                                                                                file_path: str
                                                                                                                                                event: Literal["change", "add", "unlink"]
                                                                                                                                            

                                                                                                                                            FileChangedHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for FileChanged events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class FileChangedHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for FileChanged events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["FileChanged"]
                                                                                                                                                watchPaths: NotRequired[list[str]]
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class HookContext(TypedDict):
                                                                                                                                                """Context information for hook callbacks.
                                                                                                                                            
                                                                                                                                                Fields:
                                                                                                                                                    signal: Reserved for future abort signal support. Currently always None.
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                signal: Any | None  # Future: abort signal support
                                                                                                                                            

                                                                                                                                            HookEffort

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Effort level active when the hook fired.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class HookEffort(TypedDict):
                                                                                                                                                """Effort level active when the hook fired."""
                                                                                                                                            
                                                                                                                                                level: str
                                                                                                                                            

                                                                                                                                            HookMatcher

                                                                                                                                            Bases: BaseModel

                                                                                                                                            Hook matcher configuration.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class HookMatcher(BaseModel):
                                                                                                                                                """Hook matcher configuration."""
                                                                                                                                            
                                                                                                                                                # See https://docs.anthropic.com/en/docs/claude-code/hooks#structure for the
                                                                                                                                                # expected string value. For example, for PreToolUse, the matcher can be
                                                                                                                                                # a tool name like "Bash" or a combination of tool names like
                                                                                                                                                # "Write|MultiEdit|Edit".
                                                                                                                                                matcher: str | None = None
                                                                                                                                                # A list of Python functions with function signature HookCallback
                                                                                                                                                hooks: Sequence[HookCallback] = field(default_factory=list)
                                                                                                                                                # Timeout in seconds for all hooks in this matcher (default: 60)
                                                                                                                                                timeout: float | None = None
                                                                                                                                                on_failure: Literal["continue", "block"] | None = None
                                                                                                                                                """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``.
                                                                                                                                                """
                                                                                                                                            

                                                                                                                                            on_failure class-attribute instance-attribute

                                                                                                                                            on_failure: Literal['continue', 'block'] | None = None
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class HookMatcherConfig(TypedDict):
                                                                                                                                                """Declarative hook matcher for agent/skill/settings hook configuration.
                                                                                                                                            
                                                                                                                                                See https://code.claude.com/docs/en/hooks#matcher-patterns
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                matcher: NotRequired[str | None]
                                                                                                                                                hooks: list[HookHandler]
                                                                                                                                            

                                                                                                                                            InstructionsLoadedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for InstructionsLoaded hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class InstructionsLoadedHookInput(BaseHookInput):
                                                                                                                                                """Input data for InstructionsLoaded hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["InstructionsLoaded"]
                                                                                                                                                file_path: str
                                                                                                                                                memory_type: Literal["User", "Project", "Local", "Managed"]
                                                                                                                                                load_reason: LoadReason
                                                                                                                                                globs: NotRequired[list[str]]
                                                                                                                                                trigger_file_path: NotRequired[str]
                                                                                                                                                parent_file_path: NotRequired[str]
                                                                                                                                            

                                                                                                                                            McpServerProvenance

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Which MCP server (and config source) a tool call belongs to.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class McpServerProvenance(TypedDict):
                                                                                                                                                """Which MCP server (and config source) a tool call belongs to."""
                                                                                                                                            
                                                                                                                                                name: str
                                                                                                                                                source: str
                                                                                                                                            

                                                                                                                                            MessageDisplayHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for MessageDisplay hook events (assistant text being displayed).

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class MessageDisplayHookInput(BaseHookInput):
                                                                                                                                                """Input data for MessageDisplay hook events (assistant text being displayed)."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["MessageDisplay"]
                                                                                                                                                turn_id: str
                                                                                                                                                message_id: str
                                                                                                                                                index: int
                                                                                                                                                final: bool
                                                                                                                                                delta: str
                                                                                                                                            

                                                                                                                                            MessageDisplayHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for MessageDisplay events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class MessageDisplayHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for MessageDisplay events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["MessageDisplay"]
                                                                                                                                                displayContent: NotRequired[str]
                                                                                                                                                """Replacement text to display instead of the delta."""
                                                                                                                                            

                                                                                                                                            displayContent instance-attribute

                                                                                                                                            displayContent: NotRequired[str]
                                                                                                                                            

                                                                                                                                            Replacement text to display instead of the delta.

                                                                                                                                            NotificationHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for Notification hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class NotificationHookInput(BaseHookInput):
                                                                                                                                                """Input data for Notification hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["Notification"]
                                                                                                                                                message: str
                                                                                                                                                title: NotRequired[str]
                                                                                                                                                notification_type: str
                                                                                                                                            

                                                                                                                                            NotificationHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for Notification events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class NotificationHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for Notification events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["Notification"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PermissionDeniedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PermissionDenied hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PermissionDeniedHookInput(BaseHookInput):
                                                                                                                                                """Input data for PermissionDenied hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PermissionDenied"]
                                                                                                                                                tool_name: str
                                                                                                                                                tool_input: Any
                                                                                                                                                tool_use_id: str
                                                                                                                                                reason: str
                                                                                                                                                mcp_server: NotRequired[McpServerProvenance]
                                                                                                                                            

                                                                                                                                            PermissionDeniedHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PermissionDenied events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PermissionDeniedHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PermissionDenied events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PermissionDenied"]
                                                                                                                                                retry: NotRequired[bool]
                                                                                                                                            

                                                                                                                                            PermissionRequestHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PermissionRequest hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PermissionRequestHookInput(BaseHookInput):
                                                                                                                                                """Input data for PermissionRequest hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PermissionRequest"]
                                                                                                                                                tool_name: str
                                                                                                                                                tool_input: dict[str, Any]
                                                                                                                                                permission_suggestions: NotRequired[list[PermissionUpdate]]
                                                                                                                                                mcp_server: NotRequired[McpServerProvenance]
                                                                                                                                                agent_id: NotRequired[str]
                                                                                                                                                agent_type: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PermissionRequestHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PermissionRequest events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PermissionRequestHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PermissionRequest events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PermissionRequest"]
                                                                                                                                                decision: dict[str, Any]
                                                                                                                                            

                                                                                                                                            PostCompactHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PostCompact hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostCompactHookInput(BaseHookInput):
                                                                                                                                                """Input data for PostCompact hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PostCompact"]
                                                                                                                                                trigger: CompactionTrigger
                                                                                                                                                compact_summary: str
                                                                                                                                            

                                                                                                                                            PostModelSwitchHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PostModelSwitch hook events (after the session model changed).

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostModelSwitchHookInput(BaseHookInput):
                                                                                                                                                """Input data for PostModelSwitch hook events (after the session model changed)."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PostModelSwitch"]
                                                                                                                                                from_model: str
                                                                                                                                                to_model: str
                                                                                                                                                requested_model: str | None
                                                                                                                                                source: Literal["command", "picker", "sdk", "auto", "resume"]
                                                                                                                                                context_tokens: int
                                                                                                                                                prompt_cache_warm: bool
                                                                                                                                                cache_ttl: ModelSwitchCacheTtl
                                                                                                                                                estimated_cache_write_usd: float
                                                                                                                                                pricing: ModelSwitchPricing
                                                                                                                                            

                                                                                                                                            PostModelSwitchHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PostModelSwitch events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostModelSwitchHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PostModelSwitch events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PostModelSwitch"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PostToolBatchHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PostToolBatch hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolBatchHookInput(BaseHookInput):
                                                                                                                                                """Input data for PostToolBatch hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PostToolBatch"]
                                                                                                                                                tool_calls: list[PostToolBatchToolCall]
                                                                                                                                            

                                                                                                                                            PostToolBatchHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PostToolBatch events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolBatchHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PostToolBatch events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PostToolBatch"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PostToolBatchToolCall

                                                                                                                                            Bases: BaseModel

                                                                                                                                            Represents a tool call in a PostToolBatch hook event.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolBatchToolCall(BaseModel):
                                                                                                                                                """Represents a tool call in a PostToolBatch hook event."""
                                                                                                                                            
                                                                                                                                                tool_name: str
                                                                                                                                                tool_input: dict[str, Any]
                                                                                                                                                tool_use_id: str
                                                                                                                                                tool_response: Any = None
                                                                                                                                            

                                                                                                                                            PostToolUseFailureHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PostToolUseFailure hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolUseFailureHookInput(BaseHookInput):
                                                                                                                                                """Input data for PostToolUseFailure hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PostToolUseFailure"]
                                                                                                                                                tool_name: str
                                                                                                                                                tool_input: dict[str, Any]
                                                                                                                                                tool_use_id: str
                                                                                                                                                error: str
                                                                                                                                                duration_ms: NotRequired[float]
                                                                                                                                                mcp_server: NotRequired[McpServerProvenance]
                                                                                                                                                is_interrupt: NotRequired[bool]
                                                                                                                                                agent_id: NotRequired[str]
                                                                                                                                                agent_type: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PostToolUseFailureHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PostToolUseFailure events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolUseFailureHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PostToolUseFailure events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PostToolUseFailure"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PostToolUseHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PostToolUse hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolUseHookInput(BaseHookInput):
                                                                                                                                                """Input data for PostToolUse hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PostToolUse"]
                                                                                                                                                tool_name: str
                                                                                                                                                tool_input: dict[str, Any]
                                                                                                                                                tool_response: Any
                                                                                                                                                tool_use_id: str
                                                                                                                                                duration_ms: NotRequired[float]
                                                                                                                                                mcp_server: NotRequired[McpServerProvenance]
                                                                                                                                                agent_id: NotRequired[str]
                                                                                                                                                agent_type: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PostToolUseHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PostToolUse events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PostToolUseHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PostToolUse events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PostToolUse"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                                classifierContext: NotRequired[str]
                                                                                                                                                updatedToolOutput: NotRequired[Any]
                                                                                                                                                """Replace the tool output the model sees (any tool)."""
                                                                                                                                                updatedMCPToolOutput: NotRequired[Any]
                                                                                                                                            

                                                                                                                                            updatedToolOutput instance-attribute

                                                                                                                                            updatedToolOutput: NotRequired[Any]
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class PreCompactHookInput(BaseHookInput):
                                                                                                                                                """Input data for PreCompact hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PreCompact"]
                                                                                                                                                trigger: CompactionTrigger
                                                                                                                                                custom_instructions: str | None
                                                                                                                                            

                                                                                                                                            PreModelSwitchHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PreModelSwitch hook events (before the session model changes).

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PreModelSwitchHookInput(BaseHookInput):
                                                                                                                                                """Input data for PreModelSwitch hook events (before the session model changes)."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PreModelSwitch"]
                                                                                                                                                from_model: str
                                                                                                                                                to_model: str
                                                                                                                                                requested_model: str | None
                                                                                                                                                source: Literal["command", "picker", "sdk"]
                                                                                                                                                context_tokens: int
                                                                                                                                                prompt_cache_warm: bool
                                                                                                                                                cache_ttl: ModelSwitchCacheTtl
                                                                                                                                                estimated_cache_write_usd: float
                                                                                                                                                pricing: ModelSwitchPricing
                                                                                                                                            

                                                                                                                                            PreModelSwitchHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PreModelSwitch events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PreModelSwitchHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PreModelSwitch events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PreModelSwitch"]
                                                                                                                                                permissionDecision: NotRequired[Literal["allow", "deny", "ask"]]
                                                                                                                                                permissionDecisionReason: NotRequired[str]
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class PreSkillShellCommandHookInput(BaseHookInput):
                                                                                                                                                """Input data for PreSkillShellCommand hook events.
                                                                                                                                            
                                                                                                                                                Fires for each inline shell command of a skill or slash command as it loads.
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PreSkillShellCommand"]
                                                                                                                                                tool_name: str
                                                                                                                                                """The shell tool that runs the command: Bash or PowerShell."""
                                                                                                                                                tool_input: PreSkillShellCommandToolInput
                                                                                                                                                tool_use_id: str
                                                                                                                                                """Identifies this command. It names no tool call in the transcript."""
                                                                                                                                                command_name: str
                                                                                                                                                """The skill or command whose text holds the shell command."""
                                                                                                                                                command_source: NotRequired[str]
                                                                                                                                                invoked_by: Literal["user", "claude", "other"]
                                                                                                                                                """Who started the load (user: typed or sent by an SDK host, claude: the Skill tool)."""
                                                                                                                                            

                                                                                                                                            command_name instance-attribute

                                                                                                                                            command_name: str
                                                                                                                                            

                                                                                                                                            The skill or command whose text holds the shell command.

                                                                                                                                            invoked_by instance-attribute

                                                                                                                                            invoked_by: Literal['user', 'claude', 'other']
                                                                                                                                            

                                                                                                                                            Who started the load (user: typed or sent by an SDK host, claude: the Skill tool).

                                                                                                                                            tool_name instance-attribute

                                                                                                                                            tool_name: str
                                                                                                                                            

                                                                                                                                            The shell tool that runs the command: Bash or PowerShell.

                                                                                                                                            tool_use_id instance-attribute

                                                                                                                                            tool_use_id: str
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class PreSkillShellCommandHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PreSkillShellCommand events (refuse or rewrite the command)."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PreSkillShellCommand"]
                                                                                                                                                permissionDecision: NotRequired[HookPermissionDecision]
                                                                                                                                                permissionDecisionReason: NotRequired[str]
                                                                                                                                                updatedInput: NotRequired[dict[str, Any]]
                                                                                                                                            

                                                                                                                                            PreSkillShellCommandToolInput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Tool input of a PreSkillShellCommand hook.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PreSkillShellCommandToolInput(TypedDict):
                                                                                                                                                """Tool input of a PreSkillShellCommand hook."""
                                                                                                                                            
                                                                                                                                                command: str
                                                                                                                                                """The command as it would run, with arguments filled in."""
                                                                                                                                            

                                                                                                                                            command instance-attribute

                                                                                                                                            command: str
                                                                                                                                            

                                                                                                                                            The command as it would run, with arguments filled in.

                                                                                                                                            PreToolUseHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for PreToolUse hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PreToolUseHookInput(BaseHookInput):
                                                                                                                                                """Input data for PreToolUse hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["PreToolUse"]
                                                                                                                                                tool_name: str
                                                                                                                                                tool_input: dict[str, Any]
                                                                                                                                                tool_use_id: str
                                                                                                                                                mcp_server: NotRequired[McpServerProvenance]
                                                                                                                                                agent_id: NotRequired[str]
                                                                                                                                                agent_type: NotRequired[str]
                                                                                                                                            

                                                                                                                                            PreToolUseHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for PreToolUse events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class PreToolUseHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for PreToolUse events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["PreToolUse"]
                                                                                                                                                permissionDecision: NotRequired[HookPermissionDecision]
                                                                                                                                                permissionDecisionReason: NotRequired[str]
                                                                                                                                                updatedInput: NotRequired[dict[str, Any]]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class PromptHookHandler(TypedDict):
                                                                                                                                                """LLM prompt hook handler.
                                                                                                                                            
                                                                                                                                                See https://code.claude.com/docs/en/hooks#prompt-and-agent-hook-fields
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                type: Literal["prompt"]
                                                                                                                                                prompt: str
                                                                                                                                                model: NotRequired[str]
                                                                                                                                                timeout: NotRequired[float]
                                                                                                                                                statusMessage: NotRequired[str]
                                                                                                                                                once: NotRequired[bool]
                                                                                                                                            

                                                                                                                                            SessionEndHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for SessionEnd hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SessionEndHookInput(BaseHookInput):
                                                                                                                                                """Input data for SessionEnd hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["SessionEnd"]
                                                                                                                                                reason: SessionEndReason
                                                                                                                                            

                                                                                                                                            SessionStartHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for SessionStart hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SessionStartHookInput(BaseHookInput):
                                                                                                                                                """Input data for SessionStart hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["SessionStart"]
                                                                                                                                                source: Literal["startup", "resume", "clear", "compact"]
                                                                                                                                                agent_type: NotRequired[str]
                                                                                                                                                model: NotRequired[str]
                                                                                                                                            

                                                                                                                                            SessionStartHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for SessionStart events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SessionStartHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for SessionStart events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["SessionStart"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                                initialUserMessage: NotRequired[str]
                                                                                                                                                watchPaths: NotRequired[list[str]]
                                                                                                                                            

                                                                                                                                            SetupHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for Setup hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SetupHookInput(BaseHookInput):
                                                                                                                                                """Input data for Setup hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["Setup"]
                                                                                                                                                trigger: Literal["init", "maintenance"]
                                                                                                                                            

                                                                                                                                            StopFailureHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for StopFailure hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class StopFailureHookInput(BaseHookInput):
                                                                                                                                                """Input data for StopFailure hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["StopFailure"]
                                                                                                                                                error: AssistantMessageError
                                                                                                                                                error_details: NotRequired[str]
                                                                                                                                                last_assistant_message: NotRequired[str]
                                                                                                                                            

                                                                                                                                            StopHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for Stop hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class StopHookInput(BaseHookInput):
                                                                                                                                                """Input data for Stop hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["Stop"]
                                                                                                                                                stop_hook_active: bool
                                                                                                                                            

                                                                                                                                            StopHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for Stop events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class StopHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for Stop events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["Stop"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            SubagentStartHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for SubagentStart hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SubagentStartHookInput(BaseHookInput):
                                                                                                                                                """Input data for SubagentStart hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["SubagentStart"]
                                                                                                                                                agent_id: str
                                                                                                                                                agent_type: str
                                                                                                                                            

                                                                                                                                            SubagentStartHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for SubagentStart events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SubagentStartHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for SubagentStart events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["SubagentStart"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            SubagentStopHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for SubagentStop hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SubagentStopHookInput(BaseHookInput):
                                                                                                                                                """Input data for SubagentStop hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["SubagentStop"]
                                                                                                                                                stop_hook_active: bool
                                                                                                                                                agent_id: str
                                                                                                                                                agent_transcript_path: str
                                                                                                                                                agent_type: str
                                                                                                                                            

                                                                                                                                            SubagentStopHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for SubagentStop events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class SubagentStopHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for SubagentStop events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["SubagentStop"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            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
                                                                                                                                            class SyncHookJSONOutput(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.
                                                                                                                                                """
                                                                                                                                            
                                                                                                                                                # Common control fields
                                                                                                                                                continue_: NotRequired[bool]  # Avoid name clash (converted to "continue" for CLI)
                                                                                                                                                suppressOutput: NotRequired[bool]
                                                                                                                                                stopReason: NotRequired[str]
                                                                                                                                                # Decision fields
                                                                                                                                                # Note: "approve" is deprecated for PreToolUse (use permissionDecision instead)
                                                                                                                                                # For other hooks, only "block" is meaningful
                                                                                                                                                decision: NotRequired[Literal["approve", "block"]]
                                                                                                                                                systemMessage: NotRequired[str]
                                                                                                                                                terminalSequence: NotRequired[str]
                                                                                                                                                reason: NotRequired[str]
                                                                                                                                                # Hook-specific outputs
                                                                                                                                                hookSpecificOutput: NotRequired[HookSpecificOutput]
                                                                                                                                            

                                                                                                                                            TaskCompletedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for TaskCompleted hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class TaskCompletedHookInput(BaseHookInput):
                                                                                                                                                """Input data for TaskCompleted hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["TaskCompleted"]
                                                                                                                                                task_id: str
                                                                                                                                                task_subject: str
                                                                                                                                                task_description: NotRequired[str]
                                                                                                                                                teammate_name: NotRequired[str]
                                                                                                                                                team_name: NotRequired[str]
                                                                                                                                            

                                                                                                                                            TaskCreatedHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for TaskCreated hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class TaskCreatedHookInput(BaseHookInput):
                                                                                                                                                """Input data for TaskCreated hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["TaskCreated"]
                                                                                                                                                task_id: str
                                                                                                                                                task_subject: str
                                                                                                                                                task_description: NotRequired[str]
                                                                                                                                                teammate_name: NotRequired[str]
                                                                                                                                                team_name: NotRequired[str]
                                                                                                                                            

                                                                                                                                            TeammateIdleHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for TeammateIdle hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class TeammateIdleHookInput(BaseHookInput):
                                                                                                                                                """Input data for TeammateIdle hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["TeammateIdle"]
                                                                                                                                                teammate_name: str
                                                                                                                                                team_name: str
                                                                                                                                            

                                                                                                                                            UserPromptExpansionHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for UserPromptExpansion hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class UserPromptExpansionHookInput(BaseHookInput):
                                                                                                                                                """Input data for UserPromptExpansion hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["UserPromptExpansion"]
                                                                                                                                                expansion_type: Literal["slash_command", "mcp_prompt"]
                                                                                                                                                command_name: str
                                                                                                                                                command_args: str
                                                                                                                                                command_source: NotRequired[str]
                                                                                                                                                prompt: str
                                                                                                                                            

                                                                                                                                            UserPromptExpansionHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for UserPromptExpansion events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class UserPromptExpansionHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for UserPromptExpansion events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["UserPromptExpansion"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                            

                                                                                                                                            UserPromptSubmitHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for UserPromptSubmit hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class UserPromptSubmitHookInput(BaseHookInput):
                                                                                                                                                """Input data for UserPromptSubmit hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["UserPromptSubmit"]
                                                                                                                                                prompt: str
                                                                                                                                                session_title: NotRequired[str]
                                                                                                                                            

                                                                                                                                            UserPromptSubmitHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for UserPromptSubmit events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class UserPromptSubmitHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for UserPromptSubmit events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["UserPromptSubmit"]
                                                                                                                                                additionalContext: NotRequired[str]
                                                                                                                                                sessionTitle: NotRequired[str]
                                                                                                                                                suppressOriginalPrompt: NotRequired[bool]
                                                                                                                                                """When decision is "block", omit the original prompt from the block message."""
                                                                                                                                            

                                                                                                                                            suppressOriginalPrompt instance-attribute

                                                                                                                                            suppressOriginalPrompt: NotRequired[bool]
                                                                                                                                            

                                                                                                                                            When decision is "block", omit the original prompt from the block message.

                                                                                                                                            WorktreeCreateHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for WorktreeCreate hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class WorktreeCreateHookInput(BaseHookInput):
                                                                                                                                                """Input data for WorktreeCreate hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["WorktreeCreate"]
                                                                                                                                                name: str
                                                                                                                                            

                                                                                                                                            WorktreeCreateHookSpecificOutput

                                                                                                                                            Bases: TypedDict

                                                                                                                                            Hook-specific output for WorktreeCreate events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class WorktreeCreateHookSpecificOutput(TypedDict):
                                                                                                                                                """Hook-specific output for WorktreeCreate events."""
                                                                                                                                            
                                                                                                                                                hookEventName: Literal["WorktreeCreate"]
                                                                                                                                                worktreePath: str
                                                                                                                                            

                                                                                                                                            WorktreeRemoveHookInput

                                                                                                                                            Bases: BaseHookInput

                                                                                                                                            Input data for WorktreeRemove hook events.

                                                                                                                                            Source code in src/clawd_code_sdk/models/hooks.py
                                                                                                                                            class WorktreeRemoveHookInput(BaseHookInput):
                                                                                                                                                """Input data for WorktreeRemove hook events."""
                                                                                                                                            
                                                                                                                                                hook_event_name: Literal["WorktreeRemove"]
                                                                                                                                                worktree_path: str