ClaudeCode.Message.ToolProgressMessage (ClaudeCode v0.29.0)

View Source

Represents a tool progress message from the Claude CLI.

Emitted periodically while a tool is executing to indicate progress. Useful for showing elapsed time or progress indicators in UIs.

Fields

  • :tool_use_id - The tool use block ID
  • :tool_name - Name of the executing tool
  • :parent_tool_use_id - Parent tool use ID if in a subagent context
  • :elapsed_time_seconds - Seconds since the tool started
  • :task_id - Background task ID (optional)
  • :uuid - Message UUID
  • :session_id - Session identifier

JSON Format

{
  "type": "tool_progress",
  "tool_use_id": "toolu_abc123",
  "tool_name": "Bash",
  "parent_tool_use_id": null,
  "elapsed_time_seconds": 5.2,
  "uuid": "...",
  "session_id": "..."
}

Summary

Functions

Creates a new ToolProgressMessage from JSON data.

Type guard to check if a value is a ToolProgressMessage.

Types

t()

@type t() :: %ClaudeCode.Message.ToolProgressMessage{
  elapsed_time_seconds: number() | nil,
  parent_tool_use_id: String.t() | nil,
  session_id: String.t(),
  task_id: String.t() | nil,
  tool_name: String.t(),
  tool_use_id: String.t(),
  type: :tool_progress,
  uuid: String.t() | nil
}

Functions

new(json)

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

Creates a new ToolProgressMessage from JSON data.

Examples

iex> ToolProgressMessage.new(%{
...>   "type" => "tool_progress",
...>   "tool_use_id" => "toolu_abc",
...>   "tool_name" => "Bash",
...>   "session_id" => "session-1"
...> })
{:ok, %ToolProgressMessage{type: :tool_progress, ...}}

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

tool_progress_message?(arg1)

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

Type guard to check if a value is a ToolProgressMessage.