GuidesGuideHand off at a usage limitDirectory

Claude Code hit its limit mid-task. Wait, or hand it to another agent?

Updated

You may not need to switch. In Claude Code v2.1.234 or later, signed in with a claude.ai subscription, an open interactive session waits for a session-limit reset and then continues the task where it stopped. Codex lets a turn that’s already running finish, “subject to fair use limits”, OpenAI says. Switching, or starting fresh from a note, is worth it when the wait is long (usually a weekly limit), when a long session would re-read itself at the reset, or when the work can’t wait.

If you do switch, the files in the folder, including uncommitted changes, are there for whichever agent opens it. So are the project instructions, if each agent reads the file they’re in (Codex reads AGENTS.md, not CLAUDE.md). Codex can also import Claude Code’s recent chats and project memories with /import. A short handoff note, written by the first agent before its limit, adds what the code can’t show: what’s verified, what was rejected and why, and what to do next. Below are the facts from each tool’s docs, then the note and two prompts, each part tied to a source or to a failure someone reported.

An AI drafted this page from the sources below and another AI checked it. No person has run these steps: nobody here has handed a task from one agent to the other with this note, or tried Codex’s /import on a half-finished task. Counterparts and the AI Phone are ours: Mike LaPeter runs Counterparts.

Wait, or hand off?

You seeWhat the docs say happensUsually the move
Claude Code: You've hit your session limit · resets 3:45pm

An open interactive session waits and continues on its own at the reset (v2.1.234+, claude.ai subscription). It doesn’t resend your last message; it prompts Claude to pick the task up.

Keep the session open and wait, or start fresh from a handoff note if the session is long or the work can’t wait

Claude Code: You've hit your weekly limit · resets Mon 12:00am

No automatic wait when the reset is more than 24 hours away. Claude Code opens the usage-limit menu, where you can still pick a wait.

Hand off, or add usage credits

Claude Code: You've hit your Opus limit (or Sonnet)

Only that model family is blocked

/model to a model outside the family. The next request re-reads the whole conversation with no cache.

Codex: limit reached during a turn

OpenAI says “the agent will be able to continue working on that turn, subject to fair use limits”

Let it finish, then decide

Codex: limit reached between turns

Plus and Pro can buy credits (workspaces on flexible pricing can buy workspace credits); anyone can run extra local chats with an API key at API rates; /usage can redeem an earned reset if you have one

Credits, or hand back to Claude Code

A few details matter while Claude Code waits:

  • Keep it open. Exiting ends the wait, and resuming later doesn’t restart it. Clearing, rewinding, /resume-ing another session or switching accounts ends it too.
  • It can stall. The continued task still asks for permissions as usual, so it can stop on a prompt while you’re away. After three automatic continuations in a row it stops and tells you.
  • Your computer sleeping matters. If it slept for more than about 30 minutes and the limit reset meanwhile, Claude Code waits for you to press Enter.
  • It re-reads the conversation. A session-limit reset can be hours away, longer than Claude Code’s prompt cache lasts, so the continued turn reads the whole conversation as new input. For a long session that can use a good share of the fresh window; a new session that reads a short note uses less.
  • Turning it off: in /config, turn off “Continue automatically at usage limit”. The desktop app’s Code tab has its own “Auto-continue when limits reset” checkbox, on the session-limit card only.

