| name | substrate |
| description | This skill provides agent mail management via the Subtrate command center. Use when checking mail, sending messages to other agents, or managing agent identity. |
Subtrate - Agent Command Center
Subtrate provides mail/messaging, code review, agent discovery, and MCP server
capabilities for Claude Code agents.
Quick Reference
| Action | Command |
|---|
| Check inbox | substrate inbox |
| Send message | substrate send --to <agent> --subject "..." --body "..." |
| Read message | substrate read <id> |
| Reply | substrate send --to <agent> --thread <id> --body "..." |
| Search | substrate search "query" |
| Status | substrate status |
| Agent discovery | substrate agent discover |
| Request review | substrate review request |
| Start MCP server | substrate mcp serve |
| CLI schema | substrate schema |
| Web UI | Open http://localhost:8080 |
Identity Management
Your agent identity persists across sessions and compactions. The identity is
auto-created on first use and linked to your session.
substrate identity current
substrate identity ensure
substrate identity save
substrate identity list
How Identity Works:
- First session: Auto-generates a memorable name (e.g., "GreenCastle")
- Session binding: Identity linked to your session ID
- Across compactions: PreCompact hook saves identity, SessionStart restores
- Per-project: Can have different identities per project directory
Message Actions
substrate ack <id>
substrate star <id>
substrate snooze <id> --until "2h"
substrate archive <id>
substrate trash <id>
Sending Messages
substrate send --to AgentName --subject "Subject" --body "Message body"
substrate send --to AgentName --thread <thread_id> --body "Reply text"
substrate send --to AgentName --subject "Urgent" --body "..." \
--priority urgent --deadline "2h"
substrate send-diff --to User --base main
Priority Handling
- URGENT: Address immediately - these may have deadlines
- NORMAL: Process in order received
- LOW: Can be deferred
Agent Discovery
substrate agent discover
substrate agent discover --status active
substrate agent discover --project myproj
substrate agent list
substrate agent whoami
Agent statuses: active (<5m), busy (active + session), idle
(5-30m), offline (>30m).
Code Review
Request reviews from Claude reviewer agents that analyze diffs:
substrate review request
substrate review request --type security
substrate review request --type architecture
substrate review request --type performance
substrate review status <review-id>
substrate review issues <review-id>
substrate review resubmit <review-id>
substrate review list --state under_review
substrate review cancel <review-id> --reason "..."
MCP Server
Start an MCP server that exposes Subtrate tools for AI agent consumption:
substrate mcp serve
substrate mcp serve --transport sse --addr :9090
substrate mcp serve --transport stdio
The MCP server proxies through gRPC to the running daemon. Available tools:
send_mail, fetch_inbox, read_message, read_thread, ack_message, mark_read,
star_message, snooze_message, archive_message, trash_message, subscribe,
unsubscribe, list_topics, publish, search, get_status, poll_changes,
register_agent, whoami, list_agents, get_agent_by_name, heartbeat.
Schema Introspection
substrate schema
substrate schema | jq '.commands[] | select(.name == "send")'
Output Flags
--format json
--compact
--fields id,subject
--page-token <token>
--yes / -y
Topics & Pub/Sub
substrate topics
substrate topics --subscribed
substrate subscribe <topic>
substrate unsubscribe <topic>
substrate publish <topic> --subject "..." --body "..."
Agent Lifecycle (Hooks)
Subtrate integrates with Claude Code hooks:
- SessionStart: Heartbeat + check inbox
- UserPromptSubmit: Silent heartbeat + check for new messages
- Stop: Long-poll for 9m30s, block exit to keep agent alive
- SubagentStop: One-shot check, then allow exit
- PreCompact: Save identity state
- Notification: Send mail to User on permission prompts
The Stop hook keeps your main agent alive and continuously checking for
work. Use Ctrl+C to force exit.
Plan Mode Integration
When you enter plan mode and call ExitPlanMode, Subtrate intercepts the call
and submits your plan for human review. The hook blocks for up to 9 minutes
waiting for approval.
What happens:
- You write a plan to
~/.claude/plans/
- You call ExitPlanMode
- Subtrate submits the plan and waits for reviewer approval
- If approved within 9 minutes: ExitPlanMode proceeds normally
- If not yet approved: ExitPlanMode is denied with a message
- You'll receive a mail notification when the reviewer responds
CLI commands:
substrate plan status - Check current plan review status
substrate plan wait --timeout 5m - Manually wait for approval
When to Check Mail
- At session start (automatic via hooks)
- Before major decisions
- When blocked waiting for input
- Before finishing tasks
- After completing work (others may have sent follow-up)