Most people switch AIs the hard way. They copy the whole chat over, or they explain the project again from the top.
Both are slow, and the new AI still misses what matters: what's really finished, what you decided, and what you told it to leave alone.
I use Claude Code and Codex on the same projects. I never explain it all again when I switch. Both of them read the same two files.
The two files
- File 1, the rules file: CLAUDE.md. Who I am, how I work, my rules. It barely changes from one week to the next.
- File 2, the handoff file: HANDOFF.md. What's done, what's next, what we decided. It changes all the time, because every session ends by updating it.
Both files sit in the project folder. Whichever AI I open in that folder reads them, so neither one starts from zero.
1Point both AIs at the same rules file
Claude Code reads CLAUDE.md on its own, every time you open it in that folder. Codex doesn't. Codex looks for a file called AGENTS.md. So I point Codex at the same file.
If you don't have a CLAUDE.md yet, open Claude Code in your project folder and ask it to interview you about who you are, how you work and your rules, then save the answers as CLAUDE.md. Keep it short.
Then pick one of these two ways.
The way I do it: one line in Codex's settings. Codex keeps its settings in a file called config.toml, inside a hidden folder called .codex in your home folder. Open it and add this line near the top, above any line that starts with a square bracket:
project_doc_fallback_filenames = ["CLAUDE.md"]
Save it and start a new Codex session. Now Codex reads your CLAUDE.md in any folder that has one, as long as that folder has no AGENTS.md. One line covers every project you have.
If you'd rather not dig for a hidden file, open Claude Code and ask it to add that line to ~/.codex/config.toml for you.
The no-settings way: a one-line AGENTS.md. Make a file called AGENTS.md in your project folder, with this in it:
Read CLAUDE.md in this folder before you do anything, and follow it. It has my rules and how I work.
One catch with the settings way. If a folder already has an AGENTS.md, Codex reads that file and skips the setting. In that folder, put the line above at the top of the AGENTS.md you already have.
2The handoff file
Here's the template. You don't have to make it by hand. The prompt in Step 3 makes it the first time and keeps it up to date after that. This is what you'll get.
The line at the top does a lot of the work. It tells whichever AI opens the file how to use it, so the switch line in Step 4 can stay short.
# HANDOFF Last updated: [date], by [Claude Code or Codex] How to use this file: read all of it before you start. Do the first step under Next. If a question under Open questions blocks that step, ask me first. Never redo anything under Done. Leave everything under Don't touch alone. When you finish a step, move it to Done. ## Where things are - [file or folder]: [what it is, in a few words] ## Done - [what's finished and checked, and where it is] ## Next 1. [the first step: which file, what to do, what finished looks like] 2. [the step after that] ## Decided - [what we decided], because [the reason in a few words] ## Don't touch - [file or thing]: [why] ## Open questions - [anything not confirmed yet, written as a question]
A good Next is specific. "Work on the sales page" makes the next AI guess. "Write the FAQ section in sales-page.md from the questions in customer-questions.md" doesn't.
3The prompt that fills it
Paste this at the end of every session, before you close the chat. It works the same in Claude Code and in Codex.
Pay attention to the second rule. Left alone, an AI can mark something done that isn't, and the next session builds on top of it. This prompt makes it write anything it isn't sure about as a question instead.
We're stopping for now. Update HANDOFF.md in this folder so the next session, in this AI or a different one, can keep going without me explaining anything. If there's no HANDOFF.md yet, make one. Start it with a "Last updated" line, then this line word for word: How to use this file: read all of it before you start. Do the first step under Next. If a question under Open questions blocks that step, ask me first. Never redo anything under Done. Leave everything under Don't touch alone. When you finish a step, move it to Done. Then these sections, in this order: Where things are, Done, Next, Decided, Don't touch, Open questions. Rules for what goes in it: - Use only this chat and the files in this folder. Don't guess, and don't fill gaps. - Done gets only what was finished and checked. If you're not sure something is finished, or I said someone else was handling it, it doesn't go in Done. Write it under Open questions as a question. - Next starts with the one step to do first. Write it so someone could start it without asking me anything: which file, what to do, and what finished looks like. - Decided gets only what I decided or OK'd, with the reason in a few words. That includes the things I said no to. If you picked something yourself and I haven't OK'd it, put it under Open questions instead. - Anything I said to leave alone goes under Don't touch, with the reason. - Where things are lists only the files that matter for this work, one line each. - If the file already exists, update it. Move finished steps to Done, and take out anything that isn't true anymore. Keep the whole file to about a page. - Put today's date and your name (Claude Code or Codex) on the Last updated line. Then paste the whole file into your reply, and list anything you weren't sure about.
Then read the file. It's short. If something says done that isn't, tell the AI now, while you still remember.
4The switch
Open the other AI in the same folder and say:
Read the handoff file and keep going.
It reads HANDOFF.md, starts on the first step under Next, and asks you about any open question that blocks it. You don't explain anything.
If you'd rather see its plan before it starts, add one more line: "Tell me the next step before you start."
The limitations you should know
- The handoff is only as good as the last session that wrote it. Close a chat without the Step 3 prompt and the next AI starts from an old file.
- It only knows what's written down. A decision you made on a call or in your head isn't in there until you tell the AI to add it.
- Don't run two AIs in the same folder at the same time. They'll write over each other's work, and over the handoff.
- Keep it to about a page. A handoff that holds every detail of every session gets skimmed, by you and by the AI.
- Never put passwords, logins or keys in either file.
Want the next guide? Follow @zachcrawford.ai
