Skip to main content

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 dataSourcePurpose
Taipei timestampTZ='Asia/Taipei' dateWatch rule compliance
Strategic anchorHardcodedIdentity reminder after compaction
Agent intelligenceMemory MCPCritical 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-patternWhy it's wrongCorrect behavior
Read entire bulletin boardWastes tokens on context that may not be neededRead on demand
Search UB broadlyToken-expensive fishing expeditionSearch for specific task
Self-assign work from dispatchCaptain decides prioritiesAsk Captain
Read all pending WOsInformation overloadCaptain tells you which WO
Long status reportCaptain hasn't asked yetBrief 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)

  1. Hook fires — timestamp + heartbeat + mailbox
  2. Greet Captain with timestamp
  3. Ask: "What would you like to work on today?"
  4. Captain assigns task — begin work

Continuation session (previous ran out of context)

  1. Hook fires — timestamp + heartbeat + mailbox
  2. Read continuation summary (provided by system)
  3. Resume the previous task without asking Captain
  4. Report progress when reaching a milestone

Post-compaction (within same session)

  1. Read compaction summary
  2. Self-confirm task context
  3. 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 boardSkip — not needed yet
Search UB broadlySkip — ask Captain first
Check dispatch centerSkip — Captain decides
Read all pending WOsSkip — Captain tells you
Total: 5+ UB callsTotal: 2 calls (heartbeat + mailbox)

This follows Progressive Disclosure (PD): load the minimum at startup, expand on demand.


PageRelationship
QuickstartFirst session walkthrough
First HeartbeatHeartbeat deep dive
Compaction RecoveryPost-compaction protocol
WO LifecycleWorking with work orders