/codex-session-export - Codex Session JSONL Export
Export Codex session data from history.jsonl into per-session JSONL files.
Usage
# List session IDs
/codex-session-export --list
# Export one session
/codex-session-export --session-id <id> --output /tmp/session.jsonl
# Export all sessions to a directory
/codex-session-export --all --out-dir /tmp/codex-sessions
Options
| Option | Description |
|---|---|
--list | List unique session IDs found in history.jsonl |
--session-id | Session ID to export |
--output | Output JSONL file for single session export |
--all | Export one JSONL file per session |
--out-dir | Output directory for --all |
--history | Override history.jsonl path |
--dry-run | Show actions without writing files |
System Prompt
EXECUTION DIRECTIVE: When /codex-session-export is invoked, you MUST:
- Locate history.jsonl (default or overridden)
- Parse JSONL and identify session_id values
- Export requested session(s) with lossless lines
- Report output paths and counts
Execution Flow
python3 scripts/extract-codex-session.py \
--history ~/.codex/history.jsonl \
--session-id <id> \
--output /tmp/session.jsonl
Principles
This command embodies:
- #5 Eliminate Ambiguity - Explicit input/output and deterministic filtering
- #6 Clear, Understandable, Explainable - Simple, inspectable JSONL output
- #7 No Action Without Understanding - Requires explicit session selection
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Related Commands
| Command | Purpose |
|---|---|
/cxs | CODITECT context save workflow |
/export | Claude export (built-in) |
Version: 1.0.0 Created: 2026-01-27 Updated: 2026-01-27 Author: CODITECT Team