Session Continuity Protocol Signet is building a Session Continuity Protocol to prevent AI coding assistants from losing context when their window limits are hit. The system uses passive checkpoints, agent-initiated digests, and pre-compaction hooks to preserve session state, with recovery injection on new sessions. A new session_checkpoints table stores ephemeral state separately from long-term memories. Session Continuity Protocol Context When AI coding assistants hit their context window limit, they compact/summarize the conversation and lose nuance — decisions, state, reasoning. The agent “forgets” mid-task. Signet already sits as an external memory layer. This feature makes it catch what the compactor drops, so agents can survive their own context window dying. Three components: rolling session digest , context offload hook , and session recovery . Architecture Overview Two data channels feed checkpoints: Passive accumulation all platforms — daemon observes search queries from user-prompt-submit and /remember calls, writes structural checkpoints every N prompts Agent-initiated digest all platforms via MCP, Phase 2 — session digest MCP tool lets the agent write a rich narrative checkpoint with decisions, state, blockers Passive channel automatic : user-prompt-submit fires → daemon accumulates queries + /remember calls in continuity-state → every N prompts: buffer checkpoint write batched, not per-prompt Active channel agent-initiated via MCP, Phase 2 : agent calls session digest tool → daemon writes rich narrative checkpoint with agent-provided summary Pre-compaction Phase 3 : pre-compaction hook fires → daemon writes emergency checkpoint with sessionContext Recovery automatic : session-start fires → daemon checks for recent checkpoints matching this project → if found: inject latest checkpoint in pre-reserved budget section Phased Rollout Phase 1 : schema + sessionKey plumbing + passive checkpoints + recovery injection + API Phase 2 : MCP session digest tool + agent instruction updates Phase 3 : pre-compaction enrichment + pruning policy tuning + scorer integration Data Model New migration 016-session-checkpoints.ts : CREATE TABLE IF NOT EXISTS session checkpoints id TEXT PRIMARY KEY, session key TEXT NOT NULL, harness TEXT NOT NULL, project TEXT, project normalized TEXT, -- realpath-resolved for matching trigger TEXT NOT NULL, -- 'periodic' | 'pre compaction' | 'agent' | 'explicit' digest TEXT NOT NULL, prompt count INTEGER NOT NULL, memory queries TEXT, -- JSON: recent search terms recent remembers TEXT, -- JSON: recent /remember content created at TEXT NOT NULL ; CREATE INDEX IF NOT EXISTS idx checkpoints session ON session checkpoints session key, created at DESC ; CREATE INDEX IF NOT EXISTS idx checkpoints project ON session checkpoints project normalized, created at DESC ; Changes from original: Dropped — avoids race condition on concurrent writes. Use sequence column and UNIQUE constraint created at DESC ordering instead. Each checkpoint is uniquely identified by id UUID . No sequence math needed. Added — project normalized realpath -resolved project path for reliable matching across symlinks/aliases. Raw project kept for display. Why a new table instead of memories : checkpoints are ephemeral session state with a different lifecycle hours not weeks , different query patterns lookup by session/project not FTS/vector , different retention. Mixing them would pollute the scoring/decay pipeline. Implementation 0. SessionKey plumbing fix: CLI hooks + daemon This is the prerequisite. Currently, the CLI hook commands signet hook session-start , user-prompt-submit , session-end , pre-compaction don’t parse or forward session id from stdin. Claude Code sends it as a common field on all hook events ref: Claude Code hooks docs https://code.claude.com/docs/en/hooks . CLI changes surfaces/cli/src/cli.ts : - In each hook command’s stdin parser, extract session id or sessionId - Forward as sessionKey in the POST body to the daemon - All hooks already accept sessionKey on the daemon side — this just connects the pipe Stdin JSON from Claude Code common fields on all hooks : { "session id": "abc123", "transcript path": "/path/to/transcript.jsonl", "cwd": "/path/to/project", "permission mode": "default", "hook event name": "UserPromptSubmit" } 1. Migration: platform/core/src/migrations/016-session-checkpoints.ts Create the table + indexes above. Register in migrations/index.ts . 2. Continuity state module: platform/daemon/src/continuity-state.ts New file. Separate from session-tracker.ts which stays focused on runtime claim mutex . This module tracks per-session accumulation state for checkpointing. interface ContinuityState { readonly sessionKey: string; readonly harness: string; readonly project: string | undefined; readonly projectNormalized: string | undefined; promptCount: number; lastCheckpointAt: number; pendingQueries: string ; // capped at 20 pendingRemembers: string ; // capped at 10 startedAt: number; } const state = new Map