Codex Session Selector
Rust TUI utilities for indexing local Codex session JSONL files and selecting one to replay.
Repository: https://github.com/widehyo1/codex-session-selector.git
Binaries
record-codex-session-info: scans~/.codex/sessions/*/*/*/*.jsonland writes a SQLite index.select-codex-session: opens a ratatui selector, refreshes the SQLite index by default, and runscodex-replay-tui <jsonl-path>for the selected session.codex-replay-tui: opens a ratatui replay view for one Codex session JSONL file.
Install
Install all three binaries from crates.io:
Or install from this repository:
By default, the script installs to ~/.local/bin. Override the destination with:
CODEX_CLI_BIN_DIR=/.cli/bin
Install directly from Git with:
Manual install:
Usage
Refresh the SQLite index manually:
Open the selector:
By default, select-codex-session runs record-codex-session-info --output ~/codex-session-info.sqlite3 before opening the TUI. To skip refresh:
Use a custom database or command:
TUI Controls
j/korUp/Down: move selectiond/uorPageDown/PageUp: page selection or message scroll, depending on focusg/G: first/last selection or message top/bottom, depending on focusTab: switch focus between sessions and first messageh/lorLeft/Right: horizontal scroll in the sessions pane0: reset horizontal scroll/: interactive searchTabwhile searching: cycle search scope throughall,message,cwd,branch,repo,dateEnter: runcodex-replay-tuiwith the selected JSONL path, then return to the selector after replay exitsy: copycodex resume <session-id>to the clipboard?: helpq,Esc, orCtrl-C: quit
When replay exits, the selector opens again with the previous selection and filter state intact.
SQLite Schema
The sessions table contains:
pathidtimestampcwdrepository_urlbranchfirst_message
Subsessions are excluded by default using session_meta.payload structure (source.subagent, thread_source == "subagent", or agent_role). Empty first messages are also excluded by default.
To include them: