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外部依赖
| Kind | Dependency / Endpoint |
|---|---|
| cli | codex(宿主 CLI,禁止 resume/--continue) |
| skill | read-codex-history(同仓兄弟技能,读本地 Codex 会话库) |
4管控建议与判定依据
- 本地工作目录: 文件读写与工件输出: (由 agent 按正常授权执行当前项目工作——技能本身无写指令;改动前强制 read receipt 与契约)
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…