cxresume
v1.1.1
Published
Resume Codex sessions from ~/.codex/sessions via `codex resume <sessionId>` with an interactive CLI.
Maintainers
Readme
cxresume (Codex Resume CLI)

Codex Resume (cxresume) is a tiny CLI/TUI to resume Codex sessions fast: it discovers and loads sessions from history under ~/.codex/sessions, and launches Codex using codex resume <sessionId> so you can pick up where you left off. If you’re searching for “codex resume”, “resume codex sessions”, or “load sessions from history”, this tool is built for exactly that workflow.
Install
- Node.js 18+
- Codex CLI (codex) >= 0.46.0
- Global install (recommended):
npm i -g cxresume - Verify:
cxresume --help - Upgrade:
npm i -g cxresume@latest - Uninstall:
npm uninstall -g cxresume
Tip: one‑off run without installing: npx cxresume --help
Quick Start
cxresume— opens a split‑pane TUI. The top pane lists sessions; the bottom pane previews recent dialog. Press Enter to launchcodex resume <sessionId>for the selected session.cxresume cwd— focuses on the current workspace directory. Sessions created via this command are tracked in.cxresume_sessionsunder your project and filtered automatically.
Why cxresume
- Resume Codex sessions instantly from prior logs
- Workspace-scoped session recovery with one command (
cxresume cwd) - Search and load sessions from history with one command
- Uses Codex’s native
resumecommand (no primer/injection needed) - Works as an interactive TUI or non‑interactive CLI
- Zero project config; just point to your Codex logs
TUI Keys
- Navigation:
↑/↓move selection;←/→change pages - Preview:
j/kscroll the bottom preview - Start:
Enterresume the selected session - New session:
nstart a new Codex session in the same directory - Workspace new session:
s(only incxresume cwd) create, record, and resume a workspace session immediately - Delete session:
ddelete the selected session file (confirms via dialog; choose Yes/No withY/Nor←/→,Enterconfirms selection; permanently removes the.jsonlfile) - Edit options:
-append extra arguments to yourcodexCmdfor this launch - Copy ID:
ccopy the session identifier (from the file’s meta) to clipboard - Full view:
ftoggle full preview - Quit:
qorEsc
Options
--list— list recent session files--open <file>— open a specific session jsonl (relative to root or absolute)--root <dir>— override sessions root (default:~/.codex/sessions)--codex <cmd>— override Codex launch command (default:codex)--search <text>— content search across all sessions, then pick from matches--legacy-ui— legacy selector without the split preview--preview/--no-preview— enable/disable a short preview before launching--print— print the exact command that would run and exit--no-launch— do not launch Codex (useful with--print)-y,--yes— skip interactive pauses-n,--new(withcwd) — create, record, and resume a new workspace session-l,--latest(withcwd) — resume the most recently recorded workspace session-h,--help— show help-v,--version— show version
Filters
- Dot filter:
cxresume .shows only sessions whose recorded working directory matches your current directory (best‑effort; depends on logs containingcwd). - Workspace filter:
cxresume cwdrestricts to sessions recorded for the current directory via.cxresume_sessions, auto-creating one if needed.
Workspace Sessions
- Each workspace uses a local
.cxresume_sessionsfile to remember session IDs created viacxresume cwd. - Run
cxresume cwd -nto create a fresh session for this directory, append its ID to.cxresume_sessions, and launch Codex immediately. - Run
cxresume cwd -lto jump straight into the most recently recorded workspace session. - Inside the TUI opened by
cxresume cwd, presssat any time to trigger the same “create and resume” flow without leaving the picker.
Config
- Place JSON at
~/.config/cxresume/config.json:
{
"logsRoot": "/home/me/.codex/sessions",
"codexCmd": "codex",
"preview": false
}How It Works
- Discovers
*.jsonllogs under the sessions root. - Parses each file; expects the first line to be
session_meta. Messages are derived fromevent_msgof typeuser_messageandagent_message. - Extracts
sessionIdfrom the session file’s meta (first linesession_meta). - Launches
codex resume <sessionId>(plus any extra args you provide in the TUI).
Also Known As
- codex resume
- resume codex sessions
- load sessions from history
Examples
Pick interactively and start:
cxresume
Filter to current directory:
cxresume .
Search content first, then pick:
cxresume --search build script
Open a specific file and start immediately:
cxresume --open 2025/09/24/session.jsonl -y
License
MIT
