← Back to Skills Marketplace
sube-py

Codex Session History

by Sube · GitHub ↗ · v1.0.0 · MIT-0
darwinlinux ✓ Security Clean
102
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install codex-session-history
Description
List and inspect local Codex session history by reading `~/.codex/session_index.jsonl`, `~/.codex/sessions/`, and `~/.codex/archived_sessions/`. Default to u...
README (SKILL.md)

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
Usage Guidance
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.
Capability Analysis
Type: OpenClaw Skill Name: codex-session-history Version: 1.0.0 The skill is a utility for listing and inspecting local Codex session history stored in the `~/.codex` directory. The Python script `scripts/list_codex_sessions.py` strictly performs read-only operations on specific application files, uses only standard libraries, and contains no network activity, obfuscation, or unauthorized data access.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install codex-session-history
  3. After installation, invoke the skill by name or use /codex-session-history
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of codex-session-history. - Enumerate local Codex sessions and display key details such as id, title, project, workspace, and timestamps. - List, inspect, and filter sessions by project, session id, active/archived status, and local time windows. - Sessions are read from unarchived and archived folders; defaults to unarchived. - Outputs a concise table by default, with additional detail and JSON options available. - Designed to work even when `session_index.jsonl` is incomplete.
Metadata
Slug codex-session-history
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Codex Session History?

List and inspect local Codex session history by reading `~/.codex/session_index.jsonl`, `~/.codex/sessions/`, and `~/.codex/archived_sessions/`. Default to u... It is an AI Agent Skill for Claude Code / OpenClaw, with 102 downloads so far.

How do I install Codex Session History?

Run "/install codex-session-history" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Codex Session History free?

Yes, Codex Session History is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Codex Session History support?

Codex Session History is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux).

Who created Codex Session History?

It is built and maintained by Sube (@sube-py); the current version is v1.0.0.

💬 Comments