Coming soon LLMnesia Pro See where every project stands, across all your AIs. Join the waitlist

How-To

How to Find an Old Codex Session

Pick the session from codex resume, or search the ~/.codex/sessions rollout files by a phrase you remember. Every method, step by step.

To find an old Codex session, run codex resume and pick it from the list, or dig through the session files under ~/.codex/sessions/. The picker is fastest when you remember roughly when the session ran; the files win when you only remember what was said. Here is every method, in the order worth trying.

Method 1: The resume picker

From the directory you were working in, run:

codex resume

This lists recent sessions by their thread names, with dates. codex resume --last jumps straight into the most recent session, and passing a session ID opens that exact one. The same picker shows sessions started from the CLI, the IDE extension, and the ChatGPT desktop app's Codex mode, because all of them write to the same folder.

If you do not see the session you expect, check the machine and the user account: rollout files live in the home directory of whatever computer ran the session, so a session started elsewhere stays elsewhere.

Method 2: The session files, by date

Open ~/.codex/sessions/. Sessions are grouped into YYYY/MM/DD subfolders by the date they started, each stored as one rollout-<timestamp>-<uuid>.jsonl file. Sessions record the project directory they ran in, so worktree checkouts get their own entries. The sibling file ~/.codex/session_index.jsonl maps session IDs to the thread names shown in the picker, which makes matching a file to a session much easier than reading raw JSONL.

The full layout of the folder, including platform paths and what is inside each file, is covered in the Codex session history storage guide.

Method 3: Search by what was said

The pickers list sessions by name and date, not content. If you only remember a phrase from the conversation, search the rollout files directly. On macOS or Linux, with ripgrep installed:

rg -il --glob '*.jsonl' -- 'phrase you remember' ~/.codex/sessions

This lists matching filenames. One caveat: a rollout file records tool calls, tool output and reasoning records alongside your prompts and Codex's replies, so a raw text match is not always real conversation text.

Method 4: A searchable local copy

For repeat searches, import the ~/.codex/sessions folder into LLMnesia. It indexes your prompts and Codex's replies, separated from the machinery, alongside your browser AI chats, so you can search by any phrase and then jump to the session or resume it. The Claude Code conversation guide walks through the same routine for Claude Code.

If the session is gone

There is no account-side archive of local Codex CLI sessions: deleting files under ~/.codex/sessions deletes that history. If a session vanished, first rule out the boring causes, the wrong machine, the wrong user account, a worktree you have not reopened, then accept that the rollout file may be gone. A local indexed copy, made before you needed it, is the only reliable protection; see the storage guide for how to back the folder up.

How do I find an old Codex session?

Run codex resume to pick from recent sessions, or look through the rollout files under ~/.codex/sessions, grouped by the date the session started. The companion file ~/.codex/session_index.jsonl maps session IDs to the thread names shown in the picker, which helps match a file to the session you remember.

How do I continue a session from last week?

Run codex resume --last to continue the most recent session, or codex resume with a session ID to open an older one directly. Resume from the same machine and user account that started the session: the rollout files are local.

Why is my session not in the resume picker?

The usual causes are being on a different machine or user account, the session being started in a directory you have not returned to, or the rollout file having been deleted. There is no account-side archive of local CLI sessions to restore from.

Can I search old Codex sessions by what was said?

Not natively; the resume pickers list sessions by name and date. You can grep the rollout files for a phrase, though raw matches can come from tool output rather than conversation text. A local indexed copy separates the conversation from the machinery.

Does it matter whether I used the CLI, the IDE extension, or the desktop app?

No. All three surfaces write their sessions to the same ~/.codex/sessions folder, so a session started in the IDE extension can be resumed from the CLI picker on the same machine.

OpenAI Codex CLI referenceOpenAI Codex documentation

Read next

Codex Session History: Where the Files Live

Search all your AI conversations in one place, LLMnesia indexes your ChatGPT, Claude, Gemini, Grok, and 10+ other AI chats locally on your device. No account, no cloud, completely private. Install LLMnesia free →