#[non_exhaustive]pub struct SystemMessage {
pub subtype: String,
pub session_id: String,
pub cwd: String,
pub model: String,
pub claude_code_version: String,
pub permission_mode: String,
pub tools: Vec<String>,
pub betas: Vec<String>,
pub capabilities: Vec<String>,
pub skills: Vec<Value>,
pub plugins: Vec<Value>,
pub extra: HashMap<String, Value>,
}Expand description
Every type:"system" frame: init (first frame of each turn) plus
hook_started, hook_response, compact_boundary, model_fallback,
background_tasks_changed, task_started, task_updated, task_notification,
thinking_tokens, model_refusal_no_fallback, peer_message_hold, … —
only subtype and session_id are common to all; subtype-specific fields
are in extra. Source: binary system-message schemas
Source: chunk-hp1k7mph.js:194 (WGt function), chunk-20bv8pca.js:15125
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.subtype: Stringinit, hook_started, compact_boundary, …
session_id: StringSession the frame belongs to.
cwd: StringWorking directory (init).
model: StringActive model (init).
claude_code_version: StringCLI version (init).
permission_mode: StringPermission mode, as its wire value (init).
tools: Vec<String>Available tool names (init).
betas: Vec<String>Enabled API betas (init).
capabilities: Vec<String>Protocol capabilities the CLI supports, for feature detection (init).
skills: Vec<Value>Loaded skills (init), kept verbatim.
plugins: Vec<Value>Loaded plugins (init), kept verbatim.
extra: HashMap<String, Value>Subtype-specific fields.
Implementations§
Source§impl SystemMessage
impl SystemMessage
Sourcepub fn code_mode_active(&self) -> bool
pub fn code_mode_active(&self) -> bool
REPL or Eval in tools[] = Code Mode active (see SessionOptions::code_mode).