Skip to content

Codex

Codex CLI, the Codex desktop app, and Codex SDK runs share provider storage but represent different kinds of work. Import all three local source IDs for a complete history; use the cloud command only for explicit Codex cloud tasks.

Source Use it for
codex-cli Interactive terminal sessions.
codex-desktop Sessions created in the Codex desktop app.
codex-sdk Codex exec and SDK runs, including delegated runs and one-shot jobs.
codex-cloud Explicit, read-only import of Codex cloud task records through the signed-in Codex CLI.

The local Codex importers read the Codex session index and rollout JSONL files. They group events by the provider’s stable thread identifier, then reconstruct user and assistant messages, reasoning, tool calls and results, approvals, settings, model information, and usage in event order. The recorded origin of the thread determines whether it appears as CLI, desktop, or SDK history. Delegated and one-shot SDK runs remain identifiable, and subagent threads are archived separately with their parent relationship.

Running a local importer again refreshes the same thread instead of making a copy. The codex-cloud importer follows a deliberately narrower path: it asks the signed-in Codex CLI for cloud task records and their unified diffs. That interface does not return a full transcript, tool trace, model, or token usage, so Hansard stores only the task data actually provided and does not infer the missing conversation from the diff.

Terminal window
hansard import --sources codex-cli,codex-desktop,codex-sdk --since all
hansard index rebuild

Import cloud tasks separately when they are needed:

Terminal window
hansard import codex-cloud --since all

After the import finishes, open Conversations and selectFilter & sort. Set Source tothe matching Codex CLI, Desktop, SDK jobs, or cloud tasks source, choose the backfill window underTime, and use Folder when the same harness appears in several projects. Select a result to inspect its messages, tool calls and results, files, commits, model and usage fields, and source provenance in one conversation view.

For a local source that should stay current, open Settings → Indexing & Imports. Automatic follows detected local harnesses; Custom lets Sources scannedselect an explicit set. Explicit cloud and account-export sources do not turn into background network jobs here. If the expected result is absent after resetting the conversation filters, return to the terminal import in this guide and add --explain-skips where supported.

  • User and assistant turns, reasoning, tool calls and results, shell commands, file changes, and provider usage when recorded.
  • Collaboration mode, model, reasoning effort, approvals, sandbox and network settings, task latency, failures, context-window samples, and quota samples.
  • Linked subagent runs and timestamped subagent activity.
  • Explicit session names when available, with bounded title inference for raw prompt echoes or opaque provider names.
  • One-shot SDK jobs remain searchable but are separated from human-conversation statistics. Delegated SDK work counts only when it has substantive activity.
  • Codex cloud exposes the task record and unified diff, not a conversation transcript. Those imports therefore have no reconstructed turns or tools.
  • A missing cloud task cannot be recovered from a local rollout unless the provider stored a matching local session.

Importer changes require the original Codex state and rollout files:

Terminal window
hansard import --sources codex-cli,codex-desktop,codex-sdk --since all
hansard index rebuild

Use hansard rebuild only for derived views and metadata; it does not reread the Codex source files.