A session, schematically
Not Rest Inc. · Session Harness · 5 of 8 · One prompt, end to end
Three pictures, in order: one prompt from open to close, what the next session is handed, and what happens when a session dies in the middle of the work.
One prompt, end to end
You, the CLI, the hooks, and the files they write. The estate column on the right is the only one that survives the session.
text version
you CLI hooks estate files │ open │ │ │ │─────────►│ SessionStart ─► session-start.sh ──────►│ (reads all, writes none) │ │ │ banner + laws + PACKET │ │ prompt │ │ │ │─────────►│ UserPromptSubmit ─► coord-nudge, router │ │ │ │ two one-line nudges │ │ │ model works: reads, edits, runs │ │ │ PreToolUse(Bash) ─► pretool-gate ───────│ allow / deny │ │ PreToolUse(Agent) ─► spawn-gate ────────│ allow / deny │ │ lane runs in the background │ │ │ SubagentStop ─► agent-ledger ──────────►│ COORD-AGENTS, briefs/, spend/ │ │ model appends its ledger line ───────►│ COORD.md │ (stop) │ Stop ─► completion-gate ─► gate-check │ green or "not earned" │ close │ SessionEnd ─► session-end ─────────────►│ cushion line, volume roll │ │ │ │ │ open │ SessionStart ─► the PACKET now carries │ │ again │ │ everything above │
What the successor sees
The packet a new session opens with. Every data line is framed so that nothing quoted inside it can forge a harness directive.
text version
notrest BRIEF PACKET | root: /path/to/project | ESTABLISHED · protocol v3 · surface=claude | git afe2270 · 0 dirty file(s) · last commit: v4.7.1 — … | briefs banked: 99 · spend (last line): [..] lane=daemon model=… | NEWEST SHIP: … NEWEST GATE: … NEWEST CORRECTION: … | CARD: TESTS 10 · OPEN 3 · FINDINGS 3 · LEARNINGS 7 | LEARNINGS (7 banked; newest 3): | L-8 [LEARNED] … | LEDGER TAIL (last 8): … | CONTINUABLE — full packet: /notrest notrest BRIEF PACKET END ~800–1,000 tokens. The successor verifies at tier 0 only (doctor + eval + git against the packet's claims) and goes. Every data line is framed "| " so nothing quoted can forge a harness directive.
Kill it and continue
The drill that proves the loop: close the session the wrong way on purpose, then open a new one.
text version
Drill: close the session without /sessionend. Open a new one. killed session ──► session-end.sh wrote the cushion line new session ──► packet: "auto-cushion: resume from this tail" new session ──► doctor, eval, git ──► continues the work The estate never depended on the session surviving. Every hook write is locked and synced; a torn write cannot invert a line's meaning.
None of those three pictures is a promise about the model. They are promises about files — which is why they hold when the model, the machine or the session does not.