本地对话历史记录
- 作者仓库星标 0
- 作者更新于 2026年8月24日 07:33
- 作者仓库 claude-code-skills
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @daymade · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Local Conversation History
List project-scoped local histories without reconstructing ad hoc `rg`, `stat`,
`jq`, or SQLite pipelines. The bundled script performs provider and archive
discovery, schema introspection, filtering, de-duplication, title extraction,
internal-time sorting, positive-only Codex writer-lock observation, and rendering
in one process.
## Decide the job before calling a tool
Treat the user's intent as the routing key; the word “history” alone does not
mean inventory.
| User intent | Route |
|---|---|
| List recent conversations, titles, dates, session IDs, or held Codex writer locks | Run this skill's bundled inventory once |
| Find the conversation where a topic, action, quote, file, or tool result appeared — including “I remember we did X,” “find that old chat,” or “did we ever discuss Y?” | Invoke `daymade-claude-code:claude-code-history-files-finder` directly; do not run the recent inventory first |
| Continue work from an already identified session | Invoke the matching `daymade-claude-code:continue-claude-work` or `daymade-claude-code:continue-codex-work` skill |
A topic clue wins over inventory wording. For example, “find our historical
conversation records about DINO” is full-content search even though it says
“conversation records.”
When routing a content search, preserve the unknown parts of the user's scope:
- If the provider is unknown or the user says “our history,” require the finder
to cover Claude plus Codex and Kimi CLI; a Claude-only result cannot support
an absence claim.
- If the project is unknown, require the finder to search all projects instead
of guessing the current workspace.
- Exclude the current session before treating a fresh hit as historical
evidence; the user's query and the agent's search command are recorded in the
current transcript and otherwise self-match.
Let the finder own its exact commands, query widening, source diagnostics, and
result interpretation. This skill owns only the inventory-vs-search decision.
## Completeness invariant
For a normal Claude Code inventory, the source set is indivisible:
1. auto-discovered active homes (`~/.claude`, profile homes, and the current
`CLAUDE_CONFIG_DIR`), and
2. every archive registered in `~/.claude/history-sources.json`.
Do not claim that a Claude conversation is absent unless the output shows that
the registered archives were searched. A required archive that is unavailable
is a hard configuration error, not permission to return an incomplete result.
Explicit `--claude-home` is a diagnostic scope override and intentionally
bypasses the registry; never use it for a completeness claim.
## Route the request
- List/recent/show/browse local conversations: run the bundled script once.
- Triage Codex sessions that may still be in use: use the automatic
`writer-lock file held` marker. The command probes every admitted Codex row
and appends any positive hit outside the recent-row limit. A hit proves only
that a process held Codex's canonical advisory lock during the snapshot; it
does not identify that process or prove the session is running. An unmarked
row does not prove that a session stopped.
- Understand what a marked Codex session is doing: pass its exact session ID to
`daymade-claude-code:continue-codex-work`. A title, recent timestamp, or held
writer-lock marker identifies a thread lock, not its holder, current task, or
progress.
- Restrict to one provider: pass `--source claude`, `--source codex`, or
`--source kimi` (Kimi CLI, a.k.a. kimi-code).
- Point at a non-default Kimi CLI home: pass `--kimi-home <dir>`; resolution
order is `--kimi-home` > `KIMI_HOME` > `~/.kimi-code`.
- Include child workspaces under a directory: pass `--recursive`.
- List every workspace: pass `--all-projects`; omit `--cwd`.
- Include archived Codex threads or archived Kimi CLI sessions: pass
`--include-archived`.
- Restrict by conversation date: pass `--from-date` and/or `--to-date`.
- Include internal agents or obvious smoke prompts only when explicitly asked:
pass `--include-subagents` or `--include-automated`.
- Search inside full transcripts, recover deleted files, or analyze tool calls:
use the `daymade-claude-code:claude-code-history-files-finder` skill instead.
- Reconstruct and continue a Claude Code session with
`daymade-claude-code:continue-claude-work`; use
`daymade-claude-code:continue-codex-work` for a Codex thread.
## Run exactly one inventory command
Resolve `scripts/list_local_history.py` relative to this SKILL.md. Do not search
the machine for the script and do not recreate its logic inline.
On macOS or Linux, execute the script directly when its executable bit is
available; otherwise use Python 3. On Windows, use `py` or `python`:
```text
<skill-dir>/scripts/list_local_history.py --cwd <workspace> --limit 10 --language en
py <skill-dir>/scripts/list_local_history.py --cwd <workspace> --limit 10 --language en
```
Choose `--language zh` when the user is speaking Chinese. If the user supplied
no path, pass the shell's current working directory explicitly. Use forward
slashes in Windows command examples, while allowing the actual `--cwd` value to
use the platform's native path form.
Expected output is already presentation-ready Markdown:
```markdown
# Local conversation history
Scope: `<workspace>`
## Codex — 3 conversations
Runtime: `writer-lock file held` proves lock contention, not holder identity; an unmarked row is not evidence that a session stopped.
| Updated | Title | Session ID | Flags |
|---|---|---|---|
| 2026-01-15 10:30 +00:00 | Review authentication flow | `019...` | writer-lock file held |
```
Return that output directly, with at most one short observation. Do not run
follow-up `find`, `rg`, `stat`, or database calls merely to restate the result.
When the user asks what a marked Codex thread is doing, the sanctioned follow-up
is `daymade-claude-code:continue-codex-work` for that exact ID, not a
process-name or cwd guess.
## Preserve the evidence boundary
Treat the command as an inventory, not a transcript export:
- Keep the script read-only. It never resumes, renames, archives, deletes, or
repairs a conversation.
- Report titles only; do not paste raw JSONL or full prompts unless the user asks
for a specific session afterward.
- Keep every displayed timestamp's explicit timezone offset.
- For Claude Code, treat the minimum and maximum valid top-level `timestamp`
values across the JSONL as the session range. Never substitute file mtime:
copying or migrating an archive changes mtime without changing conversation
time.
- For Codex, prefer the state database's internal created/updated fields. If the
database is unavailable, compute the rollout range from internal top-level
event timestamps plus `session_meta.payload.timestamp`; never use rollout
mtime or database-file mtime as chronology.
- Treat `writer-lock file held` as evidence only that some process owned the
canonical per-thread advisory lock during the snapshot. It does not identify
that process or prove an open UI, an executing agent, ongoing tool use,
business progress, repository permission, or a project lease. Every in-scope
Codex row is probed; positive hits outside `--limit` are appended. Never
invert an absent marker into “inactive”.
- For Kimi CLI, prefer `state.json`'s `createdAt`/`updatedAt` (epoch
milliseconds). If `state.json` is missing or lacks them, compute the range
from internal wire `time` fields (plus the metadata record's `created_at`,
also ms); never use file mtime as chronology.
- A date-only filter means the whole local calendar day. A datetime filter must
include `Z` or an explicit UTC offset. Sessions without internal timestamps
are excluded with a visible warning while a date filter is active.
- Preserve provider labels and session IDs exactly as printed.
- State warnings from the script instead of silently hiding a missing,
unreadable, or unsupported store.
- Do not claim Claude Desktop native chats are included. The Claude source here
is Claude Code history; Codex covers local Codex CLI/Desktop thread stores;
Kimi CLI covers the local kimi-code session store, not the Kimi web product.
## Handle source configuration and failures
The script honors `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, and `KIMI_HOME`. Register
durable Claude archives once in `~/.claude/history-sources.json`; the default
command then searches them on every run. Use `--history-sources <file>` to test
another registry. Use `--claude-home <dir>`, `--codex-home <dir>`, or
`--kimi-home <dir>` only when the user explicitly requests an exact
single-store diagnostic scope.
If no conversations appear, use the diagnostics already printed by the same
command. Read
[references/storage_and_portability.md](references/storage_and_portability.md)
when the format, path, or writer-lock observation needs diagnosis; it documents
the source registry, inspected stores, internal-time policy, lock semantics,
Windows path normalization, and known boundaries.
## Maintainer verification
In the source repository, `daymade-claude-code/_conversation_core/` is the code
SSOT shared by this skill, `claude-code-history-files-finder`,
`continue-claude-work`, and `continue-codex-work`. The four skills remain
self-contained at install time because `sync_core.py` copies that package into
each `scripts/_core/`. Never edit a bundled `_core` copy directly.
After changing shared code, synchronize and verify all four bundles, then run
this skill's standard-library regression suite:
```text
uv run python ../sync_core.py sync
uv run python ../sync_core.py check
python -m unittest discover -s tests -p "test_*.py"
```
The test suite builds isolated Claude and Codex fixtures, including SQLite and
raw-JSONL paths, so it never depends on the maintainer's personal conversation
content. Development trigger cases live in `evals/evals.json`.
章节与文件索引
按说明文件中的顺序排列。
在调用工具之前确定作业
完整性不变量
路由请求
只运行一个清单命令
保留证据边界
文件/命令 -> stat · daymade-claude-code:claude-code-history-files-finder · daymade-claude-code:continue-claude-work · daymade-claude-code:continue-codex-work · ~/.claude · CLAUDE_CONFIG_DIR · ~/.claude/history-sources.json · --claude-home
内容校验值 -> 285c54a31827
当前原文的自动摘译,尚未人工审校。
在调用工具之前确定作业
将用户的意图视为路由键; “历史”一词本身并不意味着库存。用户意图 · 路由列出最近的对话、标题、日期、会话 ID 或持有的 Codex 作者锁 · 运行该技能的捆绑清单一次 查找出现主题、操作、引用、文件或工具结果的对话 - 包括“我记得我们做了 X”、“找到那个旧聊天”或“我们是否讨论过 Y?” · 直接调用
daymade-claude-code:claude-code-history-files-finder;不要先运行最近的库存完整性不变量
对于正常的克劳德代码清单,源集是不可分割的:自动发现的活动家庭(
~/.claude,配置文件家庭和当前的CLAUDE_CONFIG_DIR),以及在~/.claude/history-sources.json中注册的每个档案。不要声称克劳德对话不存在,除非输出表明路由请求
列出/最近/显示/浏览本地对话:运行捆绑脚本一次。对可能仍在使用的 Codex 会话进行分类:使用自动
writer-lock file held标记。该命令探测每个承认的 Codex 行并附加最近行限制之外的任何正命中。命中仅证明进程在快照期间持有 Codex 的规范咨询锁;它只运行一个清单命令
解决与此 SKILL.md 相关的
scripts/list_local_history.py。不要在计算机中搜索脚本,也不要内联重新创建其逻辑。在 macOS 或 Linux 上,当脚本的可执行位可用时直接执行脚本;否则使用Python 3。在Windows上,使用py或python:当用户说中文时选择--language zh。如果用户提供保留证据边界
将命令视为清单,而不是脚本导出:将脚本保持为只读。它永远不会恢复、重命名、存档、删除或修复对话。仅报告标题;不要粘贴原始 JSONL 或完整提示,除非用户随后要求进行特定会话。