MessageDisplay API

July 14, 2026 ยท View on GitHub

Available when inheriting from ClaudeHooks::MessageDisplay:

Runs when a message is about to be displayed. Can override the displayed text via hookSpecificOutput.displayContent.

Input Helpers

๐Ÿ“š Shared input helpers

MethodDescription
turn_idID of the current turn
message_idID of this message
indexPosition of this message in the turn
finalWhether this is the final message chunk (true/false)
deltaThe incremental text content of this message
message_textAlias for delta

Hook State Helpers

๐Ÿ“š Shared hook state methods

MethodDescription
display_content!(text)Override the displayed text for this message

Output Helpers

๐Ÿ“š Shared output helpers

MethodDescription
output.display_contentGet the overridden display content (if set)

Hook Exit Codes

Exit code and output stream are ignored for MessageDisplay. The only honored output is hookSpecificOutput.displayContent.