How Claude Code and Codex store sessions, and how to hand a task from one to the other
Описание и применение
Автоматизация передачи задач между Claude Code и Codex через синхронизацию с курсорами и локальные JSONL‑файлы, реализованная в приложении ccx.
Задача
Switching between Claude Code and Codex leaves each side unaware of the other's progress, making task handoff difficult.
Результат
The handoff between Claude Code and Codex is automated, reducing token usage to a few thousand per update and eliminating the need for manual exports.
Рабочий процесс
- 1. Read Claude Code session JSONL from ~/.claude/projects/
<project>/<session-id>.jsonl - 2. Condense tool results: keep messages verbatim, summarize tool calls, add current todo list and git status
- 3. Store condensed progress in a cursor file
- 4. On switch, send only the delta after the cursor to Codex via its app‑server thread
- 5. Codex receives the delta, updates its thread, and writes back progress
- 6. Claude receives Codex’s new progress via UserPromptSubmit hook and prepends it to the next user message
- 7. Repeat steps 4‑6 whenever switching
Доказательства
Every Claude Code session is a JSONL file under ~/.claude/projects/<escaped-project-path>/<session-id>.jsonl.
I packaged all of this as ccx, an open-source macOS menu bar app. Click ⇄ to hand off.
One Claude session is paired with one Codex thread. Each side keeps a cursor: the last event already synced.
- Дата записи: 2026-10-23T10:26:25.050Z