Agent skill
start
Session startup with context recovery. USE WHEN starting session, after /clear, or recovering from autocompact.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/session-context
SKILL.md
/start - Session Startup & Context Recovery
Gather project context and recover from handoffs automatically.
Data Source Priority
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.
Quick Start (MCP Fallback)
// 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" })
Output Levels
| Level | Use Case | Sections |
|---|---|---|
minimal |
Context recovery | project, harness, beads counts |
standard |
Most session starts | + beads_triage, agentmail |
full |
Fresh session | + claude_mem references |
Auto-Recovery
The plugin tracks your work automatically via hooks. If context is lost (autocompact, /clear), recovery options appear:
Session Marker Detection
If you see a marker like <!-- session:abc123 --> in context but lack detailed memory:
- This means autocompact occurred mid-session
- Immediately call:
get_session_status({ handoff: "abc123" }) - The MCP returns full working context
- Resume work without asking user - just continue
Rolling Checkpoint
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?"
Display Format
Restored Session
┌─────────────────────────────────────────────────────────────────┐
│ 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]}" │
└─────────────────────────────────────────────────────────────────┘
Normal Session Start
┌─────────────────────────────────────────────────────────────────┐
│ 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} │
└─────────────────────────────────────────────────────────────────┘
Session Tracking
After completing significant work, append a session marker to enable auto-recovery:
<!-- session:{handoff_id} -->
This marker survives autocompact summarization and enables seamless recovery.
Integrations
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 |
Recommendations Logic
Based on state, recommend next action:
- Handoff recovered → Continue from
nextSteps[0] - Loop in_progress (harness) → Resume implementation
- Feature failing (harness) → Fix failing verification
- Issue in_progress (beads) → Continue that issue
- Actionable work (beads) → Show top picks
- No tracked work → Suggest adding work
Related Commands
/handoff- Create explicit checkpoint for session end/session-context:handoff- Same as above (full name)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?