Harness Notes

Transcripts

Updated 2026-11-25,

On this page

Where each harness keeps the record of past sessions, how to get back into one, and how to keep, export or remove them. Every record type and field inside a transcript is on the Transcript format page. Automatic notes carried between sessions are on the Memories page.

What is saved

QuestionCodex CLIchecked at 0.169.0
Where sessions are saved

Each session is one file at ~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<thread-id>.jsonl. Files are grouped by date, not by project; the working directory is recorded inside the file and the resume picker filters on it. Archived sessions move to the flat ~/.codex/archived_sessions/ directory. Setting CODEX_HOME moves both directories. sqlite_home or CODEX_SQLITE_HOME only moves the SQLite index databases (state_5.sqlite, thread_history_1.sqlite).

If CODEX_HOME is set, the directory must already exist.

Subagent and forked sessions

Each subagent gets its own rollout file in the same ~/.codex/sessions/YYYY/MM/DD/ tree. Its session_meta.source records subagent.thread_spawn with parent_thread_id, depth, agent_role and agent_nickname, and the parent-child link is also kept in the thread_spawn_edges table in state_5.sqlite. Forks are new files with forked_from_id set. At 0.164.0, non-ephemeral Auto-review (Guardian) reviewer sessions can also be saved in sessions/, but are internal reviewer sessions, not ordinary spawned subagents; temporary review forks are ephemeral. Archiving or deleting a parent also archives or deletes its spawned descendants. Use /subagents to open a child thread.

Ephemeral subagents are unsaved. Side-chat persistence is separate: temporary versus persisted attached chat depends on workspace, parent history and server capability.

Prompt history

Prompt history for Up/Down recall and Ctrl+R search is a separate file, ~/.codex/history.jsonl. Each line is {"session_id","ts","text"} and it holds only your submitted prompts, shared across all sessions. Turn it off with [history] persistence = "none", or cap its size with history.max_bytes; when the cap is exceeded, the oldest entries are dropped.

The docs call this file 'session transcripts', but full transcripts live in ~/.codex/sessions/.

Getting back to a session

QuestionCodex CLIchecked at 0.169.0
Resume or continue

Run codex resume to open a picker, codex resume --last to continue the most recent session in the current directory, or codex resume <SESSION_ID|name> for a specific one. Add --all to search outside the current directory and --include-non-interactive to include codex exec runs. Inside the TUI, use /resume. For scripts, use codex exec resume --last "<prompt>" or codex exec resume <SESSION_ID> "<prompt>". codex fork, codex exec fork or /fork copies a session into a new one.

When the saved working directory differs from the current one, Codex asks which to use. Set tui.resume_cwd = "current" or "session" to skip the question; -C overrides it.

Since 0.163.0, resuming a thread restores its permissions and network approvals, unless you override them or managed policy blocks them.

Find a past session

codex resume and /resume open a paginated picker of sessions in the current directory. Type to filter the loaded rows, press Tab to switch the filter to all directories or to archived sessions, and press Ctrl+E to preview a transcript. Give a session a name with /rename so codex resume <name> can find it. codex agents (or /agents) lists chats on the shared background server. Programs can call app-server thread/list, which supports searchTerm, cwd, archived and source filters.

Session names are kept in ~/.codex/session_index.jsonl, an append-only file where the latest entry wins.

Export or share

Partly

/export in the TUI exports the whole conversation as Markdown, either to the clipboard or to a file (/export session.md). /copy (or Ctrl+O) copies only the latest response. There is no HTML export and no share link for local sessions. To get JSON, copy the rollout .jsonl file or read the thread through the app-server API.

Wait for the current turn to finish before running /export.

Read sessions from code

The supported interface is codex app-server (JSON-RPC). thread/list, thread/read, thread/turns/list and thread/items/list read stored threads without resuming them; thread/resume, thread/fork, thread/archive and thread/delete manage them. codex exec --json streams JSONL events (thread.started with thread_id, item.*, turn.completed) for a live run. The TypeScript and Python SDKs can resume a thread by id, for example codex.resumeThread(threadId). You can also parse the rollout JSONL files directly, but they have no published schema.

codex app-server generate-json-schema and generate-ts (both experimental) emit the protocol types.

Keeping and removing

QuestionCodex CLIchecked at 0.169.0
How long they are kept

Partly

Session files are kept until you remove them; Codex never deletes them by age. codex archive <SESSION> or /archive moves a session to ~/.codex/archived_sessions and out of the picker, and codex unarchive restores it. codex delete <SESSION> or /delete permanently removes the transcript, its spawned subagent sessions and their metadata; --force skips the prompt but only accepts a UUID. Only the separate prompt history file is size-capped, via history.max_bytes.

If you delete files by hand, the SQLite index in state_5.sqlite can keep stale entries until the next listing scan repairs it. codex delete keeps both in sync.

