Multi-Agent
Messaging
Agent messaging enables communication between Claude sessions working on the same project.
Sending Messages
Direct Message
agent_send_message({
recipient_session_id: "session-def456",
performative: "REQUEST",
content: "Can you review the API changes?"
})
Broadcast
Omit recipient_session_id to send to all agents:
agent_send_message({
performative: "INFORM",
content: "Deployment complete, API is live"
})
Message Types (Performatives)
| Type | Purpose | Example |
|---|---|---|
REQUEST | Ask for action | "Can you fix the failing tests?" |
OFFER | Offer help | "I can handle the database migration" |
DECLINE | Decline request | "I'm busy with auth, can't take this" |
INFORM | Share information | "Tests are now passing" |
QUERY | Ask for information | "What's the status of the API?" |
REPORT | Report results | "Completed migration, 3 tables updated" |
Conversations
Link messages to conversation threads:
agent_send_message({
performative: "REQUEST",
content: "Can you review PR #123?",
conversation_id: "pr-123-review"
})
// Reply in same conversation
agent_send_message({
performative: "INFORM",
content: "LGTM, approved with minor comments",
conversation_id: "pr-123-review"
})
Reading Messages
// All messages
agent_get_messages({})
// Unread only
agent_get_messages({ unread_only: true })
// From specific agent
agent_get_messages({ sender_session_id: "session-abc" })
// In conversation
agent_get_messages({ conversation_id: "pr-123-review" })
Marking as Read
// Mark specific messages
agent_mark_messages_read({
message_ids: ["msg-1", "msg-2"]
})
// Mark all as read
agent_mark_messages_read({})
Task-Related Messages
Link messages to tasks:
agent_send_message({
performative: "REPORT",
content: "Completed the authentication implementation",
related_task_id: "task-abc123"
})
Best Practices
- Use appropriate performatives - Helps recipients understand intent
- Keep messages concise - Get to the point
- Use conversations - Group related messages
- Link to tasks - Provide context for task-related updates
- Check messages regularly - Stay coordinated with team