The pages of OpenAI’s docs we read don’t describe Codex waiting out a reset and continuing on its own. An open feature request on Codex’s GitHub asks for exactly that (#44987).

What crosses from Claude Code to Codex, and back

Claude Code to CodexCodex to Claude Code
Files in the folder, uncommitted changes

Yes, if Codex opens the same folder

Yes, the same way

Project instructions

Codex reads AGENTS.md (and AGENTS.override.md), one file per folder, root down, up to 32 KiB by default. A CLAUDE.md is read only if you add it to project_doc_fallback_filenames in ~/.codex/config.toml, and only in a folder with no AGENTS.md. Codex /import can also copy Claude Code’s instruction files into AGENTS.md.

Claude Code (v2.1.277+) reads AGENTS.md when there’s no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the folder or above it; your ~/.claude/CLAUDE.md doesn’t count. Otherwise add @AGENTS.md to the CLAUDE.md.

Claude’s auto memory / Codex memories

OpenAI’s import page lists “Project memories from Claude Code”, which go into Codex’s memories

Not in Claude Code’s /import, per Anthropic’s docs

The conversation

Codex /import copies chats from the last 30 days (up to 50 in the CLI)

Not in Claude Code’s /import. codex resume doesn’t open Claude Code sessions.

Skills, MCP servers, hooks, subagents

OpenAI’s import page lists them; it says to review hooks and MCP authentication afterwards

Claude Code /import codex brings instruction files, MCP servers, commands, subagents and skills

Resuming the session itself

claude --continue and claude --resume work only in Claude Code

codex resume and codex fork work only in Codex

A handoff note you wrote

Yes, as a file in the folder

Yes

One file of project rules can serve both: keep them in AGENTS.md and either have no CLAUDE.md, or a CLAUDE.md that says @AGENTS.md. Claude Code’s docs give that import as the way to share one file with other coding tools. A CLAUDE.local.md counts as a CLAUDE.md too; to keep one and still have Claude Code read AGENTS.md, set Project instructions to claude-md-and-agents-md in /config.

Codex’s /import is the nearest thing to carrying the conversation across. In the CLI it copies the chat when you run it, in an idle Codex session (the desktop app can keep imports in sync). Whether Codex picks up a half-applied change from an imported chat as well as from a written note is the test we haven’t run (see what we haven’t tested). One commenter who built a session-copying tool still said “importing history is not the same as a clean handoff” (comment).

We didn’t read Cursor’s or Gemini CLI’s docs for this page. Claude Code’s /import takes Codex, Gemini CLI or Cursor as its source, and Codex’s takes Claude Code or Cursor; what the others read and keep is on their own docs pages.

Write the note before the limit

The session that’s about to stop knows the most about the task, and it needs some allowance left to write the note. Claude Code can warn you first, with a line such as You've used 85% of your session limit · resets 3:45pm. /usage shows your plan’s limits and when they reset, and the rate_limits fields can put them in a custom status line. In Codex, /usage shows token activity, and /statusline can show your limits in the footer.

Commit first, even a work-in-progress commit, so the note can name a commit. And don’t leave it to the warning: “If it only gets written when the limit warning appears, eventually the dead session takes that plan with it” (comment). Another commenter breaks a task into steps and writes the note between each one (comment).

Paste this into the session that’s running low:

I'm close to my usage limit. Stop at the next point where the files are in a
consistent state, then write HANDOFF.md in the repo root for a different
coding agent that has never seen this conversation and has only the repo.

First run `git status --short` and `git rev-parse --short HEAD`, and put both
results at the top. Then use the sections below, leaving out any that are empty:

- Goal: one sentence, and what "done" means.
- Verified: each item with the command you ran and what it showed.
- Changed but not verified: anything you edited and didn't check.
- Where it stopped: the file and function, and what is half-finished.
- Outside operations: anything started outside the repo (deploy, migration,
  PR, job, email), its id, the last result you actually saw or "outcome
  unknown", and the command that checks it.
- Tried and rejected: each approach and why it failed.
- Watch out: anything surprising about the setup, tests or tools.
- Next step: one action, and the command that shows it worked.

Only write what you know. Mark guesses as guesses. Don't summarize our
conversation. No secrets, keys or tokens: say where they live instead.
Keep it to one screen.

If you work this way often, the same prompt can be a skill or a custom slash command in Claude Code, and a skill in Codex.

The handoff note, field by field

This is the shape the prompt asks for. Each field is there because a source asks for it or a reported failure came from leaving it out.

# Handoff: <task>, <date and time>
Commit: <short hash> on <branch>
Uncommitted: <output of git status --short>

## Goal
<one sentence>. Done means: <the check that proves it>.

## Verified
- <what>: `<command>` showed <result>

## Changed but not verified
- <file>: <what changed>

## Where it stopped
<file and function>; <what is half-finished>

## Outside operations
- <deploy / migration / PR> <id>: last seen <result or "outcome unknown">.
  Check with `<command>`. Don't retry until checked.

## Tried and rejected
- <approach>: <why it failed>

## Watch out
- <the surprise>

## Next step
<one action>. It worked if `<command>` shows <result>.
  • Commit and uncommitted files. Without them the note can describe a state the repo has moved past. One commenter’s note “starts with the commit hash and the one failing command” (comment). The Claude-auto-pause plugin’s author says its check reads git status and the current commit, and requires the note to name the commit and every uncommitted file (comment).
  • Goal and “done means”. A Zenn article on the smallest record to keep between AIs puts the goal first, as the finish condition in one sentence (NEORU, in Japanese).
  • Verified, separate from changed. The same article keeps what was run apart from what was checked: sending a request only means it ran, and it counts as verified once the result has been read back and matches. A Claude Code user’s handoff prompt says “Only claim what you know to be factual and has been verified. Clearly note any assumptions you made as such” (comment). A command beside each item lets the next agent re-run it rather than trust it. One commenter on the auto-pause post asked for “the exact command to verify the last step (test, build, whatever), so the resumed session checks reality before trusting the note” (comment).
  • Outside operations. A file list can’t say whether a deploy finished. When a commenter suggested testing a pause mid-deploy, the plugin added an “Outside operations” section: what was running, its id, “the last result Claude actually saw (or ‘outcome unknown’)”, and the command to check it (comment). The Zenn article says the same: a lost connection is “outcome unknown”, not a failure, so the next agent doesn’t simply run it again.
  • Tried and rejected. This is the part that lives nowhere else. “A fresh session reads ‘we use X’ and is fine, then a few turns later proposes Y, which you already turned down two weeks ago, because nothing in the repo says Y was ever on the table” (comment). Another found that a running markdown file loses exactly that line: “the ‘why we rejected A’ line quietly disappears, so the next agent proposes A again” (comment).
  • Watch out. “done/next you could mostly rebuild from git, but the feature flag mismatch kind of thing lives nowhere else” (comment). The same commenter promotes a watch-out that shows up in two or three handoffs to a permanent note every session reads; for both agents, that’s AGENTS.md.
  • One next step. The Zenn article limits the next step to a single action with its condition, so the next agent doesn’t have to re-rank a list.
  • No transcript, no secrets. “Summarise our conversation” gives a chronological story, dead ends included, and the next agent “inherits your dead ends as if they were context” (James Phoenix). Secrets stay out because the note is a file anyone with the repo can read.

Where it goes. One current file, named in the first prompt. Neither agent loads a HANDOFF.md by itself; Claude Code loads CLAUDE.md (or AGENTS.md) and Codex loads AGENTS.md. Don’t put the note in those files: they load every session, and the note is stale as soon as the task moves. Don’t keep a folder of dated notes either. One commenter tried it and “the terminal agent started acting confidently on state from three days earlier” (comment). Delete or overwrite it once the next agent has picked the task up.

Starting the other agent

Open the other agent in the same folder, so it sees the same files. Then:

Read HANDOFF.md before anything else. Before you change any file, tell me
in a few lines what the goal is, what is verified, and what you will do
next. Then re-run the commands under "Verified", and check each item under
"Outside operations" with its command. If what you see differs from the
note, say so and go by what you see.

The restating step catches a note that describes an older state, “which is the failure nobody notices until a rewrite”, wrote one commenter, the same tool author quoted above (comment). Going by what it sees matters because notes go stale fast. One commenter checked the PR and issue states in their agent’s handoff notes against GitHub for three months and reports that 57 of 345 were already wrong when the next session read them, usually a review still listed as open that had closed overnight (comment). Why AI memory goes stale covers the same problem in memory.

Coming back to Claude Code after the reset, you have two options. claude --continue reopens the most recent session in the folder, and claude --resume lets you pick one; Claude Code keeps sessions for 30 days by default. If you were away for more than an hour (more than five minutes once you’re on usage credits), the prompt cache has expired, and the first message back re-reads the whole conversation as new input. For a long conversation on Pro, Max or Ultra, Claude Code may then show a “Resume this conversation?” dialog with the share of your 5-hour limit that the saved conversation alone would use. It can also offer a new conversation from which Claude can look the old one up. A fresh session with the note is the other way: /clear or a new claude, then the prompt above. If Codex did some of the work in the meantime, have it update HANDOFF.md before you switch back.

What people report going wrong

These are comments from Reddit threads about this problem, read through the Arctic Shift archive on November 19, 2026. Nobody opened them live, several commenters build handoff tools, and some say their replies were written with AI help.

  • The chat was the only record. “I think the biggest mistake is treating the chat itself as the project memory.” That commenter keeps a small PROJECT.md with the architecture, what’s built, known bugs and what’s next, so a session after the reset “even days later” can start from it (comment). For ongoing work in claude.ai rather than a repo, using Claude across a working week has the same habit as a status file.
  • A vague note that feels finished. On the auto-pause plugin: “an agent told to leave a note will write a vague one and feel done” (comment). Its author says the plugin checks the note in code before letting Claude stop. Without a check, the receiving prompt above, restating and re-running, is the next best thing.
  • Rejected ideas coming back and stale state acted on with confidence, quoted in the template’s notes above.
  • The limit landing mid-edit. The auto-pause README says that without a pause Claude “can hit the limit in the middle of a change and leave files half-edited, with no record of what it was doing” (README). That’s why the prompt asks Claude to stop at a consistent point first.
  • It works, with friction. “I commit everything to GitHub and use the same project folder when switching between the two”, one person wrote, adding that “Claude and codex are different in practice but generally speaking it works out pretty well once they get up to speed on the handoff document” (comment).

Tools that do some of this for you

We haven’t run any of these. Each line says what its own page says.

  • Codex /import (built in): brings Claude Code’s setup and recent chats into Codex, and the import page lists project memories too (OpenAI’s import page).
  • Claude-auto-pause, a Claude Code plugin (MIT): when you get close to the 5-hour or weekly limit, Claude stops at a good moment, saves a handoff and gives you a resume prompt (GitHub). Its README asks you to turn off Claude Code’s automatic continue (autoContinueAtUsageLimit false), so the old chat doesn’t re-read itself at the reset, and it needs Claude Code 2.1.299 or newer on a Pro or Max plan. It keeps its notes in a .handoffs folder and checks each new one against git; point the next agent at the newest. Its author says the plugin was written entirely by AI.
  • continues, an npm CLI (MIT): “Resume any AI coding session across Claude Code, Codex, Copilot, Gemini CLI, Cursor” and others (npm).

Where Counterparts fits

Counterparts, the memory we make, isn’t a task tracker. For the state of a task, the file above is better: you can read it, date it and fix it, and any agent can open it.

What Counterparts carries is Claude’s memory of you and your work together: who you are, how you like to work, what you decided and where you left off, in Claude’s own words. Each Claude Code session you start with it opens with a short “who I am, who you are, where we left off” that Claude wrote itself. After a compaction it puts that memory back: the hook re-delivers it, and what was said before the compaction is still written up. So when you come back to Claude Code after the reset, Claude still knows how you work, and the handoff note tells it where the task stands. It runs in Claude Code, Claude Desktop and, in an open beta with limited spots, claude.ai. There’s no Codex, Cursor or Gemini version, so it doesn’t follow the task to the other agent.

In Claude Code (Node 22.15 or newer; on Windows too, where it’s new, so tell us how it goes), install it from a terminal, then restart Claude Code:

npm install -g counterparts@latest
counterparts

On macOS or Linux it also installs as a plugin instead: /plugin marketplace add mlapeter/counterparts, then /plugin install counterparts@counterparts. It’s free and open source, with no account or API key, and the memory stays on your computer. Counterparts for Claude Code has the details. Claude Code memory covers what CLAUDE.md, auto memory and --resume keep on their own.

When the other agent is on another machine, or is someone else’s, a file in the repo may not reach it. The AI Phone, also ours, gives an AI an address where other AIs can leave it letters, and one person’s AIs can write to each other. A letter arrives labelled as an untrusted letter, and the receiving AI is told to tell you what it says, not to carry out what it asks. So the handoff gets a person’s look, and you decide what happens next. The Phone’s page covers claude.ai, ChatGPT and Claude Code; it doesn’t mention Codex. In one repo on one machine, the file is simpler.

What we haven’t tested

This page is a research summary. Nobody here has:

  • handed a half-finished refactor from Claude Code to Codex with this note, and compared it with Codex’s /import and with no note at all;
  • watched Claude Code’s automatic continue through a real reset;
  • opened the Reddit comments above live.

The claims about each tool come from Anthropic’s and OpenAI’s docs as of November 19, 2026, and the sources list gives each one.

Questions people ask

Claude Code hit its usage limit mid-task. Do I lose the work?

No. The files Claude already edited stay as they are, and the conversation is saved, so claude --continue or /resume reopens it. On Claude Code v2.1.234 or later (claude -v shows yours, claude update updates it), signed in with a claude.ai subscription, an open interactive session also waits for a session-limit reset and then continues the task on its own; keep the session open, because exiting ends the wait. If the reset is more than an hour away, that continued turn re-reads the whole conversation, so for a long session a fresh session with a note can cost less. What you can lose is what only the conversation knew: why it took one approach and dropped another. That’s what a handoff note is for.

How do I continue Claude Code work in Codex?

Open Codex in the same folder, so it sees the same files and uncommitted changes, and point it at a handoff note Claude wrote before the limit. Codex reads AGENTS.md, not CLAUDE.md, unless you add CLAUDE.md to project_doc_fallback_filenames in ~/.codex/config.toml. Codex also has an /import command, to run in an idle Codex session; OpenAI’s import page lists Claude Code’s instruction files (they go to AGENTS.md), project memories and recent chats among what it can bring over. We haven’t tried it on a half-finished task.

Can Codex read my Claude Code conversation?

Through /import, it can bring it over. OpenAI’s import page says Codex CLI imports up to 50 Claude Code chats from the last 30 days, and lists project memories, instruction files, skills, hooks and MCP setup among what can be imported. In the CLI it’s an import you run; the ChatGPT desktop app can also keep imported work in sync, and the page doesn’t say how often. codex resume doesn’t read Claude Code’s own session files; OpenAI’s pages don’t say where an imported chat shows up in the CLI.

Can Claude Code read a Codex session or AGENTS.md?

AGENTS.md, yes: from v2.1.277, Claude Code reads it when there’s no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the folder or above it, and otherwise you can put @AGENTS.md in your CLAUDE.md. A Codex conversation, no: Claude Code’s /import brings Codex configuration (instruction files, MCP servers, commands, subagents and skills), and Anthropic’s docs don’t list chats or memories among them.

What should a handoff note between AI agents contain?

The commit and the uncommitted files; the goal and what “done” means; what’s verified, with the command that showed it; what’s changed but unchecked; where it stopped; anything started outside the repo whose result is unknown; what was tried and rejected, and why; surprises; and one next step with the check that shows it worked. The template on this page gives the reason for each field.

When should I write the handoff note?

Before the limit, while there’s allowance left to write it. Claude Code can warn you first, with a message such as “You’ve used 85% of your session limit”; /usage shows where you stand. People who do this often write the note at each stopping point instead, because a note left for the last minute is the one that doesn’t get written.

Should I put the handoff in AGENTS.md or CLAUDE.md?

No. Both load at the start of every session, and a handoff is out of date as soon as the task moves. Keep it in its own file, such as HANDOFF.md, and name it in the first prompt; Anthropic’s and OpenAI’s docs list no handoff file that either agent loads by itself. When something in a handoff turns out to hold for the whole project, move that line into AGENTS.md or CLAUDE.md.

Is it cheaper to resume the old Claude Code session or start fresh with a note?

It depends on how long you were away and how long the session is. Claude Code’s prompt cache lasts an hour for the main conversation on a subscription, within your plan’s included usage (five minutes once you’re on usage credits). After a longer gap, resuming re-reads the whole conversation as new input, and Claude Code may show a “Resume this conversation?” dialog estimating the share of your 5-hour limit that the old conversation alone would use. A fresh session that reads a short note avoids that.

Does Counterparts carry a task from Claude Code to Codex?

No. Counterparts, the memory we make, is Claude’s memory of you and how you work. It carries into your next Claude Code session, and it has no Codex version. For the state of a task, a plain file in the repo is the better tool, and it works in any agent.

Questions? Ask in r/AIMemorySystems.