Where Codex stores your session history
Codex saves each session as a "rollout" file in ~/.codex/sessions/, in folders sorted by year, month and day. Most older files are compressed with Zstandard, so plain grep and text editors can't read them directly.
Where are Codex sessions stored?
~/.codex/sessions/2026/10/28/
rollout-2026-10-28T14-02-11-<id>.jsonl
rollout-2026-10-28T09-41-52-<id>.jsonl.zst
~/.codex/archived_sessions/ sessions you archived If you've set the CODEX_HOME environment variable, these folders are there instead of in ~/.codex. Unlike Claude Code, the files are organised by date and not by project: each session records its working folder inside the file.
Why are Codex session files compressed?
On the Mac this app is built on, 267 of 271 rollout files end in .jsonl.zst. To read one yourself, decompress it to the terminal:
zstd -dc rollout-….jsonl.zst | head To search across all of them, zstdgrep handles both kinds of file. The format isn't a documented, stable interface, and it has changed over time, so scripts that parse it can break after an update.
Does Codex delete old sessions?
We couldn't find a documented automatic cleanup like Claude Code's 30-day one, and we've seen no sign of one: the same Mac still has rollouts from October 2025. That's one machine and not a guarantee, so check your own folder before relying on it.
How do I read an old Codex session?
- In Codex:
codex resumeopens a picker, andcodex resume --lastreopens your most recent session. - As raw files: use
zstd -dcas above. Expect a lot of bookkeeping lines around the conversation. - In a viewer: Evertusk reads both compressed and plain rollouts and shows them next to your Claude Code sessions from the same folder, so one project's history is in one place.
What can't you see in a Codex session?
Some things aren't in the files, so no viewer can show them. Codex records tokens but no cost, and its thinking is often encrypted. In Evertusk, saving a separate copy works for Claude Code sessions only, because that's where the 30-day cleanup applies. You can still bookmark Codex messages.