1实现原理 · 为什么它能做到
入口先分流:若 Codex 原生 resume 已把同一会话的 turns/compaction 状态带回当前上下文,则本技能与 read-codex-history 都不该调用,直接基于保留上下文继续并核验工作区;只有当新/不同 agent 上下文要接管旧 rollout 或用户给出另一个 Session ID 时才走本技能。
A restart is not enough to choose the second row. The deciding fact is whether the current conversation is the host-restored continuation of the same Session, not whether a Codex process was restarted.
Step 1 强制 verified Codex read receipt:调 read-codex-history 拿全量 chrono 简报,必须包含 prompt-ledger/state-index/rollout 源、session_meta.id 精确匹配、root-to-child fork 血统与继承字节边界、选中的用户/助手 turns、compaction、end reason、未决调用与缺口。
Fail closed on a mismatched rollout, missing child rollout, ambiguous physical copy, missing parent, broken byte boundary, or continuation cue with no recoverable parent objective. Never continue from the “closest” file.
Step 2 重建同构的 7 字段续接契约;子会话只有‘继续/continue//fork’时从已验证父快照继承任务——本地 cue 不是独立目标。
If the child contains only “继续,” “continue,” or `/fork`, inherit the task from the verified parent snapshot. A local cue is not a standalone goal.
Step 3 与现实对账:读目标项目 AGENTS.md/CLAUDE.md、核 cwd/branch/工作树/外部状态,验证记录的 patch/commit/push/download/job/agent 输出是否真落地;瞬时失败(usage limit/服务错误)先查原进程是否后来自己恢复完成再决定是否重做。
rollouts record attempted actions too.
Step 4 执行与门禁:下一步直接动作 + 反馈闭环;分支前问‘If this succeeds, which original unfulfilled result becomes smaller?’;禁止 codex resume/--continue;不覆盖无关改动。
Do not run `codex resume` or `codex --continue`.
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| cli | codex(宿主 CLI,禁止 resume/--continue) |
| skill | read-codex-history(同仓兄弟技能,读本地 Codex 会话库) |
4风险提醒 风险提醒:蓝色 · 知晓即可
- 依赖 read-codex-history 的实现质量 — fork 血统与字节边界判定若 reader 有 bug,本技能会在错误血缘上续接(fail-closed 只能降低概率)
- Codex 数据模型随版本演进 — prompt-ledger/state-index 等内部结构非公开稳定 API,Codex 升级可能使 receipt 字段失效
- 本地会话库隐私 — 把过去完整 rollout(含敏感内容)读入当前上下文
- 纯流程约束的局限 — 业务完成度判断仍依赖 agent 与用户确认,SKILL 无法机械保证
5第二遍独立确认
- [ok] 无脚本/无网络/无凭证 — 目录仅 SKILL.md,无任何命令执行/网络/凭证读取指令
- [ok] 引用的兄弟技能存在 — read-codex-history 与 continue-claude-code-work 均在 daymade-claude-code/ 下
- [ok] Entry gate 自洽 — ‘deciding fact is whether current conversation is host-restored continuation of same Session, not whether process restarted’ 前后无矛盾
- [ok] fail-closed 条件有可操作性 — mismatched rollout/missing child/ambiguous copy/missing parent/broken byte boundary 均为可判定条件
- [ok] 不夸大能力 — 宣称只做‘external takeover 续接’,原生 resume 场景被显式排除——与 SKILL 内容一致
6结论
5f48ef1a57b0b2b3…d5c4678cb5