OpenAI’s Codex CLI keeps a local record of every session as JSONL rollout files in your home directory, organised by date. The format is not formally documented, so this page records the layout as observed on real installations in August 2026; we maintain an open-source adapter that reads these files, which keeps the details verified against current versions.
One file per session, filed under the date the session started. Note the organising principle: sessions are grouped by date, not by project. Nothing in the path tells you which repository a session belongs to, which is the first thing to know if you are trying to collect the history of one particular project.
The mapping is inside each file. The first line is a session_meta record whose payload.cwd field holds the working directory the session ran in. Finding all sessions for a project therefore means walking the whole tree and checking the first line of every file:
On Windows the comparison should be case-insensitive, since the recorded cwd and the path you type rarely agree on casing.
After the metadata line, the conversation arrives as response_item records. The ones that carry actual messages have payload.type set to message, a role and a content array whose input_text and output_text blocks hold the prose. Interleaved with them are reasoning records, tool calls and event lines, which a transcript reader skips.
One role deserves a warning: developer. Lines with that role are instructions the CLI injected into the model’s context, not anything a human typed. A naive transcript reconstruction that treats them as conversation will attribute the tool’s own scaffolding to you, so keep only user and assistant messages when rebuilding what was actually said.
Sessions with no conversation exist too. A session you opened and abandoned still writes a rollout file containing metadata and events but no messages, so a reader should tolerate empty results rather than treating them as errors.
There is no equivalent for the ChatGPT desktop or web apps. Those conversations are stored in OpenAI’s cloud, are not scoped to a project or working directory, and leave nothing on disk that a tool could read. If your build history happened in the ChatGPT app, it is effectively unrecoverable as structured data; the Codex CLI is the surface that keeps a local, per-project record.
The format is undocumented and can change between releases, so scripts built on it need re-checking after upgrades. And like any agent transcript, rollout files contain everything that entered the session, including any secrets pasted during debugging. Treat them as confidential, and redact before sharing.
If the goal is a handover or an audit rather than spelunking, the collection is automated. The Mantyl CLI walks the sessions tree, matches sessions to your project by their recorded working directory, keeps only the real conversation, and runs every message through secret redaction before anything is written. The extracted claims and decisions land in a project passport with each entry labelled by its evidence, and the same run reads Claude Code and Cursor history alongside. The support matrix is in the agents documentation.