Codex resume: finding the session, and the errors when it is not there
the picker filters by directory, hides codex exec runs and archived sessions, and resumes only what is on this disk
codex resume reopens a past Codex CLI session with its whole conversation. Most of the time the session you want is in the picker. When it is not, the reason is one of a short list, and each has its own fix. Commands and messages below are from codex-cli 0.149.0, run against a throwaway CODEX_HOME.
The commands
codex resume # picker: sessions started in this directory codex resume --all # every directory, with a CWD column codex resume --last # the most recent one, no picker codex resume <id-or-name> # one session by UUID or by its name codex resume --include-non-interactive # codex exec runs too codex fork # continue from a copy of an old session codex exec resume <id> "next step" # resume without the TUI, for scripts
A UUID takes precedence over a name when the argument parses as one.
The session is not in the picker
- It ran in another directory. The picker shows sessions started where you are.
codex resume --alllists all of them. Resuming by id works from any directory: a session started in one project resumed by id from another in the test. - It was a
codex execrun. Non-interactive sessions are left out of the picker and of--last. Add--include-non-interactive. - It is archived.
codex archivehides a session from the picker.codex unarchive <id>brings it back. - It is on another machine. Sessions are local files, nothing is synced. See below.
The errors
An archived session tells you what to do:
$ codex exec resume 01a0775d-a98d-7500-b4b5-943a1f3a35e3 "go on" Error: thread/resume: thread/resume failed: session 01a0775d-a98d-7500-b4b5-943a1f3a35e3 is archived. Run `codex unarchive 01a0775d-a98d-7500-b4b5-943a1f3a35e3` to unarchive it first. (code -32600)
A session with no file at all does not:
$ codex exec resume 3f2a9c1e-0000-4000-8000-000000000000 "go on" Error: thread/resume: thread/resume failed: no rollout found for thread id 3f2a9c1e-0000-4000-8000-000000000000 (code -32600)
A rollout is the session file, sessions/YYYY/MM/DD/rollout-<time>-<id>.jsonl under ${CODEX_HOME:-~/.codex}. No rollout means one of three things: the id is wrong, the session was removed with codex delete or rm, or this shell's CODEX_HOME points at a different tree than the one that wrote it. Check:
echo "${CODEX_HOME:-$HOME/.codex}"
find "${CODEX_HOME:-$HOME/.codex}" -name "rollout-*<id>*"
The find pattern matters: after seven days Codex compresses a rollout to rollout-….jsonl.zst, so a search for *.jsonl misses every session older than a week. Codex resumes either form.
And one that is not about the session: codex resume is a full-screen picker, so from a pipe, a CI job or an agent's own shell it stops with Error: stdin is not a terminal. Use codex exec resume <id> "prompt" there.
Resuming on another machine
There is no sync. A rollout copied to the same path under the other machine's CODEX_HOME is enough to resume it by id; in the test, a fresh CODEX_HOME holding nothing but the copied file resumed it:
scp laptop:.codex/sessions/2026/09/06/rollout-*01a0775d-a98d-7500-b4b5-943a1f3a35e3.jsonl \
~/.codex/sessions/2026/09/06/
codex resume 01a0775d-a98d-7500-b4b5-943a1f3a35e3
The rollout records the directory the session ran in, and the picker filters on it, so where the project lives at another path, use --all or the id.
Finding the id when you only remember what it was about
The picker shows titles and first messages; it does not search the conversations, and it knows only Codex. deja indexes the rollouts, compressed and archived ones included, with every other agent's history on the machine, and prints the command that reopens a session:
deja --harness codex "the flaky retry in the uploader" # ranked hits, each with its session id deja resume <id> # the codex resume command that reopens it deja resume <id> --write-back # a deleted session: write the rollout back first
--write-back is for a session deja indexed before Codex lost the file. It writes a rollout from what deja kept, the conversation turns, and needs to know the directory the session ran in; when it cannot find that, it says so rather than writing a rollout Codex would list in the wrong place. Tool calls and their output stay in deja. To install:
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh deja install --auto
The first index reads the history already on disk. Indexing and search run locally.
Codex CLI history · Deleting Codex sessions · Resuming a session in any agent · Across machines
Found this useful? Star deja-vu on GitHub.