A session's state lives in an append-only event log inside a Durable
Object, backed by SQLite — not in the harness process's memory. That
one design choice is what makes multi-hour runs safe.
Crash recovery by construction
If the harness crashes mid-turn, the session catches the error,
emits session.error, and returns to idle. The next message spins
up a fresh harness that reads the full event log and continues —
no re-prompting, no lost context.
Structured progress heartbeats
agent.status events carry state, a summary, step/total_steps, and
blocked_on — a machine-readable signal, not just free-text
messages. The Console Agent → Monitor tab renders the live step
bar, blocked-on warning, and heartbeat log. Purely observational,
excluded from model context, so it never perturbs the prompt cache.
Two ways to drive the loop
Use the built-in harness for context-engineered tool loops, or the
claude-agent-sdk harness to run Claude Code itself inside the
sandbox — same event log, same recovery, same heartbeats either
way.