Skip to content
BENIBIX Learn

SystemMessage

AI🧩 Claude Agent SDKSDK Messages

Also known as SDK system message, init message, Claude Agent SDK SystemMessage

The message for session events. The first one says how the session was set up.

Think of it like

It is like the voice that says the show is about to start.

Example

Leo logs the first system message to see which tools and model his agent got.

Why it matters

The init message tells you what the session is working with before any work starts.

Definition

SystemMessage is the message type for events in a session. Its subtype says which one. init comes first and carries the session ID, the model, the tools and other setup facts. compact_boundary comes after the chat is made shorter. Other subtypes carry short status notes.

Common mistake

Reading the session ID only from the result. In TypeScript the init message has it from the start.

Key takeaways

  1. 1
    Session events. By subtype.
  2. 2
    init first. Setup facts.
  3. 3
    compact_boundary. After compaction.

Compare