Skip to content

SDKControlInitializeRequest

Base classes

Name Children Inherits
_ControlBase
clawd_code_sdk.models.control
Frozen base for all SDK control request models.

â‹” Inheritance diagram

graph TD
  2929481846["control.SDKControlInitializeRequest"]
  1268774935["control._ControlBase"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  1268774935 --> 2929481846
  3879467795 --> 1268774935
  2751680898 --> 3879467795

🛈 DocStrings

Bases: _ControlBase

SDK control initialize request.

Source code in src/clawd_code_sdk/models/control.py
class SDKControlInitializeRequest(_ControlBase):
    """SDK control initialize request."""

    subtype: Literal["initialize"] = "initialize"
    hooks: dict[HookEvent, Any] | None = None
    agents: dict[str, AgentWireDefinition] | None = None
    sdk_mcp_servers: list[str] | None = Field(default=None, serialization_alias="sdkMcpServers")
    sdk_mcp_server_configs: dict[str, dict[str, Any]] | None = Field(
        default=None, serialization_alias="sdkMcpServerConfigs"
    )
    """Settings of the in-process servers in ``sdk_mcp_servers``, by name: ``timeout`` (ms per
    tool call, when first registered) and ``tools`` (per-tool permission policy)."""
    sdk_mcp_server_manifests: dict[str, SdkMcpServerManifest] | None = Field(
        default=None, serialization_alias="sdkMcpServerManifests"
    )
    """The in-process servers' handshake results, captured by the host (a one-shot cache
    for the connect that follows; ``sdk_mcp_manifests_parked`` reports each entry)."""
    sdk_mcp_server_manifests_origin: Literal["host_per_send"] | None = Field(
        default=None, serialization_alias="sdkMcpServerManifestsOrigin"
    )
    """That the manifests were captured for this send (only needed over a remote session
    transport; the CLI's own stdio transport needs no marker)."""
    plugins: list[dict[str, Any]] | None = None
    """Plugins to load at launch (``plugin_delivery="initialize"``, ``--await-initialize``)."""
    mcp_servers: dict[str, dict[str, Any]] | None = Field(
        default=None, serialization_alias="mcpServers"
    )
    """Servers for Claude Code to run or connect to, as one ``--mcp-config`` item would hold
    them; read only at launch under ``--await-initialize`` (``mcp_servers_applied``)."""
    system_prompt: list[str] | None = Field(default=None, serialization_alias="systemPrompt")
    append_system_prompt: str | None = Field(default=None, serialization_alias="appendSystemPrompt")
    exclude_dynamic_sections: bool | None = Field(
        default=None,
        serialization_alias="excludeDynamicSections",
    )
    """When true, omit per-user dynamic sections from the cached system prompt.

    Omits info like working directory, auto-memory path and re-inject them as the first usermessage.
    Lets cross-user prompt caching hit on a static system prompt prefix.
    Tradeoff: the model sees this context slightly later in the prompt,
    so steering on the working directory and memory location is marginally less authoritative.
    Has no effect when a custom (non-preset) system prompt is in use."""
    json_schema: dict[str, Any] | None = Field(default=None, serialization_alias="jsonSchema")
    prompt_suggestions: bool | None = Field(default=None, serialization_alias="promptSuggestions")
    agent_progress_summaries: bool | None = Field(
        default=None, serialization_alias="agentProgressSummaries"
    )
    title: str | None = None
    """Custom session title.

    When provided, the session uses this title and skips automatic title generation.
    Has no effect on the persisted title when resuming an existing session."""
    skills: list[str] | None = None
    """When provided, only given skills are loaded into the main session system prompt.

    Uses the same rules as AgentDefinition.skills:
    exact name, plugin-qualified name, or ":name" suffix.
    Omit to load every discovered skill.
    Applies to the main session only; subagents use AgentDefinition.skills."""
    plan_mode_instructions: str | None = Field(
        default=None,
        serialization_alias="planModeInstructions",
    )
    """Custom workflow body for the plan-mode system reminder."""
    system_prompt_snapshot: bool | None = Field(
        default=None, serialization_alias="systemPromptSnapshot"
    )
    forward_subagent_text: bool | None = Field(
        default=None, serialization_alias="forwardSubagentText"
    )
    tool_aliases: dict[str, str] | None = Field(default=None, serialization_alias="toolAliases")
    per_task_stop_affordance: bool | None = Field(
        default=None, serialization_alias="perTaskStopAffordance"
    )
    supported_dialog_kinds: list[str] | None = Field(
        default=None, serialization_alias="supportedDialogKinds"
    )

exclude_dynamic_sections class-attribute instance-attribute

exclude_dynamic_sections: bool | None = Field(
    default=None, serialization_alias="excludeDynamicSections"
)

When true, omit per-user dynamic sections from the cached system prompt.

Omits info like working directory, auto-memory path and re-inject them as the first usermessage. Lets cross-user prompt caching hit on a static system prompt prefix. Tradeoff: the model sees this context slightly later in the prompt, so steering on the working directory and memory location is marginally less authoritative. Has no effect when a custom (non-preset) system prompt is in use.

mcp_servers class-attribute instance-attribute

mcp_servers: dict[str, dict[str, Any]] | None = Field(
    default=None, serialization_alias="mcpServers"
)

Servers for Claude Code to run or connect to, as one --mcp-config item would hold them; read only at launch under --await-initialize (mcp_servers_applied).

plan_mode_instructions class-attribute instance-attribute

plan_mode_instructions: str | None = Field(default=None, serialization_alias="planModeInstructions")

Custom workflow body for the plan-mode system reminder.

plugins class-attribute instance-attribute

plugins: list[dict[str, Any]] | None = None

Plugins to load at launch (plugin_delivery="initialize", --await-initialize).

sdk_mcp_server_configs class-attribute instance-attribute

sdk_mcp_server_configs: dict[str, dict[str, Any]] | None = Field(
    default=None, serialization_alias="sdkMcpServerConfigs"
)

Settings of the in-process servers in sdk_mcp_servers, by name: timeout (ms per tool call, when first registered) and tools (per-tool permission policy).

sdk_mcp_server_manifests class-attribute instance-attribute

sdk_mcp_server_manifests: dict[str, SdkMcpServerManifest] | None = Field(
    default=None, serialization_alias="sdkMcpServerManifests"
)

The in-process servers' handshake results, captured by the host (a one-shot cache for the connect that follows; sdk_mcp_manifests_parked reports each entry).

sdk_mcp_server_manifests_origin class-attribute instance-attribute

sdk_mcp_server_manifests_origin: Literal["host_per_send"] | None = Field(
    default=None, serialization_alias="sdkMcpServerManifestsOrigin"
)

That the manifests were captured for this send (only needed over a remote session transport; the CLI's own stdio transport needs no marker).

skills class-attribute instance-attribute

skills: list[str] | None = None

When provided, only given skills are loaded into the main session system prompt.

Uses the same rules as AgentDefinition.skills: exact name, plugin-qualified name, or ":name" suffix. Omit to load every discovered skill. Applies to the main session only; subagents use AgentDefinition.skills.

title class-attribute instance-attribute

title: str | None = None

Custom session title.

When provided, the session uses this title and skips automatic title generation. Has no effect on the persisted title when resuming an existing session.

:fa-brands-github: Show source on GitHub