Developer Guide

How to View & Search OpenAI Codex CLI Sessions

When using OpenAI Codex in your terminal, the agent executes complex shell scripts, builds test fixtures, and writes code across multiple directories. Finding past prompt reasoning and tool commands shouldn't require manual file hunting. Here is how to access and search Codex session rollouts across macOS, Linux, and Windows.

⚡ Instant Session Inspection (Works on Any OS)

Inspect any Codex rollout-*.jsonl session with zero cloud uploads:

Use our free, in-browser viewer to inspect user messages, system completions, and tool executions in any web browser.

Open Free Session Viewer Tool ↗ Get L2Cache for Mac ↗

Updated September 2026 · By the team behind L2Cache

Where Are Codex Sessions Stored?

OpenAI Codex organizes transcripts in date-based directories under your user home directory:

macOS & Linux:

~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl

Windows:

%USERPROFILE%\.codex\sessions\YYYY\MM\DD\rollout-*.jsonl

Each session is assigned a unique rollout ID containing the full conversation history, agent actions, tool inputs, and return results formatted in JSON Lines.

Built-in Command: Resuming Codex Sessions

To pick up where you left off in your current or recent coding session:

# Resume recent Codex sessions interactively
codex resume

Limitations of Directory-Based Rollout Files:

Parsing Codex Sessions via CLI

You can search across all Codex session files recursively using ripgrep and jq:

# Search all past Codex prompts for a keyword
find ~/.codex/sessions -name "rollout-*.jsonl" -exec jq -r 'select(.type=="USER_INPUT") | .content' {} + | grep -i "docker"

# Find recently executed shell commands
find ~/.codex/sessions -name "rollout-*.jsonl" -exec jq -r 'select(.tool_calls? != null) | .tool_calls[] | .args' {} +

Automated Capture with L2Cache for Mac

Rather than running multi-line shell pipelines to find old prompts, L2Cache for Mac runs natively in your menu bar:

Never Lose an AI Prompt or Shell Command

L2Cache gives you instant, private, offline access to every command, prompt, and code snippet you work with on macOS.

Download L2Cache on the Mac App Store

macOS 13 Ventura or later · No subscription required

Frequently Asked Questions

How do I view Codex session rollouts visually?

Drop any rollout-*.jsonl into the free L2Cache Session Viewer. It parses and renders the entire step-by-step history right in your browser.

Does Codex session data leave my Mac?

The local rollout files in ~/.codex/sessions remain on your machine. Using L2Cache also guarantees zero-cloud data storage with on-device indexing.

Can I search Claude Code transcripts as well?

Yes! Check out our guide on searching Claude Code session history on Mac.

🛠️ Free Tool: Use our In-Browser Claude & Codex Session Viewer.
📖 Terminal Guide: Learn how to search and manage Mac terminal command history.