Session Start Guide
Benchmarked against: Anthropic — (No direct equivalent — SuperPortia SOP) Protocol: Agent Intelligence Protocol, Section 1 Scope: What every agent must do when a new session begins
Every SuperPortia agent follows a mandatory boot sequence at session start. This ensures the agent has situational awareness, knows its pending tasks, and is ready for Captain's instructions.
Boot sequence
Step-by-step
Step 1: Hook fires automatically
The SessionStart hook runs automatically when a new session begins. It injects:
| Injected data | Source | Purpose |
|---|---|---|
| Taipei timestamp | TZ='Asia/Taipei' date | Watch rule compliance |
| Strategic anchor | Hardcoded | Identity reminder after compaction |
| Agent intelligence | Memory MCP | Critical facts, corrections, decisions |
Step 2: Heartbeat (mandatory)
agent_heartbeat()
This registers the agent as online in the fleet registry. Other agents and the Captain can see you're active on the factory floor.
Step 3: Check mailbox (mandatory)
check_agent_mailbox(unread_only=True)
Check for any messages from other agents or the Captain. Process urgent messages immediately.
Step 4: Ask Captain
Do NOT:
- Read the entire bulletin board
- Search UB for general context
- Run
check_dispatch()to find work - Self-assign tasks
DO:
- Ask Captain what to work on
- Wait for explicit task assignment
Step 5: Read UB on demand
Once the Captain assigns a task, read relevant UB entries for that specific task:
search_brain("topic relevant to assigned task")
What NOT to do at session start
| Anti-pattern | Why it's wrong | Correct behavior |
|---|---|---|
| Read entire bulletin board | Wastes tokens on context that may not be needed | Read on demand |
| Search UB broadly | Token-expensive fishing expedition | Search for specific task |
| Self-assign work from dispatch | Captain decides priorities | Ask Captain |
| Read all pending WOs | Information overload | Captain tells you which WO |
| Long status report | Captain hasn't asked yet | Brief greeting, ask for task |
Compaction recovery
If the session starts after a context compaction (not a fresh session), a different protocol applies:
Key differences from fresh start:
- Do NOT run heartbeat again (already online)
- Do NOT search UB (compaction summary has your context)
- Do NOT ask Captain "what are we doing?"
- Resume work immediately based on the compaction summary
Session start for different contexts
Fresh session (first of the day)
- Hook fires — timestamp + heartbeat + mailbox
- Greet Captain with timestamp
- Ask: "What would you like to work on today?"
- Captain assigns task — begin work
Continuation session (previous ran out of context)
- Hook fires — timestamp + heartbeat + mailbox
- Read continuation summary (provided by system)
- Resume the previous task without asking Captain
- Report progress when reaching a milestone
Post-compaction (within same session)
- Read compaction summary
- Self-confirm task context
- Resume immediately — no UB reads, no reports
Hook configuration
The SessionStart hook is configured in .claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/session-start.sh"
}
]
}
]
}
}
What the hook script does
#!/bin/bash
# .claude/hooks/session-start.sh
# 1. Inject Taipei timestamp
echo "$(TZ='Asia/Taipei' date '+%Y-%m-%d %H:%M') (Taipei)"
# 2. Strategic anchor (survives compaction)
echo "STRATEGIC ANCHOR"
echo " Project: SS1 | Role: Engineer"
echo " Captain: Boss"
# 3. Pre-Flight Check reminder
echo "Pre-Flight Check active"
Lean boot principle
The boot sequence is designed to be minimal:
| Old boot (heavy) | New boot (lean) |
|---|---|
| Read bulletin board | Skip — not needed yet |
| Search UB broadly | Skip — ask Captain first |
| Check dispatch center | Skip — Captain decides |
| Read all pending WOs | Skip — Captain tells you |
| Total: 5+ UB calls | Total: 2 calls (heartbeat + mailbox) |
This follows Progressive Disclosure (PD): load the minimum at startup, expand on demand.
Related pages
| Page | Relationship |
|---|---|
| Quickstart | First session walkthrough |
| First Heartbeat | Heartbeat deep dive |
| Compaction Recovery | Post-compaction protocol |
| WO Lifecycle | Working with work orders |