Codex Transfer — Documentation skill for Claude Code
Codex CLI 会话迁移工具:解析 ~/.codex 会话 JSONL,生成给 Claude Code 等 Agent 的 Markdown 交接文档(纯标准库,零依赖).
How to install Codex Transfer
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open Rostopher/codex-transfer and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Codex Transfer does
Codex CLI 会话迁移工具:解析 ~/.codex 会话 JSONL,生成给 Claude Code 等 Agent 的 Markdown 交接文档(纯标准库,零依赖).
Alternatives in Documentation
- 会话管理(Session Manager)需求文档(PRD / Markdown) — 目标:对 Codex / Claude Code 的本地会话记录进行可视化管理,并提供“一键复制 / 一键终端恢复”能力 31.7k ★
- Qmd Skill — A Codex/Clawd skill definition for qmd (Quick Markdown Search) 673 ★
- HitCC — Complete reverse-engineering documentation of the full logic of Claude Code CLI Node.js version v2.1.84 670 ★
README
codex-transfer
把 [Codex CLI](https://github.com/openai/codex) 的会话记录(`~/.codex/sessions/**/*.jsonl`)解析并渲染成 Markdown 交接文档, 让另一个 Agent(如 Claude Code)可以接续完成被中断的任务。
为什么需要它
Codex 里任务做到一半被迫停下是常态:
- 触发用量限制:ChatGPT 账户的 Codex 有使用限额(如 5 小时窗口),任务进行到一半被限流, 不想干等额度恢复——把现场交给 Claude Code 立刻继续;
- 上下文已被压缩:长会话中 Codex 自动 compact,模型自己忘掉了中间过程——
但 JSONL 里全都在。交接文档包含压缩点摘要 + 完整对话流水,比
codex resume恢复的信息更完整; - 会话意外中断:进程崩溃、误退出,或最后一条消息发出后没有得到任何回复;
- 换 Agent 接手:任务在 Codex 里进行到一半,想换一个模型/Agent 继续或接对比。
`codex resume` 只能回到 Codex 自己;codex-transfer 把会话现场完整搬给任何接手者, 并附「文件修改汇总」(哪些文件已被改过,读取现状即可,禁止重做)和 「当前状态与继续指示」(中断点在哪、下一步从哪接)。
特性
- 零依赖:仅使用 Python 标准库(argparse / json / sqlite3 / pathlib …),无需
pip install任何东西; - 兼容两代会话格式:老格式(≤0.14x,消息在
event_msg)与新格式(≥0.15x,消息在response_item/message), 解析层按会话自动适配,已在 0.14x / 0.15x 真实会话双回归验证; - 三级详略:
summary(用户+最终回答+压缩摘要)/normal(+工具调用证据链,默认)/full(不截断); - 接手即用:文末自动生成「当前状态与继续指示」,含中断点判定(有/无最终回答)与操作指引。
安装
git clone https://github.com/Rostopher/codex-transfer.git
cd codex-transfer
要求 Python 3.10+,无任何第三方依赖。
快速开始
# 1. 先看看最近有哪些会话
python3 codex_transfer.py --list 10
# 2. 迁移指定会话(支持四种输入形态)
python3 codex_transfer.py "codex resume 019fcc57-5522-7781-a797-6ef8c4b3dde5" # resume 命令整串
python3 codex_transfer.py 019fcc57-5522-7781-a797-6ef8c4b3dde5 # 纯 UUID
python3 codex_transfer.py 019fcc57 # UUID 前缀
python3 codex_transfer.py latest # 最近活跃会话(默认)
# 3. 输出在 output/handoff--<时间戳>.md,把它交给接手 Agent 即可
在 Claude Code 中接续任务:
读一下 <本仓库路径>/output/handoff-019fcc57-xxx.md,
这是 Codex 会话的迁移交接文档,请从「当前状态与继续指示」处继续完成任务。
可选:注册为 Claude Code Skill
把如下结构的目录放到 `~/.claude/skills/codex-transfer/`,即可用自然语言("迁移 codex 会话")触发:
~/.claude/skills/codex-transfer/SKILL.md # 描述触发词与调用方式,指向本仓库的 codex_transfer.py
参数
| 参数 | 说明 |
|---|---|
target |
会话标识:resume 命令整串 / UUID / UUID 前缀 / JSONL 路径 |
Related Skills
Claude Jsonl Browser
A web-based tool that converts Claude Code CLI conversation logs (JSONL format) into human-readable Markdown.
Token Goat
Token burn reducer and focus keeper for Claude Code, Codex, Copilot, Gemini CLI, and more: surgical read hints
Crewplane
Run reviewable, resumable coding-agent workflows across Claude Code, Codex, Gemini, GitHub Copilot CLI, or any
Fd Apps Prevail CLI
Terminal cockpit that asks Claude, Codex, Gemini, and local Ollama one question in parallel and synthesizes on
Personagraph
CLI-first Claude/Codex alignment memory: Markdown decisions, verified evidence, incremental session search, an
Ghost Publish
Claude Code / Codex skill for publishing to Ghost from markdown. Drives TryGhost's official ghst CLI — strips
Related Agents
Claude Code Integration
Claude Code 本体の仕様に関する専門家。hooks(PreToolUse, SubagentStop 等)のペイロード、.claude/agents/.md のフォーマット、settings.json、セッショ
Smd Coder
Implements features, fixes and refactors in the Semantic Markdown repository (TypeScript engine, VS Code exten
Mark Epub Down
Use when a task involves converting an EPUB into Markdown for LLM knowledge bases, wikis, or ingestion workflo