ClaudeCode.Message.SystemMessage.Init (ClaudeCode v0.36.3)

View Source

Represents the session initialization system message from the Claude CLI.

The init message is the first message received when a session starts, containing the available tools, model, MCP servers, and session configuration.

Summary

Functions

Type guard to check if a value is an Init message.

Types

t()

@type t() :: %ClaudeCode.Message.SystemMessage.Init{
  agents: [String.t()],
  api_key_source: String.t() | nil,
  claude_code_version: String.t() | nil,
  cwd: String.t() | nil,
  fast_mode_state: String.t() | nil,
  mcp_servers: [ClaudeCode.MCP.Status.t()] | nil,
  model: String.t() | nil,
  output_style: String.t(),
  permission_mode: ClaudeCode.Session.PermissionMode.t() | nil,
  plugins: [%{name: String.t(), path: String.t()} | String.t()],
  session_id: String.t(),
  skills: [String.t()],
  slash_commands: [String.t()],
  subtype: :init,
  tools: [String.t()] | nil,
  type: :system,
  uuid: String.t() | nil
}

Functions

init?(arg1)

@spec init?(any()) :: boolean()

Type guard to check if a value is an Init message.

new(json)

@spec new(map()) ::
  {:ok, t()} | {:error, :invalid_message_type | {:missing_fields, [atom()]}}