harn checkpoint
harn checkpoint statusharn checkpoint createharn checkpoint showHarnery 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.
Status
Section titled “Status”harn checkpoint statusharn checkpoint status --jsonharn 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.
Create a capsule
Section titled “Create a capsule”harn checkpoint createharn checkpoint create --note "Resume the adapter test failure investigation"harn checkpoint create --reason pressure --jsonharn checkpoint create --session <id> --instance <id> --adapter codexCreates 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.
Show the latest capsule
Section titled “Show the latest capsule”harn checkpoint showharn checkpoint show --jsonPrints 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.