A CLI tool to browse and view OpenAI Codex CLI session logs interactively.
Codex CLI stores conversation logs as JSONL files in ~/.codex/sessions/, organized by date. Browsing through these nested directories manually is cumbersome. I wanted a quick way to:
- Find past sessions by month and date
- See project and branch info at a glance
- Preview conversations before opening
- Watch active sessions in real-time
- Interactive Selection: Use fuzzy finder (fzf) to browse months and sessions
- Session Preview: See conversation snippets and project info before opening
- Real-time Monitoring: Watch active sessions with
tailcommand - Git Context: Display project directory and branch for each session
- Formatted Output: Color-coded display of user/assistant messages
- Status Check: See if Codex CLI is running and view recent sessions
demo.mp4
brew install fzf jq# Clone the repository
git clone https://github.com/wondercoms/codex-logs.git
# Make it executable
chmod +x codex-logs/codex-logs
# Add to your PATH (choose one)
# Option 1: Copy to local bin
cp codex-logs/codex-logs ~/.local/bin/
# Option 2: Add to PATH in your shell config
echo 'export PATH="$PATH:/path/to/codex-logs"' >> ~/.zshrc# Interactive mode - browse months and sessions with fzf
codex-logs
# List all months with session counts
codex-logs list
# View the latest session across all months
codex-logs latest
# Watch the latest session in real-time
codex-logs tail
# Check Codex CLI status and recent sessions
codex-logs status
# Show help
codex-logs help| Command | Description |
|---|---|
| (none) | Interactive mode - select month → session with fzf |
list |
Show all months (YYYY/MM) with session counts |
latest |
View the most recent session across all months |
tail |
Watch the latest session in real-time |
status |
Check if Codex CLI is running + show 3 most recent sessions |
help |
Show help message |
The tool formats JSONL logs into readable conversations:
━━━━━━━━━━ USER ━━━━━━━━━━
Your message here...
━━━━━━━━━━ CODEX ━━━━━━━━━━
Codex's response here...
Session info includes project directory and git branch:
=== rollout-xxx.jsonl ===
Project: /path/to/project | Branch: main
Codex CLI stores sessions in ~/.codex/sessions/YYYY/MM/DD/ as JSONL files. This tool:
- Scans the nested date-based directory structure
- Groups sessions by month for easier navigation
- Parses JSONL to extract messages and session metadata
- Uses fzf for interactive selection with previews
- Formats output with ANSI colors for readability
MIT
Issues and PRs welcome!