Skip to content

Claude Codex Handoff

An asynchronous file-based handoff protocol for Claude Code and Codex agents sharing one project workspace

Install: git clone https://github.com/OpenMOSS/claude-codex-handoff

Works with Claude Code, Codex, OpenCode · 42 GitHub stars

Install

$git clone https://github.com/OpenMOSS/claude-codex-handoff

Install command taken from the project's README or registry entry. Always review code before running it.

Claude ↔ Codex Handoff

A drop-in kit that lets two AI coding agents — for example Claude Code and Codex — collaborate asynchronously inside one repository. They talk through append-only files: one message stream per direction, atomic leases, and per-session cursors with legacy shared cursor anchors. No server, no daemon. Each side wakes on a timer, processes unread messages, optionally hands work back, and exits.

It installs as a single .handoff/ folder in your project, shared by both agents. There is no separate global "skill" copy to keep in sync — Claude Code and Codex read the same files.

Install (into your project)

From your project root, clone this repo as .handoff/, then run setup:

cd your-project
git clone https://github.com/OpenMOSS/claude-codex-handoff.git .handoff

# macOS / Linux / WSL:
bash .handoff/setup.sh
# Windows:
powershell -ExecutionPolicy Bypass -File .handoff\setup.ps1

Don't want to type the shell command yourself? Open the project in Claude Code or Codex and ask the agent to run .handoff/setup.sh (Windows: .handoff\setup.ps1) — it can see the script in your tree and will run it for you. Setup is what copies CLAUDE.md / AGENTS.md into your project root; after that the agents have an entry file, so saying 启动协作 (or costart) kicks off the actual collaboration — see Quick start below. (Before setup runs, a bare 启动协作 won't work: with no root entry file yet, the agent has no way to know .handoff/ exists.)

setup creates .handoff-runtime/ (live state) and copies PROJECT.md / CLAUDE.md / AGENTS.md to your project root if they're absent. From then on Claude Code (via CLAUDE.md) and Codex (via AGENTS.md) both read the same .handoff/. Update later with git -C .handoff pull.

Git note. .handoff/ is itself a git clone. Always add .handoff-runtime/ to your project's .gitignore. For .handoff/ itself, either keep it as an updatable dependency (add .handoff/ to .gitignore, git -C .handoff pull to update) or vendor it into your repo (rm -rf .handoff/.git, then commit the files).

Layout

your-project/
├── .handoff/                       # this repo — protocol + helper + templates (shared, one copy)
│   ├── PROTOCOL.md                 # the spec — source of truth
│   ├── setup.ps1 / setup.sh
│   ├── tools/send.py               # protocol-safe JSONL sender (stdlib only)
│   ├── tools/archive.py            # consumed-stream archive helper
│   ├── tools/doctor.py             # read-only runtime diagnostics
│   ├── tools/poll-gate.py          # deterministic wake/idle pre-gate (no model call)
│   ├── project-files/              # PROJECT.md / CLAUDE.md / AGENTS.md templates
│   └── prompts/                    # cron-prompt.md (Claude) / codex-heartbeat-prompt.md (Codex)
├── .handoff-runtime/               # message streams, per-session cursors, claims, notes (gitignore)
├── PROJECT.md                      # shared scope + task boundaries (fill the <FILL_IN>s)
├── CLAUDE.md                       # Claude-side entry
└── AGENTS.md                       # Codex-side entry

Quick start: start a collaboration

In each agent, open the project and say 启动协作 — or costart, or "start collaboration". That's all you type — the agents do the rest, including calling send.py themselves.

Similar plugs

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…

Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.

Persistent Context Across Sessions for Every Agent, Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future…

Explore related