ce-session-inventory
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSession inventory
会话清单
Agent-facing primitive. Discover session files and emit session metadata as JSONL across Claude Code, Codex, and Cursor.
This skill exists so that agents researching session history do not need to know the layout of session stores on disk or the JSONL shapes of each platform. The scripts under own that knowledge.
scripts/面向Agent的基础工具。跨Claude Code、Codex和Cursor发现会话文件,并以JSONL格式输出会话元数据。
本技能的存在是为了让研究会话历史的Agent无需了解磁盘上会话存储的布局或各平台的JSONL格式。目录下的脚本负责处理这些细节。
scripts/Arguments
参数
Space-separated positional args:
- — repo folder name (e.g.,
<repo>). Used for directory matching in Claude Code and Cursor, and as the CWD filter for Codex sessions.my-project - — scan window in days (e.g.,
<days>). Session files older than this are skipped.7 - (optional) — one of
<platform>,claude,codex. Omit to search all three.cursor
空格分隔的位置参数:
- — 仓库文件夹名称(例如:
<repo>)。用于在Claude Code和Cursor中匹配目录,并作为Codex会话的CWD筛选条件。my-project - — 扫描窗口的天数(例如:
<days>)。早于此时间的会话文件将被跳过。7 - (可选) — 可选值为
<platform>、claude、codex。省略则搜索全部三个平台。cursor
Execution
执行
Run the discovery-plus-metadata pipeline from the skill's own directory:
scripts/bash
bash scripts/discover-sessions.sh <repo> <days> [--platform <platform>] \
| tr '\n' '\0' \
| xargs -0 python3 scripts/extract-metadata.py --cwd-filter <repo>Return the raw stdout verbatim — one JSON object per session, then a final line. Callers parse the JSONL directly, so do not paraphrase, reformat, or summarize.
_metaIf discovery finds no files, the pipeline still emits a clean line (). Return that as-is.
_metafiles_processed: 0从技能自身的目录运行“发现+元数据”流水线:
scripts/bash
bash scripts/discover-sessions.sh <repo> <days> [--platform <platform>] \
| tr '\n' '\0' \
| xargs -0 python3 scripts/extract-metadata.py --cwd-filter <repo>原样返回原始标准输出——每个会话对应一个JSON对象,最后是一行。调用方直接解析JSONL,因此请勿改写、重新格式化或总结内容。
_meta如果未发现任何文件,流水线仍会输出一行格式规范的()。请原样返回该内容。
_metafiles_processed: 0Output format
输出格式
Each session line is a JSON object. Common fields across platforms:
- —
platform,claude, orcodexcursor - — absolute path to the session JSONL
file - — file size in bytes
size - — session start timestamp (ISO 8601)
ts - — session identifier
session
Platform-specific fields:
- Claude Code adds (git branch) and
branch(last message timestamp).last_ts - Codex adds (working directory),
cwd,source,cli_version,model.last_ts - Cursor has no in-file timestamps or metadata — is derived from file mtime and
tsfrom the containing directory name.session
The final line has , , and optionally (count of Codex sessions dropped by the CWD filter).
_metafiles_processedparse_errorsfiltered_by_cwd每个会话行都是一个JSON对象。各平台通用字段:
- —
platform、claude或codexcursor - — 会话JSONL文件的绝对路径
file - — 文件大小(字节)
size - — 会话开始时间戳(ISO 8601格式)
ts - — 会话标识符
session
平台特定字段:
- Claude Code 添加(Git分支)和
branch(最后一条消息的时间戳)。last_ts - Codex 添加(工作目录)、
cwd、source、cli_version、model。last_ts - Cursor 无文件内时间戳或元数据——由文件修改时间推导而来,
ts由所在目录名称生成。session
最后一行包含、,以及可选的(被CWD筛选条件过滤掉的Codex会话数量)。
_metafiles_processedparse_errorsfiltered_by_cwdError handling
错误处理
If the discovery script errors (e.g., unreadable home directory, permission failure), let the error surface to the caller. Do not substitute git log, file listings, or other sources — this skill's contract is session metadata, nothing else.
If reports , return the JSONL as-is. The caller decides how to handle partial data.
_metaparse_errors > 0如果发现脚本出错(例如:无法读取主目录、权限不足),请将错误直接返回给调用方。请勿用Git日志、文件列表或其他来源替代——本技能的约定是仅返回会话元数据,不提供其他内容。
如果显示,请原样返回JSONL。由调用方决定如何处理部分数据。
_metaparse_errors > 0