Codex Session History

v1.0.0

List and inspect local Codex session history by reading `~/.codex/session_index.jsonl`, `~/.codex/sessions/`, and `~/.codex/archived_sessions/`. Default to u...

0· 101·0 current·0 all-time
bySube@sube-py

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for sube-py/codex-session-history.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Codex Session History" (sube-py/codex-session-history) from ClawHub.
Skill page: https://clawhub.ai/sube-py/codex-session-history
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install codex-session-history

ClawHub CLI

Package manager switcher

npx clawhub@latest install codex-session-history
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name and description claim local session enumeration; the skill only requires python3 and reads files under ~/.codex (session_index.jsonl, sessions/, archived_sessions/, history.jsonl) and derives project roots via checking for .git. These requirements are proportional to the stated purpose.
Instruction Scope
SKILL.md instructs running the bundled script and describes only reading and parsing local Codex files, converting timestamps, and optional filters. The script (visible) reads only under CODEX_HOME and traverses parent directories to find a .git marker; it does not instruct network calls, reading unrelated system configs, or exfiltration.
Install Mechanism
No install spec is present (instruction-only with bundled script). It needs python3 to run, which is reasonable and low risk; nothing is downloaded or written by an installer.
Credentials
The skill does not request environment variables, credentials, or config paths beyond the local ~/.codex files. That matches its function; no extraneous SECRET/TOKEN/KEY requirements are present.
Persistence & Privilege
always is false and disable-model-invocation is default false (normal). The skill does not request persistent system changes or modify other skills' configs. Its scope is limited to being invoked when used.
Assessment
This skill appears coherent: it reads only your local Codex session files under ~/.codex and summarizes them. Before installing or allowing the agent to invoke it: review the included script (you already have it) to confirm you're comfortable with the script printing session metadata and snippets (first user messages and paths). Sessions may contain sensitive content or local filesystem paths, so avoid running if you don't want those exposed to the agent or its outputs. If you prefer the agent not to call this autonomously, disable model invocation for the skill or only run it manually.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🧭 Clawdis
OSmacOS · Linux
Binspython3
latestvk97aq6mc4mbvmzrmm7vnr05kjx83w3jx
101downloads
0stars
1versions
Updated 4w ago
v1.0.0
MIT-0
macOS, Linux

Codex Session History

Overview

Use this skill to enumerate local Codex sessions and map each session to its id, title, project, and workspace path. Prefer the bundled script so the output stays consistent and works even when session_index.jsonl is incomplete.

Workflow

  1. Run the script to collect unarchived sessions by default.
  2. Use session_meta.payload.id as the canonical session id.
  3. Use session_meta.payload.cwd as the workspace anchor.
  4. Derive the project from the Git root when possible; otherwise fall back to cwd.
  5. Use session_index.jsonl only as enrichment for thread_name and updated_at.
  6. Convert stored UTC timestamps into local time before display and time-window filtering.
  7. If no thread_name is available, fall back to the first user message summary.

Commands

List recent sessions:

python3 scripts/list_codex_sessions.py

List active and archived sessions together:

python3 scripts/list_codex_sessions.py --source all

List more rows:

python3 scripts/list_codex_sessions.py --limit 50

Filter by project:

python3 scripts/list_codex_sessions.py --project PlayGround

Filter by a local time window on today's date:

python3 scripts/list_codex_sessions.py --from 11:00 --to 12:00

Filter by a local time window on a specific date:

python3 scripts/list_codex_sessions.py --date 2026-03-19 --from 11:00 --to 12:00

Inspect one session id:

python3 scripts/list_codex_sessions.py --session-id 019ce206-aa11-7c81-a65a-fece3708ecf4 --details

Only show archived sessions:

python3 scripts/list_codex_sessions.py --source archived

Return JSON:

python3 scripts/list_codex_sessions.py --json

Output

Default table columns:

  • id
  • project
  • started_at
  • updated_at
  • source
  • title

With --details, also show:

  • matched_from
  • matched_to
  • cwd
  • project_path
  • started_at
  • session_file
  • first_user_message

Notes

  • Prefer the script over ad hoc rg because session_index.jsonl may be incomplete.
  • Treat the session file itself as the source of truth for id and cwd.
  • started_at and updated_at are displayed in local time, not raw Z time.
  • Time-window filters match actual session events inside the requested interval, not only broad session span coverage.
  • If a workspace no longer exists on disk, still report the recorded cwd.
  • When the user only asks for "有哪些会话、id 是什么、属于哪个项目", the default table is enough.

Script

Use:

python3 scripts/list_codex_sessions.py --help

Comments

Loading comments...