session_primer
Restore previous session context by reading the most recent handoff primer at session start.
Instructions
Read the most recent session handoff primer to restore context from the previous session. Call at session start.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- adapters/mcp/server-stdio.js:448-452 (handler)The handler implementation for session_primer which calls readSessionHandoff.
case 'session_primer': { const primer = readSessionHandoff(); if (!primer) return toTextResult({ message: 'No session primer found. This is the first session.' }); return toTextResult(primer); } - scripts/contextfs.js:882-890 (helper)Helper function that actually reads the primer.json file.
function readSessionHandoff() { const primerPath = path.join(CONTEXTFS_ROOT, NAMESPACES.session, 'primer.json'); if (!fs.existsSync(primerPath)) return null; try { return JSON.parse(fs.readFileSync(primerPath, 'utf8')); } catch (_) { return null; } } - scripts/tool-registry.js:483-490 (registration)Tool registration for session_primer.
readOnlyTool({ name: 'session_primer', description: 'Read the most recent session handoff primer to restore context from the previous session. Call at session start.', inputSchema: { type: 'object', properties: {}, }, }),