After hundreds of Codex sessions, finding a past decision, bug fix, or discussion means loading entire transcripts and guessing. cxs indexes your local session logs into SQLite so you — or an agent — can search by query, get ranked session IDs back, then read only the relevant slice. No daemon, no cloud, nothing leaves the machine. 几百个 Codex 会话之后,要找一个过去的决策、bug 修复或讨论,就得加载整段记录靠猜。cxs 把本地会话日志索引到 SQLite,让你或 Agent 可以按关键词搜索、拿到排好序的会话 ID,再只读相关片段。无守护进程,无云端,数据不出本机。

Designed for agent use: all commands accept --json for structured output. An agent can call cxs find, get session IDs, then call cxs read-range to pull just the context it needs — without loading full transcripts into its context window. 专为 Agent 设计:所有命令支持 --json 结构化输出。Agent 可以调用 cxs find 拿到会话 ID,再用 cxs read-range 只取需要的上下文——不用把完整记录塞进 context window。

install安装
npm i -g @act0r/cxs
How it works工作流程
1
cxs status --cwd <project>
Check how many sessions exist and whether the index is current.查看项目有多少会话,以及索引是否是最新的。
2
cxs sync --cwd <project>
Ingest new sessions. Incremental — only processes what's new.增量索引新会话,只处理尚未索引的部分。
3
cxs find "<query>"
Returns ranked session IDs and scores. No transcript content.返回按相关度排序的会话 ID 和分数,不返回正文内容。
4
cxs read-range <id> --seq <n>
Read a focused window of messages around the matching sequence.读取命中序号附近的一段消息,而不是整个会话。
Example — finding a past decision示例 — 查找过去的决策
$ cxs find "why we dropped the caching layer" --cwd .
9f2a1c3e  2025-02-14  score:0.91  caching layer removal + perf tradeoffs
a4d88b01  2025-02-11  score:0.67  infra cost review Q1
c1e32f90  2025-02-03  score:0.38  release planning

$ cxs read-range 9f2a1c3e --seq 34 --window 6
# returns messages [31..37], centered on the decision exchange
Example — agent use with JSON output示例 — Agent 调用,JSON 输出
$ cxs find "auth token refresh race" --json
{
  "results": [
    { "sessionId": "9f2a1c3e-...", "score": 0.91, "endedAt": "2025-02-14" },
    { "sessionId": "a4d88b01-...", "score": 0.67, "endedAt": "2025-02-11" }
  ]
}

$ cxs read-range 9f2a1c3e-... --seq 34 --json
# structured message array — pipe directly to jq or another tool
Commands命令
status Index coverage and session inventory for a project.查看项目的索引覆盖率和会话列表。
sync Ingest new sessions into the index. Safe to run repeatedly.将新会话写入索引,可安全重复执行。
find Rank sessions by query relevance. Returns IDs and scores only.按查询相关度对会话排序,只返回 ID 和分数。
read-range Read messages around a specific sequence number.读取指定序号附近的一段消息。
read-page Page through a session in fixed chunks.按固定分页浏览整个会话。
list List indexed sessions by project or CWD, sorted by recency.按项目或工作目录列出已索引的会话,按时间倒序。