ClaudeCode.Message.PromptSuggestionMessage (ClaudeCode v0.29.0)
View SourceRepresents a prompt suggestion message from the Claude CLI.
Emitted after each turn when the promptSuggestions option is enabled.
Contains a predicted next user prompt that can be shown as a suggestion
in UI applications.
Fields
:suggestion- The suggested next prompt:uuid- Message UUID:session_id- Session identifier
JSON Format
{
"type": "prompt_suggestion",
"suggestion": "Now add tests for the new function",
"uuid": "...",
"session_id": "..."
}
Summary
Functions
Creates a new PromptSuggestionMessage from JSON data.
Type guard to check if a value is a PromptSuggestionMessage.
Types
Functions
Creates a new PromptSuggestionMessage from JSON data.
Examples
iex> PromptSuggestionMessage.new(%{
...> "type" => "prompt_suggestion",
...> "suggestion" => "Add tests for the new module",
...> "session_id" => "session-1"
...> })
{:ok, %PromptSuggestionMessage{type: :prompt_suggestion, ...}}
iex> PromptSuggestionMessage.new(%{"type" => "assistant"})
{:error, :invalid_message_type}
Type guard to check if a value is a PromptSuggestionMessage.