I build web, desktop and mobile apps with AI coding agents. This is the file layout and the rules that let two different agents, Claude Code and OpenAI's Codex, take turns on one project without losing work or repeating mistakes.

I switch between the two agents on purpose. A fresh agent reviewing the other's work catches things the first one missed, some tasks suit one better than the other, and when one account hits its usage limit the other can carry on. The problem is that neither remembers anything the other did. Every session starts cold, and an agent that starts cold will redo finished work, rerun a script that was meant to run once, or undo a decision it doesn't know was made.

Three files fix most of that.

AGENTS.md: a pointer, not a second rulebook

Codex reads AGENTS.md and Claude Code reads CLAUDE.md. Keeping two full instruction files in sync doesn't work, so AGENTS.md is short. It names the handoff file to read first, says "then follow CLAUDE.md", and repeats only the few hard constraints that must never be missed.

CLAUDE.md: standing rules and a dated log

The standing rules are a short list of don'ts: no commits or resets, never print secrets, files that must never be opened, and deploys only as narrow compare-and-swap edits followed by an exact readback. An agent follows an explicit list far more reliably than a long description of the project.

Above the rules is a running log, newest entry first. Each entry starts with which agent wrote it and when, then the state of the work. The format looks like this:

CODEX, Nov 2 ~14:10 PST: release build paused at the owner's request ("stop the build, focus on the website"). Resume from step 3 of the release checklist. Nothing deployed.

Three habits make the log useful:

  • Quote the owner when they approve something. "Set at the owner's word" plus the exact words lets the next agent tell a decision from a guess.
  • Say what's paused and how to resume it, not only what was done.
  • Record incidents with the real cause and the guard that was added. When a long build filled the disk and nothing could run, the fix wasn't a note saying "watch the disk". The build script now refuses to start below 3 GB free and stops its own run below 1.2 GB.

The handoff file

When one agent stops and the other takes over, the outgoing agent writes a dated file, for example HANDOFF-2026-10-20-opus-to-codex.md. The date and direction are in the name, so the newest one is obvious and the older ones stay as history. Its sections:

  • Rules that still apply: a pointer to CLAUDE.md, plus the rules that matter for this task.
  • Done today: what changed, and whether each change is compiled, tested, deployed or still uncommitted.
  • Test state: what passed, what failed, and what was interrupted.
  • Open findings, not changed: problems the agent noticed and deliberately left alone for the owner to decide.
  • About the owner today: what they asked for and what they're focused on.

The "not changed" section matters most. It stops the next agent from fixing something the owner hasn't approved.

Evidence instead of claims

"Tests pass" in a handoff is a claim. A path to a STATUS.json file with the commands, results and timestamps is evidence. Each larger task writes its own status file in a work folder, and the handoff links to it.

Two more rules came from mistakes:

  • Mark one-time scripts as applied. "Do not rerun deliver.py" sits next to every mention of a delivery script that moves files: harmless once, destructive twice.
  • Correct overstatements explicitly. If an earlier handoff claimed more than was known, the next one says so in plain words, separating what is known from what was inferred. The next agent inherits the correction, not the original claim.

What it costs

Writing a handoff takes the outgoing agent a few minutes. Starting from a one-page handoff costs the incoming agent far less context than rereading a ticket history or the whole repository, and I don't have to re-explain the project at the start of every session.

If you want to try it

  1. Keep one rulebook, and point the other agent's instruction file at it.
  2. Write the rules as a short list of don'ts.
  3. End every session with a dated handoff: what's done, test state, open findings, what not to touch.
  4. Link evidence files instead of writing "it works".
  5. Mark one-time scripts as applied.
  6. Quote the owner whenever they approve something.

I wrote this with help from an AI assistant.