NAME

Claude::Agent::Message::System - System message type

DESCRIPTION

Represents a system message: session initialisation, status changes, compaction boundaries and the other events the CLI reports outside the conversation itself.

ATTRIBUTES

type

Always system.

subtype

The kind of system message. Known values include init, status, compact_boundary, session_state_changed, api_retry, task_started, task_progress, task_notification, permission_denied, elicitation and files_persisted. Hook lifecycle subtypes are delivered as Claude::Agent::Message::HookEvent.

data

Additional data specific to the subtype.

slash_commands

Available slash commands (init).

claude_code_version

Version of the Claude Code CLI (init).

tools

Available tools (init).

output_style

Output formatting style (init).

plugins

Loaded plugins (init).

model

Active model name (init).

mcp_servers

MCP server status entries (init). An array of {name, status} hashes on current CLIs; older CLIs sent a hash.

api_key_source

Source of the API key (init).

skills

Available skills (init).

permission_mode

Current permission mode (init).

cwd

Working directory of the session (init).

agents

Available agent definitions (init).

state

The session state (session_state_changed): running, idle or requires_action.

uuid, session_id, parent_tool_use_id, agent_id, raw

See Claude::Agent::Message::Base. Fields the CLI sends under other names, such as capabilities or plugin_errors, are in raw.

METHODS

new

Takes a flat list of name/value pairs. Unknown names are ignored.

get_session_id

my $id = $msg->get_session_id;

The session id from the message, falling back to data->{session_id}.

AUTHOR

LNATION, <email at lnation.org>

LICENSE

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under The Artistic License 2.0 (GPL Compatible).