Skip to content
groundedby
Waitlist

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

  1. Claude Code docs, sessions
  2. OpenAI Codex docs, developer commands
  3. openai/codex source, rollout storage

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.

Your email and the side you picked. Nothing else. Privacy