read-codex-history

Reads, searches, and exports local OpenAI Codex session history with verified identity and lineage.

1.4k|216|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/daymade/claude-code-skills --skill read-codex-history
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: read-codex-history
Source: https://github.com/daymade/claude-code-skills/tree/main/daymade-claude-code/read-codex-history
Command: npx skills add https://github.com/daymade/claude-code-skills --skill read-codex-history

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Local Codex CLI history is scattered across three different stores (history.jsonl prompt ledger, state_*.sqlite metadata, and rollout JSONL files), and naive reads can attribute one session's events to another, miss forked ancestry, or silently return partial results. This Skill reads Codex history as verified evidence without resuming or modifying any session.

Core Features & Use Cases

  • Verbatim Input Extraction: Lists exact recent user inputs from the Codex prompt ledger, grouped by Session ID in newest-first order, preserving duplicates, wording, and timestamps.
  • Session Evidence Briefings: Reconstructs one chronological user/assistant timeline per session, including fork lineage via exact byte-offset snapshots, compaction context, tool calls, files edited, and end reasons.
  • Bounded Keyword Search: Searches full rollout events across live and archived sessions with date filters, project scoping, self-match exclusion, and a scan budget that fails visibly instead of returning incomplete results.
  • Use Case: A user asks "what did I tell Codex yesterday about the auth refactor?" The Skill extracts the exact prompt-ledger rows, verifies the session identity against session_meta.id, and reconstructs the full conversation including any forked parent context.

Quick Start

Ask the assistant to list your recent Codex sessions or show what you told Codex in a specific session, and it will run the bundled read-only scripts to return verified history evidence.

Frequently Asked Questions about read-codex-history

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I see what I told Codex in a previous session?

Run the bundled list_codex_user_inputs.py script with --recent N for a global window or --session-id for specific sessions. It reads history.jsonl directly and returns exact stored inputs grouped by session, preserving duplicates, wording, and timestamps without summarization.

How to search Codex CLI history for a keyword?

Use analyze_sessions.py search with --codex-only plus optional date, project, and exclusion filters. The scan covers live and archived rollout files with a time budget, and it fails visibly on timeout or unreadable files rather than presenting partial results as complete.

Does reading Codex history resume or modify the session?

No. The Skill is strictly read-only: it never runs codex resume, never archives, renames, deletes, or repairs anything. To continue work after reading, the evidence is handed to a separate continue-codex-work skill.

Why can a Codex session ID point to the wrong rollout file?

The state database rollout_path is only a candidate; the authoritative identity is the session_meta.id inside the rollout file. The reader verifies this internal ID and rejects mismatches, and fork ancestry requires exact history_base byte offsets rather than filename or title matching.

What does the writer-lock held marker on a Codex session mean?

It proves only that some process held Codex's canonical per-thread advisory lock during the snapshot. It does not identify the holder, prove the session is running, and an unmarked row does not prove a session stopped.

What are the limitations of Codex history search?

Broad scans have a stop-loss time budget and raise an error instead of returning incomplete results. Content absent from both raw records and compaction replacement_history cannot be recovered, and image-only messages cannot be restored to original attachments.