Compare
Claude Code vs Codex CLI session logs
How Claude Code and Codex CLI differ in where they store sessions, file format, retention, compression, resume commands and training defaults - side by side.
Updated October 29, 2026 // Markdown
The two most used terminal agents both keep sessions as JSONL files on your machine. The details differ in ways that matter if you want to keep, measure or share them.
Side by side
| Claude Code | Codex CLI | |
|---|---|---|
| Folder | ~/.claude/projects/<project>/ |
~/.codex/sessions/YYYY/MM/DD/ |
| Organized by | Project (working directory) | Date |
| File | <session-id>.jsonl |
rollout-<time>-<id>.jsonl |
| Old sessions | Deleted after 30 days by default | Compressed to .jsonl.zst |
| Keep longer | cleanupPeriodDays in settings.json |
Kept by default |
| Resume | claude --continue, claude --resume |
codex resume, codex resume --last |
| Fork | --fork-session, /branch |
codex fork |
| Delete | claude purge |
codex delete |
| Don't save a run | --no-session-persistence (with -p) |
codex exec --ephemeral |
| Moves with | CLAUDE_CONFIG_DIR |
CODEX_HOME |
| Prompt history | ~/.claude/history.jsonl |
history.jsonl, set by history.persistence |
| Index | None; files only | SQLite state_*.sqlite and session_index.jsonl |
The difference that bites: retention
Claude Code removes sessions older than 30 days unless you raise cleanupPeriodDays. Codex keeps everything and compresses what is old. If you use both, your Codex history probably goes back further than your Claude Code history, even if you used Claude Code more.
{ "cleanupPeriodDays": 365 }
The difference that bites tools: compression
Tools that only look for .jsonl files miss Codex's compressed sessions. ccusage and the groundedby evaluator read both.
Training defaults
- Claude Code on Free, Pro and Max plans may be used for training unless you opt out. Team, Enterprise and API use are excluded.
- Codex on personal ChatGPT plans follows the "Improve the model for everyone" setting. Business, Enterprise and Edu are not used by default.
What the terms say.
Details
Claude Code storage · Codex storage · What is inside a session file
Sources
Waitlist
Your sessions, your call.
We are building an opt-in marketplace where developers license redacted sessions they pick, one by one. Join to hear first.
Read next
- Start hereHow to evaluate your AI agent sessionsA step-by-step way to measure your Claude Code and Codex history - how many sessions, how much real work, which products - and estimate what it is worth.Read +
- ValueWhat makes an AI agent session valuableBuyers of agent session data want long sessions of real work with tools, errors and recoveries. Here is what raises a session's value and what makes it worthless.Read +
- Market$500, then $200: what one posting tells us about the price of a coding sessionIn October 2026 Mercor paid developers $500 per recorded coding session, then cut it to $200 within a week. What the price says about the market for agent session data.Read +