Help us improve
Share bugs, ideas, or general feedback.
Session continuity and context recovery for Claude Code
npx claudepluginhub sethyanow/session-contextSession continuity and context recovery for Claude Code. Auto-tracks your work via hooks, survives autocompact, and generates rich continuation prompts.
Share bugs, ideas, or general feedback.
Session continuity and context recovery for Claude Code. Auto-tracks your work via hooks, survives autocompact, and generates rich continuation prompts.
Note: this is an experimental plugin born from my config. It does work pretty well, but beware of bugs.
/handoff for seamless continuation/start gathers project state and can restore from handoffs# Add the marketplace (one-time setup)
/plugin marketplace add sethyanow/session-context
# Install the plugin
/plugin install session-context@sethyanow
/start - Session StartupGather project context and recover from previous sessions.
/start # Normal session start
/start handoff=abc # Restore specific handoff
/handoff - Create CheckpointCreate an explicit checkpoint before ending a session or when context is low.
/handoff
This generates a continuation prompt you can paste into your next session.
At session start, the plugin's SessionStart hook automatically gathers and injects session context directly into the conversation. This means:
/start runsThe hook gathers:
.beads/ exists).claude-harness/ exists)When you run /start, it uses this pre-loaded data directly instead of calling the MCP.
The plugin installs hooks that capture your work:
| Hook | Trigger | Captures |
|---|---|---|
dot-start-handler.ts | SessionStart | Pre-loads session context |
track-edit.ts | Edit, Write, NotebookEdit | Modified file paths |
track-todos.ts | TodoWrite | Current todo list |
track-plan.ts | ExitPlanMode | Full plan content |
track-qa.ts | AskUserQuestion | User decisions |
Data is stored in ~/.claude/session-context/handoffs/.
/handoffThe continuation prompt includes a session marker:
<!-- session:abc123 -->
This marker survives Claude's context summarization. When detected after autocompact, the plugin automatically loads full context from storage.
The plugin provides three MCP tools:
get_session_statusGather session startup data with optional handoff recovery.
Note: Session data is typically pre-loaded by the
SessionStarthook, making this call unnecessary for normal startup. Use this MCP tool as a fallback or when you need to restore a specific handoff.
get_session_status({
level: "full", // minimal | standard | full
handoff: "abc123" // Optional: restore specific handoff
})
Levels:
minimal: project, harness, beads countsstandard: + beads_triage, agentmailfull: + skill_usage, claude_mem referencescreate_handoffCreate explicit checkpoint with continuation prompt.
create_handoff({
task: "Implementing user auth",
summary: "Added login endpoint, working on JWT",
nextSteps: ["Add token refresh", "Write tests"],
decisions: ["Using JWT over sessions"],
blockers: []
})
update_checkpointUpdate rolling checkpoint (called by hooks).
update_checkpoint({
files: ["src/auth.ts"],
todos: [...],
plan: { path: "...", content: "..." }
})
The plugin auto-detects and enhances with optional integrations:
| Integration | Detection | Enhancement |
|---|---|---|
| Git | Always | Branch, uncommitted, recent commits |
| Beads | .beads/ exists | Issue triage, actionable work |
| Claude Harness | .claude-harness/ exists | Features, memory, loop state |
| Agent Mail | MCP configured | Inbox status, file reservations |
| Claude-Mem | MCP configured | Observation ID references |
Create ~/.claude/session-context/config.json: