Agent-switch handoff continues the same branch in a different tool (for example Claude Code to Codex) mid-work, before the branch is ready for human review.
It sits between the other two modes:
- Chat handoff assumes the same tool and can lean on in-memory continuity. A different tool starts cold, so that is not safe here.
- Full handoff commits, updates
SESSIONS.md, pushes, and prints a merge block. That is too much when you are not merging yet.
Agent-switch handoff is the middle path: commit a checkpoint, leave a durable branch-local relay note, switch tools, keep going.
- You want to move work from one coding agent to another without merging.
- The branch is mid-task, not review-ready.
- The incoming tool needs to know exactly where to pick up and what not to redo.
Do:
- Commit work in progress so the tree is clean and readable:
A
git status --short --branch git add <intentional files only> git commit -m "chore(handoff): switch checkpoint"
wip(scope): ...subject is also fine. The point is that the next tool reads committed state, not uncommitted memory. - Write the relay note to
CONTINUE.md(template below). - Name which startup file the incoming tool reads first: Codex reads
AGENTS.md, Claude readsCLAUDE.md. - If the project defines an Agent Ownership Map, point the incoming tool at the paths it owns.
Do not:
- Update
SESSIONS.mdorSESSIONS_ARCHIVE.md. - Push or print a human merge block, unless you also want a full handoff.
- Rotate session logs.
- Leave a dirty worktree unless the dirty files are intentionally out of scope and explicitly listed in
CONTINUE.md.
git status --short --branch
git log --oneline <MAIN_BRANCH>..HEAD
git diff <MAIN_BRANCH>...HEAD --statscripts/handoff.sh --mode switch gathers these and prints a pre-filled relay note. It refuses a dirty worktree by default; use --allow-dirty only for deliberate out-of-scope dirty files and list each one in the relay note.
# CONTINUE - <PROJECT_NAME>
From: <agent> -> To: <agent>
Branch: `<branch-name>`
HEAD: `<short hash> <subject>` (WIP checkpoint committed)
Worktree: clean/dirty
## Focus
- <the one active task>
## Immediate Next Step
1. <the next action for the incoming tool>
## Do Not Redo
- <work already done; do not revert or re-derive>
## Intentionally Dirty
- <path or "none">
Incoming tool reads first: <AGENTS.md for Codex / CLAUDE.md for Claude>, then this file.The incoming tool should:
- Read its own startup file (
AGENTS.mdorCLAUDE.md), thenCONTINUE.md. - Confirm branch and HEAD match the relay note.
- Continue from the next step; do not redo listed work.
- Clear or delete
CONTINUE.mdonce consumed, so it never becomes a second stale log.
When the branch later becomes review-ready, switch to full-handoff.md.