Codex Session History for Openclaw

A specialized utility to enumerate, filter, and inspect local Codex AI agent sessions and their associated metadata.

sube-py
v1.0.0
Mar 30, 2026
0
680
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install codex-session-history

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install codex-session-history using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Codex Session History?

Codex Session History is a robust technical utility designed to provide deep visibility into your local AI development history. By interfacing directly with session indices and local storage paths, it allows developers to map specific AI interactions to their respective IDs, project titles, and workspace directories. This tool is essential for developers using Openclaw Skills who need to maintain an organized audit trail of their AI-assisted coding workflows.

The skill prioritizes data integrity by using the session files themselves as the source of truth, ensuring that even if the primary index is incomplete, your session data remains accessible. It handles complex time-zone conversions automatically, presenting UTC timestamps in your local time for intuitive filtering and review.

Codex Session History Use Cases

  • Retrieving a specific session ID for a project worked on earlier in the week.
  • Auditing AI interactions across multiple workspaces or Git repositories.
  • Filtering session history by specific local time windows to track productivity.
  • Identifying which project or directory a specific archived session originated from.
  • Exporting session metadata to JSON for custom data analysis or reporting.

How Codex Session History Works

  1. The skill scans the local filesystem, specifically targeting ~/.codex/session_index.jsonl and the sessions directories.
  2. It extracts canonical session IDs and workspace anchors (CWD) directly from the session payloads.
  3. The tool attempts to resolve the project name by identifying the Git root of the workspace; otherwise, it defaults to the directory name.
  4. Metadata is enriched by merging information from the session index for thread naming and update timestamps.
  5. All timestamps are converted from UTC to the user's local time.
  6. The resulting dataset is filtered based on user-provided arguments (date, project, or status) and rendered in a clean table or JSON format.

Codex Session History Setup

Ensure you have Python 3 installed on your macOS or Linux system. To use this within your environment, execute the bundled script:

# List the most recent sessions to verify installation
python3 scripts/list_codex_sessions.py

Codex Session History Data Schema & Taxonomy

The skill organizes session data into a structured format. When using the --details flag, the following schema is populated:

Field Description
id The canonical UUID for the Codex session.
project The resolved Git project name or folder name.
cwd The absolute path to the workspace directory.
started_at Local timestamp of session initiation.
source Indicates if the session is active or archived.
title The thread name or a summary of the first user message.
session_file The physical path to the session JSON file on disk.

Codex Session History Advanced Features

  • Multi-source aggregation: Combine active and archived session histories into a single view using the --source all flag.
  • Granular time filtering: Narrow down sessions using specific --date, --from, and --to parameters.
  • JSON Output: Seamlessly integrate with other Openclaw Skills by outputting machine-readable data via the --json flag.
  • Deep Inspection: Use the --details mode to view the first user message and full project paths for every session.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins python3
Github Stars: 0
forks: 0

Featured*