How to resume a Codex session, and find old ones

Dmitriy Solodukha · checked against Caprock v0.140.1

Resume a Codex session with codex resume, --last or an ID, find old ones in ~/.codex/sessions, desktop app threads included, and continue them in Caprock.

Run codex resume to pick a past session from a list, or codex resume --last to reopen the most recent one in the folder you are in. To reopen a specific one, pass its ID: codex resume <SESSION_ID>. Every session, the desktop app's threads included, is a file under ~/.codex/sessions/.

Which codex resume command to run

Codex's resume commands, from codex-cli 0.161.0's help, OpenAI's developer commands page and codex-cli 0.163.0's source, read 20 October 2026.
You wantRun
The last session in this foldercodex resume --last
The last session anywherecodex resume --last --all
To browse past sessionscodex resume, or /resume inside Codex
A session you know by ID or namecodex resume <SESSION_ID>
A non-interactive codex exec runcodex exec resume --last
A copy to try another directioncodex fork, or /fork inside

codex resume takes the same options as codex itself, so codex resume --last -m <model> continues with a different model, and anything after the ID is sent as the next prompt: codex resume <SESSION_ID> "run the tests again".

Resume the last Codex session: codex resume --last

--last skips the picker and reopens the most recent session. It looks only at sessions started in the current folder; add --all to take the most recent from anywhere. Sessions started with codex exec do not count unless you add --include-non-interactive.

If the folder you are in is not the one the session ran in, Codex asks which of the two to use, unless tui.resume_cwd is set in config.toml.

Resume a specific session by ID

$ codex resume 01a120a6-e4a2-7440-ac83-f3bbbc58f4fa

The argument is a session ID (a UUID) or a session name; a UUID wins when the argument parses as one. The ID is the end of the transcript's file name, so the session above is rollout-2026-10-09T15-32-50-01a120a6-e4a2-7440-ac83-f3bbbc58f4fa.jsonl. Codex looks the ID up across all your sessions, so this works from any folder.

The Codex session picker

codex resume with no argument, or /resume inside a running Codex, opens the picker: the session's title and how long ago it was updated, newest first. Typing searches titles, first messages, IDs, branches and folders. These are the keys shown at the foot of it:

Keys in the codex resume picker, from codex-cli 0.163.0's source, read 20 October 2026.
KeyDoes
↑ ↓browse
Enterresume the highlighted session
Tabmove to the filter row
← →change the option there: Cwd or All, Active or Archived, Updated or Created
Ctrl+Tshow the session's transcript
Ctrl+Eexpand the session with its recent conversation
Ctrl+Oswitch between the dense and the comfortable list
Ctrl+Aarchive the session
Escstart a new session instead (inside Codex, close the picker)

Without --all the filter starts on Cwd, sessions from this folder. Archived sessions are hidden until you switch the status filter to Archived.

Where Codex keeps session history

Codex writes one JSONL file per session, appending as it goes, under CODEX_HOME, which defaults to ~/.codex:

  • *`sessions/YYYY/MM/DD/rollout-.jsonl`** — the full session: prompts, Codex's answers, tool calls and their output, token counts. Filed by the day it started.
  • archived_sessions/ — where codex archive and /archive move a session's file. codex unarchive <SESSION> brings it back.
  • history.jsonl — every prompt you typed, one line each with its session ID and time. history.persistence = "none" in config.toml turns it off, and history.max_bytes caps its size.

Codex's docs describe no automatic cleanup, unlike Claude Code's 30 days. An experimental feature, local_thread_store_compression (off by default in codex-cli 0.163.0), rewrites files untouched for seven days as rollout-….jsonl.zst; Codex still resumes them, but grep over ~/.codex/sessions no longer sees inside.

216
Codex transcripts on my machine, 9 October 2026
19 Sep 2025
the date of the oldest one still on disk
124
marked Codex Desktop, 117 of them imported Claude Code sessions

To find an old session by what was said in it, search the files:

$ grep -rl "rate limiter" ~/.codex/sessions
$ grep "rate limiter" ~/.codex/history.jsonl

