cargo test pool::timeout24 passedcodex resume 019d8f3aOpenAI 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 scanssessions/only and does not scanarchived_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:
codex resumeJump straight back into your most recent session:
codex resume --lastResume a specific session by ID (for example, copied from CodeSesh or from a rollout-*.jsonl record):
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:
npx codesesh --agent codex --days 0Limit the view to your current repository:
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-*.jsonlfile. - 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. Plainnpx codeseshdefaults to the last 7 local calendar days. Use--days 0or switch the UI time range to All to see older rollout files. - Match
CODEX_HOME. Make sure the terminal launching CodeSesh exports the sameCODEX_HOMEvalue 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.
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.
Related guides
- Start locally
Install CodeSesh and browse AI coding sessions
Read - Start locally
How to find AI coding session history locally
Read