Skip to content

harn checkpoint

harn checkpoint status
harn checkpoint create
harn checkpoint show

Harnery also keeps a bounded, structured record of work state around native context compaction. When a supported adapter fires its pre-compaction event, Harnery automatically records the current task, turn summary, touched files, last tool, reported context usage, and Git state. After compaction it compares that snapshot with the live checkout and injects a recovery briefing through the adapter’s context channel.

This preserves external work state; it does not initiate the adapter’s native compaction command.

Terminal window
harn checkpoint status
harn checkpoint status --json
harn checkpoint status --session <session-id> --instance <instance-id>

Shows the session’s continuity phase (observing, checkpointed, recovered, or degraded), capsule generation, latest reported usage, and capsule path. The current agent and session are inferred from Harnery’s heartbeat when the flags are omitted.

Terminal window
harn checkpoint create
harn checkpoint create --note "Resume the adapter test failure investigation"
harn checkpoint create --reason pressure --json
harn checkpoint create --session <id> --instance <id> --adapter codex

Creates a capsule immediately. --reason accepts manual, pressure, pre_compact, or session_end; ordinary operator-created checkpoints should use the default manual reason. The optional note is included in the recovery briefing. When there is no current heartbeat to identify the runtime, pass --adapter claude-code|codex|cursor explicitly.

Terminal window
harn checkpoint show
harn checkpoint show --json

Prints the latest structured capsule. Capsule files live under .harnery/context/<session-hash>/capsules/, are written atomically with mode 0600, and are capped at 32 KiB.

Claude Code currently checkpoints on PreCompact and recovers on compact SessionStart. Codex checkpoints on PreCompact, observes PostCompact, and injects recovery at the next prompt boundary. Cursor compaction hooks remain disabled until a native lifecycle is verified.