The first gives the transcript, whose name ends in the ID to resume; the second gives the prompt with its session_id.

Desktop app threads in the CLI

The desktop app (now the ChatGPT desktop app) writes its threads into the same ~/.codex/sessions folder, marked in the first line with an originator such as "Codex Desktop" ("codex_work_desktop" on some newer threads). codex resume --all lists them beside CLI sessions, and codex resume <id> continues one in the terminal.

The picker also lists the Claude Code sessions the app imported, titled Imported session. On my machine they were 117 of the 124 transcripts marked Codex Desktop.

Archive or delete Codex sessions

codex archive <SESSION> hides a session from the picker and keeps its transcript. codex delete <SESSION> removes the transcript for good and asks first; --force skips the question and needs the UUID. Inside Codex, /archive and /delete do the same for the current session.

Every Codex thread in one list, with Caprock

Memory: what the agents wrote, newest first, each with its project and a link to the session. Example sessions.

Caprock is a free desktop app that reads every Codex transcript on the machine — CLI sessions, the desktop app's threads, archived and compressed ones — and shows them beside your Claude Code and OpenCode sessions:

  • Find it. Each Codex session carries the name Codex gave the thread, or its first message when it has none. In the app, ⌘K finds it by name; in the browser dashboard, tick "show ended sessions" on the Home screen and filter by agent.
  • Search what Codex wrote. Codex's answers go into Memory with Claude Code's, so one search covers both and links to the session.
  • Continue it. An ended Codex session offers continue here: Caprock runs codex resume <thread id> in a terminal tab, in the session's folder. Copy command gives you cd "<folder>" && codex resume <id> for your own terminal.
  • What it cost. Each session's tokens, priced from OpenAI's list prices, in the same table as Claude Code (Codex usage and cost).

What it does not do:

  • A session that is still running is not continued. Two processes on one transcript would interleave, and a fork copies the history with its tokens, so Caprock waits until the session has ended.
  • Imported threads are left out. A Claude Code session the desktop app imported is already in Caprock from Claude Code's own transcript.
  • A folder that is gone drops the cd from the command: Codex finds a thread by ID from anywhere.

Codex session tools compared

  • codex resume — built in, Codex only; the picker searches titles, first messages, IDs, branches and folders, not the transcript. Use it when you work in Codex alone.
  • showagent — an open-source terminal picker over Codex, Claude Code, Gemini CLI, OpenCode and others; it searches agents, session IDs, paths and the first and latest prompts, not the full transcript, and can copy a conversation into another agent. Use it to move a session between agents.
  • Caprock — a desktop app that records every session on the machine, searches what the agents wrote, prices it, and continues an ended one in a tab. Use it when Codex is one of several agents you run. For Claude Code's side, see resuming Claude Code sessions. Install Caprock.

Questions people ask

How do I resume a Codex session?
Run codex resume to pick one from a list, codex resume --last for the most recent one in this folder, or codex resume <SESSION_ID> for a specific one. Inside Codex, /resume opens the same picker.
How do I see all my Codex sessions?
Run codex resume --all. Without --all the picker shows only sessions from the current folder; Tab moves to the filter row, where you can also switch to archived sessions.
Where does Codex store session history?
Each session is a JSONL file under ~/.codex/sessions/YYYY/MM/DD/, named rollout-<date>T<time>-<session id>.jsonl. Archived ones move to ~/.codex/archived_sessions/. The prompts you typed are also in ~/.codex/history.jsonl.
How do I resume a codex exec session?
Run codex exec resume --last or codex exec resume <SESSION_ID>, optionally with a follow-up prompt. codex resume leaves exec sessions out unless you add --include-non-interactive.
Can I resume a Codex desktop app thread in the CLI?
Yes. The app writes its threads into the same ~/.codex/sessions folder, and codex resume --all lists them beside CLI sessions.
Does Codex delete old sessions?
Codex's docs describe no automatic cleanup; on the author's machine the oldest of 216 transcripts was from 19 September 2025. With the experimental local_thread_store_compression feature on (off by default), a rollout untouched for seven days is compressed to .jsonl.zst, which Codex still resumes.

Sources