PromptWake for Codex CLI
Codex writes the most complete transcript of any tool in this category — and writes it to one laptop, in a directory that grows without limit until someone deletes it. PromptWake keeps it somewhere that survives the cleanup.
Nothing prunes ~/.codex/sessions, so it grows until a person deletes it — usually all of it, usually in a hurry.
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl- Format
- JSONL rollout files, partitioned by date
- Contents
- Prompts, responses, tool calls and their results
- Retention
- None — it grows until deleted by hand
- Index
- session_index.jsonl plus a state_N.sqlite thread table
- Every prompt and response from each rollout file
- The patches Codex applied, as file diffs
- Session, project and timestamp, so the timeline is chronological
- A copy that is unaffected by the sessions directory being cleaned up
Codex deserves credit here: saving is always on, the transcripts are plain text, they include tool calls and their results, and nothing deletes them on a timer. As an on-disk record it is the best of the group.
find ~/.codex/sessions -name 'rollout-*.jsonl' | wc -l
du -sh ~/.codex/sessionsWhich makes the failure mode a human one
Because nothing prunes it, the directory grows for as long as you use the tool. Eventually someone needs disk, finds a large directory in their home folder full of files with machine-generated names, and removes it. That is how Codex histories are lost — not to a policy, to a Sunday afternoon.
The second, quieter loss is a new laptop. The sessions live in your home directory; a fresh machine starts empty and nothing carries the archive across.
The SQLite index is worth knowing about
Recent Codex builds keep a thread index in the same directory, and its schema records more than the transcripts do — the rollout path, working directory, title, first user message, model, tokens used, and the git branch, commit and origin the session happened on.
sqlite3 -readonly ~/.codex/state_5.sqlite ".schema threads"That branch-and-commit link is exactly the join a provenance question needs. It is also an index rather than the record: what you keep is whatever is still in sessions/.
What PromptWake does with Codex specifically
The daemon reads the rollout files as they are written, turns each turn into prompt, response and the diff of the patch that was applied, and stores it outside ~/.codex. Delete the sessions directory afterwards and the timeline is still there — which, given that deleting it is the normal way this history ends, is the entire point.
npx promptwake doctor
npx promptwake init .When it matters
How does the rest of the team see what I asked the AI?
A customer asks how AI-generated code is reviewed and retained. What do we show them?
How does someone new find out why this code was written this way?
Which change caused this, and why did it look correct at the time?
What leaves with the laptop?
Deeper on where Codex CLI keeps its history, and how to back it up without PromptWake: read the guide.
