Codex CLI guide: resuming a session

How to resume a Codex CLI session

Codex takes the opposite approach to Claude. Rather than resuming once when a process starts, it resumes the thread before every single turn. That is slower on a long conversation and it buys something real: the session can never be out of date.

OpenAI

On Codex CLI

Resume runs before every turn

A Codex client re-establishes the thread each time you send a message. Nothing carries over implicitly between turns, so nothing can go stale between them either.

That is how terminal work is picked up

Because the thread is re-read every turn, work you did in the terminal between two browser messages is already there. Claude needs a process restart for the same thing.

It needs the working directory

Resuming takes a thread id and the working directory together. A thread resumed against the wrong directory is not the same session, which is why a moved project can look like lost history.

Long threads get slow

The cost scales with the conversation, so resuming is the slow part of a turn on a thread with a long history. It is worth a much longer timeout than a normal request, and it is the usual explanation for a Codex turn that seems to hang before it starts.

Rollouts resolve by id

The stored rollout is filed by date rather than by project, so a resume is always keyed on the session id. There is no path you can compute from the project directory.

Compare

How each engine picks a conversation back up

 Claude CodeCodex CLIGrok CLI
Resume mechanismA flag on the next runAn explicit resume callSession state re-read per turn
HappensOnce, at process startBefore every turnBefore every turn
Picks up terminal editsAt the next process startYes, every turnYes, every turn
Identified bySession idThread id plus working directorySession id
Cost of resumingCheapCan be slow on a long threadCheap

Termdeck drives all three from one console, so the differences above stop being three separate habits to remember.

FAQ

Codex CLI resuming a session, answered

Why is my Codex turn slow to start?

Codex resumes the whole thread before every turn, and that cost grows with the length of the conversation. The delay lands before the first token rather than during the response, which is why it reads as a hang rather than as slowness.

Does Codex see work I did in the terminal?

Yes. Because the thread is resumed before every turn rather than once at process start, anything appended to the rollout between two messages is picked up on the next one.

Do I need the original working directory to resume?

Yes. A resume takes the thread id and the working directory together. Resuming against a different directory does not restore the same session, so a moved or renamed project looks like missing history.

Can I resume a compressed rollout?

Yes. Codex compresses older rollouts to .jsonl.zst in place and reads them back transparently. Only a third-party tool that looks solely for the .jsonl extension will fail to find them.