返回顶部
c

codex-session-history会话历史查询

List and inspect local Codex session history by reading `~/.codex/session_index.jsonl`, `~/.codex/sessions/`, and `~/.codex/archived_sessions/`. Default to unarchived sessions in `~/.codex/sessions/`. Use when users ask what Codex sessions exist, want each session's id or title, need to know which project or workspace a session belongs to, or want to filter sessions by project name, session id, active versus archived status, or a local time window such as "today from 11:00 to 12:00".

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
109
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

codex-session-history

Codex 会话历史

概述

使用此技能枚举本地 Codex 会话,并将每个会话映射到其 ID、标题、项目和工作区路径。
优先使用捆绑脚本,以便输出保持一致,即使在 session_index.jsonl 不完整的情况下也能正常工作。

工作流程

  1. 1. 默认情况下,运行脚本以收集未归档的会话。
  2. 使用 sessionmeta.payload.id 作为规范会话 ID。
  3. 使用 sessionmeta.payload.cwd 作为工作区锚点。
  4. 尽可能从 Git 根目录推导项目;否则回退到 cwd。
  5. 仅将 sessionindex.jsonl 用作 threadname 和 updatedat 的补充信息。
  6. 在显示和时间窗口过滤之前,将存储的 UTC 时间戳转换为本地时间。
  7. 如果没有可用的 threadname,则回退到第一条用户消息摘要。

命令

列出最近的会话:

bash
python3 scripts/listcodexsessions.py

同时列出活跃和已归档的会话:

bash
python3 scripts/listcodexsessions.py --source all

列出更多行:

bash
python3 scripts/listcodexsessions.py --limit 50

按项目过滤:

bash
python3 scripts/listcodexsessions.py --project PlayGround

按今天的本地时间窗口过滤:

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

按特定日期的本地时间窗口过滤:

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

检查一个会话 ID:

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

仅显示已归档的会话:

bash
python3 scripts/listcodexsessions.py --source archived

返回 JSON:

bash
python3 scripts/listcodexsessions.py --json

输出

默认表格列:

  • - id
  • project
  • startedat
  • updatedat
  • source
  • title

使用 --details 时,还会显示:

  • - matchedfrom
  • matchedto
  • cwd
  • projectpath
  • startedat
  • sessionfile
  • firstuser_message

注意事项

  • - 优先使用脚本而非临时 rg,因为 sessionindex.jsonl 可能不完整。
  • 将会话文件本身视为 id 和 cwd 的真实来源。
  • startedat 和 updated_at 以本地时间显示,而非原始 Z 时间。
  • 时间窗口过滤器匹配请求时间区间内的实际会话事件,而非仅宽泛的会话跨度覆盖。
  • 如果工作区在磁盘上不再存在,仍报告记录的 cwd。
  • 当用户仅询问有哪些会话、id 是什么、属于哪个项目时,默认表格就足够了。

脚本

使用:

bash
python3 scripts/listcodexsessions.py --help

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 codex-session-history-1775936662 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 codex-session-history-1775936662 技能

通过命令行安装

skillhub install codex-session-history-1775936662

下载

⬇ 下载 codex-session-history v1.0.0(免费)

文件大小: 6.51 KB | 发布时间: 2026-4-12 09:30

v1.0.0 最新 2026-4-12 09:30
- 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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部