CodeSeshv1.5.3
Start locally

OpenAI Codex CLI Session Viewer & Replay

Locate ~/.codex/sessions/ rollout JSONL files and archived_sessions, reopen threads with codex resume, and search, replay, and track Codex CLI costs locally with CodeSesh.

By CodeSeshUpdated

npx codesesh --agent codex --days 0
Explore live preview
localhost:4521api-server
~/.codex/sessions/Sample UI
CodexRead-only index
4.4M tokens$2.86
Refactor query builder & verify pool timeouts
31 messages · 6 shell calls · gpt-5.4
bashcargo test pool::timeout24 passed
codex resume 019d8f3a

OpenAI Codex CLI stores active local session transcripts as rollout-*.jsonl files in date folders under ~/.codex/sessions/YYYY/MM/DD/, keeps thread titles in ~/.codex/session_index.jsonl, and moves archived conversations into ~/.codex/archived_sessions/. To reopen a thread in the CLI, run codex resume or codex resume --last. To browse, search, and replay Codex CLI sessions across repositories in a local Web UI, run npx codesesh --agent codex --days 0.

Codex sessions folder layout

By default, Codex keeps its local files under ~/.codex/ (~ is your home directory). If you set CODEX_HOME, Codex and CodeSesh read from that directory instead.

  • Active transcripts (~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl): Each file is a JSONL transcript containing prompts, responses, reasoning, shell commands, patches, and token usage.
  • Session title index (~/.codex/session_index.jsonl): Maps thread IDs to display titles (thread_name). CodeSesh reads this index so renamed or titled Codex threads keep their names in search and lists.
  • Archived threads (~/.codex/archived_sessions/): Holds sessions you archived in Codex. The current CodeSesh Codex adapter scans sessions/ only and does not scan archived_sessions/ by default.

Keep original JSONL files unchanged if you open them directly in an editor.

List and resume Codex sessions from the terminal

Codex includes built-in resume commands for returning to recent threads directly in your terminal.

Open the interactive session list and pick a thread to resume:

Terminal
codex resume

Jump straight back into your most recent session:

Terminal
codex resume --last

Resume a specific session by ID (for example, copied from CodeSesh or from a rollout-*.jsonl record):

Terminal
codex resume <session-id>

Browse and search Codex history with CodeSesh

Because Codex organizes rollout-*.jsonl files by date rather than by repository, finding an older conversation across multiple projects takes manual grep or guesswork. CodeSesh acts as a local Codex session viewer: it parses each rollout file, groups sessions by repository identity, preserves nested subagent sessions, and indexes messages, command output, and touched file paths into SQLite.

Start CodeSesh for all local Codex history:

Terminal
npx codesesh --agent codex --days 0

Limit the view to your current repository:

Terminal
npx codesesh --agent codex --days 0 --cwd .

In the Web UI at http://localhost:4521, you can:

  • Search across repositories: Find prompts, assistant replies, shell output, and file paths without remembering which date folder holds the rollout-*.jsonl file.
  • Replay tool calls and patches: Inspect commands, diffs, and reasoning steps in chronological order.
  • Check tokens and estimated cost: Review token totals and cache hits per session, project, or model. See the usage and costs guide for how recorded and estimated costs work.
  • Resume immediately: Copy the exact codex resume <session-id> command (including worktree path awareness) from any session detail page.

Troubleshoot missing Codex sessions

  • Check archived_sessions/. If you archived a thread in Codex, it moved out of ~/.codex/sessions/ into ~/.codex/archived_sessions/, which CodeSesh does not scan by default.
  • Pass --days 0. Plain npx codesesh defaults to the last 7 local calendar days. Use --days 0 or switch the UI time range to All to see older rollout files.
  • Match CODEX_HOME. Make sure the terminal launching CodeSesh exports the same CODEX_HOME value used when running Codex.
  • Allow initial backfill to finish. Large histories index in the background on first launch; wait for indexing to complete before searching older message text.

If you also use Claude Code or other agents, see the Claude Code session history guide and the cross-agent session history overview. For standalone binary installation, see getting started. Need to export a Codex session to standalone files instead of browsing locally? Use Agent Dump alongside CodeSesh.

Browse your local history in one Web UI

MIT open source and read-only on your machine. Search conversations, tool calls, file changes, and token costs with one command.

Explore live preview

Installation method

npx codesesh@latest

macOS / Linux / Windows · Node.js 22+

Frequently asked questions

Where does Codex store session history files?

Codex saves active session transcripts as rollout-*.jsonl inside date-nested directories under ~/.codex/sessions/YYYY/MM/DD/, keeps thread titles in ~/.codex/session_index.jsonl, and moves archived threads to ~/.codex/archived_sessions/. Setting CODEX_HOME changes ~/.codex to that root.

How do I list or resume a previous Codex session from the CLI?

Run codex resume to open the interactive session picker, codex resume --last to jump back into your most recent session, or codex resume <session-id> when you already have the thread ID.

Does CodeSesh read ~/.codex/archived_sessions/?

No. The current CodeSesh Codex adapter scans ~/.codex/sessions/ (or $CODEX_HOME/sessions/) by default and does not scan ~/.codex/archived_sessions/. If a session was archived in Codex, it stays in archived_sessions/ as a readable JSONL file.

How do I search Codex history across multiple repositories?

Run npx codesesh --agent codex --days 0. CodeSesh indexes every local Codex rollout-*.jsonl file into SQLite so you can search prompts, assistant replies, shell output, and touched file paths across all repositories and copy worktree-aware codex resume commands.

Browse all guides