Codex CLI keeps every session on your machine and can pick any of them back up. Here's how, checked against the Codex docs and source code as of September 2026 (release rust-v0.157.0).
Resuming
codex resume # pick from a list
codex resume --last # most recent session in this folder
codex resume --all # include sessions from every folder
codex resume <id> # a specific session, by ID or nameIf you resume a session from a different folder than it started in, Codex asks which folder to use. Set tui.resume_cwd to "current" or "session" to stop it asking.
Two related commands:
codex exec resume [id] "follow-up"continues a non-interactive task with a new prompt.codex fork [--last | --all | id]starts a new session from an old one and leaves the original untouched.
Where history is stored
| What | Where |
|---|---|
| Full session transcripts ("rollouts") | ~/.codex/sessions/YYYY/MM/DD/rollout-<date>-<uuid>.jsonl |
| Archived sessions | ~/.codex/archived_sessions/ |
| Your prompts, across all sessions | ~/.codex/history.jsonl |
Set CODEX_HOME to move all of it somewhere else.
One thing the docs get wrong: the commands page says transcripts are kept in "history.jsonl format." The source code shows history.jsonl holds only your prompts (session ID, timestamp, text). The full transcripts are the rollout files.
How long it lasts
We found no automatic deletion of sessions in Codex. Archiving moves a rollout to archived_sessions rather than removing it. Recent source code adds background compression of rollouts older than seven days (to .jsonl.zst, still readable by Codex) when compression is enabled. We couldn't confirm which release turned it on by default.
For prompt history, history.persistence = "none" stops saving it, and history.max_bytes caps its size by dropping the oldest entries.
Searching your Codex history
There's no official search command we could verify, but the files are plain JSON lines:
rg -l "rate limit" ~/.codex/sessions --glob '*.jsonl'and for prompts, with dates:
python3 - "rate limit" <<'EOF'
import json, sys, datetime, os
term = sys.argv[1].lower()
for line in open(os.path.expanduser("~/.codex/history.jsonl")):
d = json.loads(line)
if term in d.get("text", "").lower():
print(datetime.datetime.fromtimestamp(d["ts"]).strftime("%Y-%m-%d"), d["session_id"][:8], d["text"][:100])
EOFMoving a session to another machine
Not officially documented. Copying the rollout file into the same date folder under ~/.codex/sessions on the other machine and running codex resume <id> is the likely route, but treat it as an experiment.
If you use Claude Code too, the equivalent guides are resuming a Claude Code session and where Claude Code stores history. Shabash organizes Claude Code work into threads today; support for Codex sessions is on the roadmap.