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

View Source

Represents a task started system message from the Claude CLI.

Emitted when a background task begins execution.

Fields

  • :type - Always :system
  • :subtype - Always :task_started
  • :task_id - Unique identifier for the task
  • :tool_use_id - Associated tool use block ID (optional)
  • :description - Human-readable description of the task
  • :task_type - Type classification of the task (optional)
  • :prompt - The prompt or instruction that started the task (optional)
  • :uuid - Message UUID
  • :session_id - Session identifier

JSON Format

{
  "type": "system",
  "subtype": "task_started",
  "task_id": "task_abc123",
  "tool_use_id": "toolu_abc123",
  "description": "Running background analysis",
  "task_type": "background",
  "uuid": "...",
  "session_id": "..."
}

Summary

Functions

Creates a new TaskStarted from JSON data.

Type guard to check if a value is a TaskStarted.

Types

t()

@type t() :: %ClaudeCode.Message.SystemMessage.TaskStarted{
  description: String.t() | nil,
  prompt: String.t() | nil,
  session_id: String.t(),
  subtype: :task_started,
  task_id: String.t(),
  task_type: String.t() | nil,
  tool_use_id: String.t() | nil,
  type: :system,
  uuid: String.t() | nil
}

Functions

new(json)

@spec new(map()) :: {:ok, t()} | {:error, atom()}

Creates a new TaskStarted from JSON data.

Examples

iex> TaskStarted.new(%{
...>   "type" => "system",
...>   "subtype" => "task_started",
...>   "task_id" => "task_abc",
...>   "session_id" => "session-1"
...> })
{:ok, %TaskStarted{type: :system, subtype: :task_started, ...}}

iex> TaskStarted.new(%{"type" => "assistant"})
{:error, :invalid_message_type}

task_started?(arg1)

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

Type guard to check if a value is a TaskStarted.