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

Platform Guides

Codex Session History: Where the Files Live

Codex saves every session as a JSONL rollout file under ~/.codex/sessions. Here is how to find them, resume a session, or back the files up.

Codex stores session history locally as JSONL rollout files under ~/.codex/sessions/. Inside that folder, sessions are grouped by date, and each session is one rollout-<timestamp>-<uuid>.jsonl file. The Codex CLI, the IDE extension, and the ChatGPT desktop app's Codex mode all write here, so this one folder is your full local session history.

Find the session folder on your computer

Where you ran CodexDefault local path
macOS/Users/<you>/.codex/sessions/
Linux or WSL~/.codex/sessions/ in that environment
Native Windows%USERPROFILE%\.codex\sessions\ in File Explorer

On macOS, use Go to Folder in Finder and enter ~/.codex/sessions. In WSL, check the Linux home directory that Codex runs under.

Sessions are grouped into YYYY/MM/DD subfolders by the date the session started, and each file is named rollout-<timestamp>-<uuid>.jsonl. A sibling file, ~/.codex/session_index.jsonl, maps session IDs to the human-facing thread names you see in the pickers, which makes it easier to match a file to the session you remember. Sessions record the project directory they ran in, so worktree checkouts get their own entries too.

Reopen a session without reading JSONL

From the directory you were working in, run codex resume to open the picker of recent sessions. codex resume --last continues the most recent session, and passing a session ID opens that exact session. If a session is missing, check the machine and user account that created it: these files are local to each machine.

Why a session file might be missing

Search or back up the files

A rollout file contains far more than the conversation. Reasoning records, tool calls, and their outputs sit next to your prompts and Codex's replies, so a raw text search over the folder matches machinery as well as messages. On macOS or Linux, with ripgrep installed:

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

This lists matching filenames. To preserve the sessions still on disk, copy the whole ~/.codex/sessions folder to a private backup; the files are plaintext and may contain sensitive code and prompts.

For repeat searches, LLMnesia can import the local session folder and index your prompts and Codex's replies alongside your browser AI chats, so you can search by a phrase you remember and jump straight to the session. The Claude Code storage guide covers the equivalent setup for Claude Code, and the guide to finding an old Claude Code conversation walks through the same find-then-resume routine.

Where does Codex store session history?

Codex writes every session locally as a JSON Lines rollout file under ~/.codex/sessions, grouped by date in YYYY/MM/DD subfolders and named rollout-<timestamp>-<uuid>.jsonl. The Codex CLI, the IDE extension, and the ChatGPT desktop app's Codex mode all write their sessions there.

How do I reopen an old Codex session?

Run codex resume to pick from recent sessions, codex resume --last to continue the most recent one, or codex resume with a session ID to open a specific session. If the session is missing from the picker, check that you are on the same machine and user account that created it.

What is inside a Codex rollout file?

A rollout file is JSON Lines: one JSON object per line. Alongside your prompts and Codex's replies, it records reasoning traces, tool calls and their outputs, and session metadata, so matches in the raw file are not always real conversation text.

Does the ChatGPT desktop app's Codex mode use the same files?

Yes. Sessions started in the Codex CLI, the IDE extension, and the ChatGPT desktop app's Codex mode are all persisted as rollout files in the same ~/.codex/sessions folder, so one folder backs up and searches every surface.

Can I back up my Codex session history?

Copy the ~/.codex/sessions folder to a private backup. The rollout files are plaintext and can contain code, prompts, and tool output, so treat the backup as sensitive. Copying the folder preserves the sessions still on disk.

OpenAI Codex CLI referenceOpenAI Codex documentation

Read next

How to Find an Old Codex Session

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 →