Session startup with context recovery. USE WHEN starting session, after /clear, or recovering from autocompact.
Gather project context and recover from handoffs automatically.
1. Pre-loaded (preferred): Check for "Pre-loaded Session Status" in the SessionStart hook output (appears in system-reminder tags at conversation start with additionalContext). If found, parse the JSON code block and use this data directlyβno MCP call needed.
2. MCP fallback: If no pre-loaded data exists, call get_session_status with appropriate level.
Look for a section like this in the startup system-reminders:
# Pre-loaded Session Status
The following session context was gathered at startup...
```json
{
"level": "standard",
"integrations": {...},
"recovery": {...},
"project": {...},
"beads_triage": {...}
}
The pre-loaded data has the same structure as the MCP responseβformat and display it the same way.
// Fresh session - full context
get_session_status({ level: "full" })
// Context recovery mid-session
get_session_status() // defaults to minimal
// Restore specific handoff
get_session_status({ handoff: "h7k2m" })
| Level | Use Case | Sections |
|---|---|---|
minimal |
Context recovery | project, harness, beads counts |
standard |
Most session starts | + beads_triage, agentmail |
full |
Fresh session | + claude_mem references |
The plugin tracks your work automatically via hooks. If context is lost (autocompact, /clear), recovery options appear:
If you see a marker like <!-- session:abc123 --> in context but lack detailed memory:
get_session_status({ handoff: "abc123" })If no marker but a recent checkpoint exists (< 24h), the response includes:
{
"recovery": {
"available": true,
"id": "abc123",
"age": "2h"
}
}
Offer to restore: "Found recent work checkpoint. Resume?"
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SESSION RESTORED: {id} β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Task: {context.task} β
β Last active: {age} β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β RESTORED CONTEXT β
β β’ Plan: {plan.path} (cached) β
β β’ Files: {files.length} modified β
β β’ Decisions: {userDecisions.length} β
β β’ Todos: {todos.length} items β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β FRESH STATE β
β β’ Branch: {branch} ({uncommitted} uncommitted) β
β β’ Integrations: {detected integrations} β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Continuing from: "{nextSteps[0]}" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SESSION START β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Project: {project.root} β
β Branch: {branch} ({uncommitted} uncommitted) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Integrations: {list available} β
β Harness: {if present, show status} β
β Beads: {open} open | {actionable} actionable β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β {recommendations based on state} β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
After completing significant work, append a session marker to enable auto-recovery:
<!-- session:{handoff_id} -->
This marker survives autocompact summarization and enables seamless recovery.
The plugin auto-detects and enhances with:
| Integration | Detection | Enhancement |
|---|---|---|
| Git | Always | Branch, uncommitted, recent commits |
| Beads | .beads/ exists |
Issue triage, actionable work |
| Harness | .claude-harness/ exists |
Features, memory, loop state |
| Agent Mail | MCP configured | Inbox status, file reservations |
| Claude-Mem | MCP configured | Observation ID references |
Based on state, recommend next action:
nextSteps[0]/handoff - Create explicit checkpoint for session end/session-context:handoff - Same as above (full name)