Don't save this session

Partly

codex exec --ephemeral and App Server ephemeral threads avoid the local rollout. history.persistence=none controls prompt recall only. Side chats have two policies at 0.169.0: temporary chats are ephemeral; the opt-in terminal workspace can create persisted attached chats when a local paginated parent and server support permit it, with a temporary fallback. Do not assume every /side chat is unsaved.

The config reference describes history.persistence as controlling whether session transcripts are saved to history.jsonl. In practice it only gates prompt history, not the rollout files under sessions/.

Cloud sync and upload

Partly

LocalThreadStore writes local rollouts. A core host can inject another ThreadStore, and the TUI separately registers a native Cloud backend on supported platforms when its multi-backend feature and availability/policy checks pass. Cloud list/turn/item requests are adapted to native hosted operations; matching method names do not make this the local App Server transport or establish Cloud storage internals. No general absence of upload or sync is established across hosts.

ChatGPT Work local-thread sync is a separate ChatGPT Work feature; Codex keeps its own history.

Notes and sources

Codex CLI, 39 sources
  • Rollout JSONL is a harness-owned durable artifact, not a published compatibility API.
  • Prompt history.jsonl is a different artifact; history.persistence controls only that file.
  • 0.164.0 source refresh: resume lookup visits plain/compressed rollout filenames, and App Server restores persisted thread settings from turn context/settings events. Older format and storage claims retain their original source pins.
  • Automatic-approval findings specifically audited at rust-v0.164.0 / 6aaac694803004a63c6f393d153c96d22521a6b9 (2026-10-26); that historical baseline is retained in the 2026-11-15 evidence manifest, which separately refreshes the current local format.
  • 0.164.0 parent turn_context records preserve approval_policy and approvals_reviewer; the current writer fills approvals_reviewer, and persisted thread_settings_applied snapshots also carry it. This establishes the selected reviewer, not a per-action review outcome.
  • GuardianAssessment and GuardianWarning are transient and excluded from local rollout persistence. Do not treat missing guardian_assessment records in the parent transcript as evidence that no review occurred.
  • The registered reviewer creates sessions with session_meta.source = {internal: guardian} and thread_source = guardian_review. Non-ephemeral reviewer trunks use normal session persistence and can contain the reviewed action/context plus final JSON outcome, risk_level, user_authorization and rationale. Low-risk output can contain only outcome = allow; the parser supplies defaults.
  • A reviewer session can serve several reviews. Busy/incompatible reviews use ephemeral forks; an ephemeral parent also propagates its setting. Thus not every review has a saved reviewer transcript. These are internal sessions, distinct from ordinary subagent.thread_spawn lineage.
  • For live reviews capture App Server item/autoApprovalReview/started and item/autoApprovalReview/completed, correlating threadId, turnId, reviewId and targetItemId when present. They contain action and review status/risk/authorization/rationale, but are notifications, not durable transcript items; payload is marked unstable. codex exec --json drops unmatched notifications and is not this audit stream. See docs/research/automatic-approval.md.
  • Persistence conclusions apply to the ordinary local rollout store; desktop presentation, custom/cloud stores and hosted retention are not established by this source audit. No live classifier or transcript-production probe was run.
  • 2026-11-13 supplement, Codex rust-v0.167.2 at ce21072c90d32c40af7a55b60b2fb35c84a43a6a: assistant text can contain :codex-file-citation{path="…" purpose="source"}. This is inline message markup, not a new JSONL record or memory_citation field. The TUI assistant renderer interprets it; external transcript/App Server consumers need their own rendering. HTTPS paths are live-observed; the inspected TUI treats non-local paths as relative, so its destination logic is not a web-link contract. See docs/research/codex-file-citations.md and docs/research/evidence/codex-file-citations-2026-11-13.json. The original supplement did not refresh the full schema; the 2026-11-15 audit supplies the current local format pin.
  • 2026-11-15 source refresh: rust-v0.169.0 at d32063f96c2dff1dc96af839b3952abb6acfeda4. Source inspection, not a harness runtime probe. Historical supplements keep their independent evidence and dates.
  • Older user-facing resume/export/history instructions retain their dated documentation evidence; the 0.169.0 refresh audits the local storage writer, parser, reconstruction and host/provider boundary. It does not establish proprietary desktop behavior.
  • At 0.169.0 the opt-in terminal workspace can persist attached side chats; temporary chats remain ephemeral. The same /side UI action does not imply one storage policy across configurations.
Where sessions are saved, 5
Subagent and forked sessions, 8
Prompt history, 4
Resume or continue, 3
Find a past session, 4
Export or share, 2
Read sessions from code, 14
How long they are kept, 3
Don't save this session, 5
Cloud sync and upload, 4