codex-export
Export any Codex session (~/.codex/sessions/**/*.jsonl) to a clean Markdown file.
Usage
# List recent sessions (pick by number or copy the ID)
python3 scripts/export.py --list
# Export by session ID
python3 scripts/export.py <session-id> output.md
# Brief mode: user + assistant only, no tool calls
python3 scripts/export.py <session-id> output.md --brief
Notes
- Works with Codex Desktop (
source=vscode) and Codex CLI (source=cli/exec) - Session IDs come from
~/.codex/state_5.sqliteor the rollout filename - System/developer messages and
<environment_context>blocks are filtered automatically - Tool call outputs are included by default; use
--briefto strip them
