How to resume a Codex session, and find old ones
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
| You want | Run |
|---|---|
| The last session in this folder | codex resume --last |
| The last session anywhere | codex resume --last --all |
| To browse past sessions | codex resume, or /resume inside Codex |
| A session you know by ID or name | codex resume <SESSION_ID> |
A non-interactive codex exec run | codex exec resume --last |
| A copy to try another direction | codex 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:
| Key | Does |
|---|---|
↑ ↓ | browse |
Enter | resume the highlighted session |
Tab | move to the filter row |
← → | change the option there: Cwd or All, Active or Archived, Updated or Created |
Ctrl+T | show the session's transcript |
Ctrl+E | expand the session with its recent conversation |
Ctrl+O | switch between the dense and the comfortable list |
Ctrl+A | archive the session |
Esc | start 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/— wherecodex archiveand/archivemove 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"inconfig.tomlturns it off, andhistory.max_bytescaps 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
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 youcd "<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
cdfrom 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
- codex --help, codex resume --help, codex exec resume --help, codex fork --help, codex archive --help, codex delete --help, codex-cli 0.161.0, read 9 October 2026
- Codex docs — Developer commands: codex resume, codex exec resume, codex fork, codex archive and unarchive, codex delete, read 9 October 2026
- Codex docs — CLI slash commands: /resume, /fork, /new, /archive, /delete, read 20 October 2026
- Codex docs — Configuration reference: history.persistence, history.max_bytes, read 9 October 2026
- Codex docs — Environment variables (CODEX_HOME)
- Codex source — sessions/YYYY/MM/DD and archived_sessions (codex-rs/rollout/src/recorder.rs, lib.rs), read 9 October 2026
- Codex source — the sessions the resume picker counts as interactive: cli and vscode among them (codex-rs/rollout/src/lib.rs), read 9 October 2026
- Codex source — rollouts untouched for seven days compressed to .jsonl.zst and read back transparently, when the local_thread_store_compression feature is on (codex-rs/rollout/src/compression.rs), read 9 October 2026
- Codex source — local_thread_store_compression: under development, off by default (codex-rs/features/src/lib.rs), read 9 October 2026
- Codex source — what the resume picker searches: title, first message, ID, branch, folder (codex-rs/tui/src/resume_picker.rs), read 9 October 2026
- Codex source at rust-v0.163.0 — codex resume and codex delete arguments (cli/src/main.rs), the picker's footer keys (tui/src/resume_picker.rs), local_thread_store_compression still under development and off (features/src/lib.rs), read 20 October 2026
- OpenAI docs — the ChatGPT desktop app, which developers.openai.com/codex/app redirects to
- aytzey/showagent — README, read 20 October 2026
- Caprock source — continue an ended Codex session by its thread id, or say why not (internal/api/resume.go)
- Caprock source — codex resume <thread id> with --no-daemon in a Caprock terminal (internal/agents/argv.go)
- Caprock source — reading every rollout, archived and .jsonl.zst included (internal/codex/codex.go)
- Caprock spec — Codex support: names, imported threads, prose in Memory, resume (.ai/19-codex.md)
- Caprock UI spec — Continue, and why not (.ai/04-ui.md)
Try it
The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.
Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.
Or run it yourself:
Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app