article feature

Sessions: append-only JSONL trees and recovery

Every session writes an append-only JSONL transcript that records messages, compaction summaries, and tree entries. You can fork before a user message, clone at the current leaf, import JSONL, or resume by path or ID. Kernel snapshots and child registries can be restored after worker restart.

v v0.7.1reviewed 2026-08-09evidence code-derivedsources S013, S014, S010cutoff 2026-08-09
Troubleshooting

Pinned repository file/line or test referenced in the audit.

Append-only JSONL

A session is recorded as append-only JSONL rather than as an ephemeral chat buffer. Entries capture the developing transcript, including messages, compaction summaries, and information used to represent the session tree.

Append-only storage preserves the sequence needed for review and recovery. It also means the file may contain local paths, generated code, or secrets and should be protected like other sensitive work artifacts.

Session tree

Session history is navigable as a tree, allowing branches to preserve different continuations from a shared earlier point. Child sessions created for recursive work also fit into this durable hierarchy.

The tree records lineage; it does not merge divergent state automatically. When branches produce different edits or conclusions, the operator or parent agent must choose how to reconcile them.

Fork and clone

Forking creates a branch before a selected user message, which is useful when the next instruction should be reconsidered from an earlier state. Cloning copies the session at its current leaf for a new continuation.

Both operations preserve the original path rather than rewriting it. The distinction is where the new branch begins: before a prior user turn for a fork, or at the current endpoint for a clone.

Resume and import

A stored session can be resumed by path or ID, and an existing JSONL transcript can be imported. On worker recovery, the transcript, child registry, and available kernel snapshot provide the durable inputs for reconstruction.

Resume depends on readable artifacts and compatible runtime schemas. A transcript from a different major protocol or package state should be backed up before attempting recovery.

Export and share

Export turns session history into a portable artifact for inspection or transfer. Sharing through a GitHub Gist creates an external copy and requires GitHub authentication.

Review and redact the transcript before either operation. Exporting does not remove sensitive paths, credentials, prompts, or generated code merely because the destination is convenient to share.