Let a hook choose how its systemMessage is rendered: system (default) or assistant style
Summary
Hook JSON output has one user-facing field, systemMessage. It is always rendered in the warning style: grey, italic, prefixed with "<HookEventName> says:". Please add a field that lets the hook pick the rendering, keeping the current style as the default:
{
"systemMessage": "afowler: Hi Brian, I'm on the channel\nafowler/agent: It's posted.",
"systemMessageStyle": "assistant"
}
systemMessageStyle: "system" (default, today's behaviour) or "assistant" (rendered as ordinary conversation text, no label, normal weight and colour).
Use case
We run a UserPromptSubmit hook that connects several people's coding-agent sessions into one conversation. When a person submits a prompt, the hook fetches messages the other people and their agents have posted since the last prompt and returns them twice: as additionalContext for the model and as systemMessage for the person. The content is conversation, not a warning. Rendered grey and italic under a "UserPromptSubmit says:" label, it reads as a diagnostic, and people miss it or skim past it. The person's own prompts and the assistant's replies are in normal text right next to it.
Current behaviour
systemMessage is rendered only in the warning style. There is no field that affects its presentation, and plain-text stdout or additionalContext is not shown to the user at all. The docs (https://code.claude.com/docs/en/hooks) do not specify the rendering.
Proposed behaviour
systemMessageStyleomitted or"system": unchanged.systemMessageStyle: "assistant": the text is shown in the conversation in the same style as assistant output, without the "<event> says:" prefix. Line breaks preserved.- Works for all hook events that accept
systemMessage; the 10,000-character cap applies as today.
An alternative that would also solve our case: an option to suppress the "<event> says:" prefix and the italic styling while keeping the system colour.
Environment
Claude Code 2.1.211, VS Code extension and terminal, macOS.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