Skip to main content

Agent Messaging

Benchmarked against: Anthropic — Streaming Messages Tools: send_agent_message, check_agent_mailbox, mark_message, archive_message Servers: Local UBI + Cloud UB (both implement the same API)

Agent messaging is SuperPortia's inter-agent communication system. It works like email — messages persist in mailboxes, agents check for new messages, and conversations happen asynchronously across sessions and ships.


Why agent messaging?

In a multi-agent fleet, agents need to communicate without requiring the Captain to relay every message. Use cases:

ScenarioExample
Cross-ship coordinationSS1 agent tells SS2 agent about a dependency
Handoff notifications"I finished the research WO, your turn to implement"
Status updatesAgent reports completion to Captain's mailbox
Urgent alertsSRE system sends critical alerts to all agents
Session bridgingCLI agent leaves message for App agent on same ship

Agent identities

Messages are addressed to specific agent identities. Every agent in the fleet has a unique identity:

IdentityShipPlatformRole
Mac App 小克SS1Claude Desktop AppChief Engineer (App)
Mac CLI 小克SS1Claude Code CLIChief Engineer (CLI)
Mac App 小ASS1Claude Desktop AppAssistant (App)
Mac CLI 小ASS1Claude Code CLIAssistant (CLI)
Win App 小克SS2Claude Desktop AppChief Engineer (App)
Win CLI 小克SS2Claude Code CLIChief Engineer (CLI)
Win App 小ASS2Claude Desktop AppAssistant (App)
Win CLI 小ASS2Claude Code CLIAssistant (CLI)
Web 小克SS3Web interfaceChief Engineer (Web)
小西AnyClaude ChatStrategist
夏哥AnyCaptainCaptain
system:cronAnyAutomatedScheduled tasks
system:webhookAnyAutomatedWebhook triggers

Sending messages

send_agent_message

Send a message to another agent's mailbox.

Parameters:

ParameterTypeRequiredDescription
tostringYesRecipient identity (exact match required)
subjectstringYesMessage subject line
bodystringYesMessage body (markdown supported)
prioritystringNonormal (default) or urgent
from_agentstringNoSender identity (auto-detected from config)

Example:

send_agent_message(
to="Mac CLI 小克",
subject="Research complete — Claude Agent SDK docs",
body="""## Summary
Found 3 key updates in Claude Agent SDK:
1. TypeScript V2 preview available
2. Python SDK now supports streaming
3. New tool annotation API

UB entries: ub-xxxx, ub-yyyy, ub-zzzz

Ready for you to write the docs page.
""",
priority="normal"
)

Response:

{
"msg_id": "msg-1c7f1a59cc17",
"to": "Mac CLI 小克",
"from": "Mac App 小克",
"subject": "Research complete — Claude Agent SDK docs",
"delivered": true,
"timestamp": "2026-03-05T09:30:00Z"
}

Checking mailbox

check_agent_mailbox

Check an agent's mailbox for messages.

Parameters:

ParameterTypeRequiredDescription
agent_namestringNoWhich agent's mailbox (default: auto from config)
unread_onlybooleanNoOnly show unread messages (default: false)
include_archivedbooleanNoInclude archived messages (default: false)
limitintegerNoMax messages to return (default: 30)

Example:

# Check own mailbox, unread only
check_agent_mailbox(unread_only=True)

# Check specific agent's mailbox
check_agent_mailbox(agent_name="Mac CLI 小克", unread_only=True)

Response:

{
"unread": 2,
"total": 15,
"messages": [
{
"msg_id": "msg-1c7f1a59cc17",
"from": "Mac App 小克",
"to": "Mac CLI 小克",
"subject": "Research complete — Claude Agent SDK docs",
"priority": "normal",
"read": false,
"archived": false,
"created_at": "2026-03-05T09:30:00Z"
}
]
}

Managing messages

mark_message

Toggle a message's read/unread status.

# Mark as read
mark_message(msg_id="msg-1c7f1a59cc17", read=True)

# Mark as unread (to revisit later)
mark_message(msg_id="msg-1c7f1a59cc17", read=False)

archive_message

Soft-delete a message. Archived messages are hidden from default mailbox view but can be retrieved with include_archived=True.

archive_message(msg_id="msg-1c7f1a59cc17")

Session boot integration

The Agent Intelligence Protocol requires every session to start with a heartbeat and mailbox check:

Session Start:
1. agent_heartbeat() → Register as online
2. check_agent_mailbox() → Check for messages
3. Ask Captain what to do → Begin work

This is automated by the SessionStart hook in CLAUDE.md. The hook output includes:

  • Current Taipei timestamp
  • Unread message count
  • Any urgent messages flagged

Message lifecycle

Messages follow this lifecycle:

StateDescription
UnreadNew message, not yet read by recipient
ReadRecipient has read (or marked as read)
ArchivedSoft-deleted, hidden from default view

Messages are never hard-deleted. The mailbox is a persistent log of all inter-agent communication.


Best practices

PracticeWhy
Use descriptive subjectsAgents scan subjects to prioritize
Include UB referencesLink to related UB entries for context
Use urgent sparinglyOnly for genuinely time-sensitive matters
Archive after acting on a messageKeep mailbox clean
Include actionable next stepsTell the recipient what to do with the information

Limitations

LimitationWorkaround
No attachmentsReference UB entries or file paths instead
No group messagesSend individually to each recipient
No threadingReference the original msg_id in the body
Max body ~4KBFor large content, ingest to UB and reference the entry
No real-time pushAgents check mailbox at session start and periodically

PageRelationship
MCP Tools OverviewFull tool catalog
Agent Intelligence ProtocolSession boot sequence uses mailbox
Factory Floor StatusReal-time view of who's online
Work Order APIWO notifications complement messaging