# SystemMessage

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

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** SDK system message, init message, Claude Agent SDK SystemMessage

## Think of it like

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

## 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.

## 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.

## Common mistake

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

## Three principles

- **Session events.** By subtype.
- **init first.** Setup facts.
- **compact_boundary.** After compaction.

## Related terms

- [ResultMessage](https://learn.benibix.com/term/ai/sdk-result-message)
- [AssistantMessage](https://learn.benibix.com/term/ai/sdk-assistant-message)
- [PreCompact Hook](https://learn.benibix.com/term/ai/precompact-hook)

## Told apart from

- [SystemMessage vs systemPrompt Option](https://learn.benibix.com/compare/sdk-system-message-vs-system-prompt-option): People think SystemMessage holds the system prompt, and it does not. The systemPrompt option is the set of rules the agent gets before your task. SystemMessage is a message the SDK sends back to your code. The first one, init, reports the session ID, the model and the tools. Later ones mark events, such as a chat being squeezed into a summary.

---

Source: https://learn.benibix.com/term/ai/sdk-system-message
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
