Sessions

Workspace-scoped portable history and detached session runners.

Identity

Session ids are generated by tny, opaque, and unique per workspace. The list is workspace-scoped by default (--all for every workspace).

$tny -r
$tny resume last
$tny resume <id>
$tny ask --resume last "continue"

On disk

~/.tny/sessions/<workspace-hash>/<id>/
  session.json      # metadata, messages, tool steps (redacted)
  results/          # large tool-result blobs
  recovery.json     # partial assistant text + last event offset

session.json never stores API keys or MCP header values.

Session mapping

Host backends store their own threads. tny keeps a thin local alias so tny resume last still works.

BackendStored pointer
openaifull transcript

Compaction

After eight completed turns on the native loop, the latest four stay verbatim and older turns become a structured summary. /compact forces condensation of everything before the latest turn. The on-disk transcript stays intact; only the model view shrinks.

Recovery

Streaming text and tool progress persist continuously. /continue and tny ask --resume last --continue-recovery replay from recovery.json. tny session recover <id> copies a corrupt session. tny doctor prints the recover command when it can fix a file.