pub struct Initialize {Show 19 fields
pub hooks: Option<HashMap<HookEventKind, Vec<HookMatcherConfig>>>,
pub system_prompt: Option<String>,
pub append_system_prompt: Option<String>,
pub agents: Option<Value>,
pub json_schema: Option<Value>,
pub title: Option<String>,
pub skills: Option<Vec<String>>,
pub plugins: Option<Vec<Value>>,
pub mcp_servers: Option<Map<String, Value>>,
pub plan_mode_instructions: Option<String>,
pub exclude_dynamic_sections: Option<bool>,
pub system_prompt_snapshot: Option<bool>,
pub prompt_suggestions: Option<bool>,
pub agent_progress_summaries: Option<bool>,
pub forward_subagent_text: Option<bool>,
pub tool_aliases: Option<HashMap<String, String>>,
pub supported_dialog_kinds: Option<Vec<String>>,
pub per_task_stop_affordance: Option<bool>,
pub workspace_trust: Option<WorkspaceTrust>,
}Expand description
Body of the initialize control request — the first stdin line.
Process-level settings (cwd, model, permission mode, session id) are CLI
flags, not initialize fields; they live on SessionOptions.
hooks is filled in by Session::spawn from SessionOptions::hooks.
Source: binary initialize schema (subtype “initialize”, hooks, agents,
systemPrompt, appendSystemPrompt, jsonSchema, …); query.py:150–155
Fields§
§hooks: Option<HashMap<HookEventKind, Vec<HookMatcherConfig>>>Hook matchers per event; matches arrive as hook_callback requests.
system_prompt: Option<String>systemPrompt: the custom system prompt slot, same as --system-prompt.
append_system_prompt: Option<String>appendSystemPrompt: appended to the system prompt.
agents: Option<Value>Subagent definitions, keyed by agent name.
json_schema: Option<Value>JSON schema for structured output; the result arrives in
TurnResult::structured_output.
title: Option<String>Session title; skips automatic title generation.
skills: Option<Vec<String>>Load only the skills with these names.
plugins: Option<Vec<Value>>Plugins to load, e.g. {"type": "local", "path": "./my-plugin"}.
mcp_servers: Option<Map<String, Value>>MCP servers the CLI runs or connects to, keyed by name: stdio
({"command": …, "args": […]}), http or sse configs.
In-process servers go in SessionOptions::mcp_servers.
plan_mode_instructions: Option<String>Replaces the default plan-mode workflow text.
exclude_dynamic_sections: Option<bool>Omit per-user dynamic sections (working directory, memory path) from the system prompt, so it caches across users.
system_prompt_snapshot: Option<bool>Record the system prompt once per conversation and reuse it verbatim.
prompt_suggestions: Option<bool>Emit prompt_suggestion frames after turns.
agent_progress_summaries: Option<bool>Emit progress summaries of running subagents.
forward_subagent_text: Option<bool>Forward subagent text and thinking.
tool_aliases: Option<HashMap<String, String>>Tool-name aliases applied before tool-name resolution.
supported_dialog_kinds: Option<Vec<String>>request_user_dialog kinds SessionOptions::on_user_dialog renders;
the CLI sends only these kinds.
per_task_stop_affordance: Option<bool>Declares that the host renders a per-task stop control (stop_task).
workspace_trust: Option<WorkspaceTrust>Workspace trust the host obtained from the user for directory.