Recipe · Build apps (vibe coding)
Hit your Claude Code usage limit mid-task? Hand off to Codex or Cursor without losing context
Stop re-explaining your project every time one coding agent hits its 5-hour or weekly usage wall. Keep one shared AGENTS.md and a 7-section HANDOFF.md in git (or pair it with open-source handoff tools like agent-baton, CarryOn, Friday, Automater Lite, or ccx) so Codex, Cursor or Claude Code picks up the exact branch, diff and failing test in under 2 minutes.
Steps
- Put the project rules in AGENTS.md at the repository root (install, test and lint commands, code style, folders not to touch). Codex and Cursor read AGENTS.md; for Claude Code, add a one-line CLAUDE.md that says "Read AGENTS.md first" so all agents share one source of truth.
- Commit early and often while the agent works, on a feature branch. Git is the real handoff: uncommitted work in one tool's session is the part you lose when a limit hits.
- Watch your remaining usage instead of discovering the limit mid-refactor: Claude Code shows it with /usage and Codex CLI with /status. When you are close to the limit, or before a long step, run the handoff prompt below.
- The agent writes HANDOFF.md: the goal, what is done, what is in progress, the exact next step, files touched, commands that pass or fail, and decisions made. Review it, then commit it together with the work in progress.
- Open the next agent in the same repository and branch (Codex CLI, Cursor's agent, or Claude Code after the reset) and start with: "Read AGENTS.md and HANDOFF.md, run the test command, confirm the next step in one sentence, then continue."
- Check that the new agent's one-sentence summary matches HANDOFF.md before you let it edit. If it does not, correct it now; a wrong start costs more usage than the handoff saved.
- When the task is finished, delete HANDOFF.md (or move the useful decisions into AGENTS.md) so a stale handoff never misleads the next session.
Prompt
Replace anything in { } with your details.
We are about to switch coding agents because of a usage limit. Before you stop, write HANDOFF.md at the repository root for another agent that has never seen this conversation. Use exactly these sections:
1. Goal: the task in 1-2 sentences and how we will know it is done.
2. Done: what is finished and committed, with commit hashes.
3. In progress: what is half-done, in which files, and what state it is in.
4. Next step: the single next action, specific enough to start without asking.
5. Commands: the test, lint and run commands, and which currently pass or fail (paste the failing output's key lines).
6. Decisions and constraints: choices we made and why, and anything the next agent must not change.
7. Open questions for me.
Do not include secrets, tokens or .env values. Then stage HANDOFF.md and all work in progress and commit it on the current branch with the message "wip: handoff". Do not push or merge. Expected output
A committed HANDOFF.md plus your work in progress on a feature branch, so Codex, Cursor or Claude Code can continue the same task in minutes, with one shared AGENTS.md instead of re-explaining the project.
Gotchas
- ⚠ SECURITY WARNING — Never launch Claude Code, Codex or Cursor inside ~/Downloads or an untrusted parent folder: coding agents walk up the directory tree looking for AGENTS.md or CLAUDE.md, and a malicious ~/Downloads/AGENTS.md file hijacked Codex into executing attacker commands in over 80% of controlled tests (reported by The Hacker News, Oct 2026).
- ⚠ Warm-cache compaction rule: Anthropic's prompt cache expires after roughly 1 hour of inactivity. Running /compact on a 600k-token session the next morning re-reads the entire uncached history and can burn 100% of a 5-hour Pro limit in one turn — always run /compact before stepping away, or set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 on Claude Code v2.1.311+.
- ⚠ Open-source handoff ecosystem (Oct 2026): alongside git-native AGENTS.md + HANDOFF.md, you can automate handoffs with baton / agent-baton (codeprakhar25/agent-baton or niketkal/baton for pre-limit hooks and baton pickup --to codex), CarryOn (MarShaikh/carryon for encrypted cross-machine session sync and 5h reset detection), Friday (splashxmoon/friday local multi-agent task board), Automater Lite v0.1.26 (usage-window tracker + cloud archives), or ccx (one-click macOS menu-bar switcher between Claude Code and Codex).
- ⚠ Subagent orchestrators (such as T3 Code or unthrottled background Codex cloud tasks) open full files on every sub-call and can burn a 5-hour Claude Max window in 30 minutes or 49% of a weekly ChatGPT Pro pool in 1 hour. Pin routine file search and boilerplate edits to cheap models (like Haiku, Sonnet or DeepSeek V4.1 Flash — Spotify cut Claude Code token burn by 90% with this pattern).
- ⚠ Never let HANDOFF.md contain API keys, OAuth tokens or .env values: it is committed to git and read by every agent and collaborator with repo access.
Where these tools break
- The limit, from Claude Code’s page: Claude Code draws from the same pool as Claude chat: Pro ($20/mo) and Max ($100/mo, 5x Pro) each have a 5-hour session cap plus a weekly cap, while Ultra ($200/mo, 10x Pro… (support.claude.com, checked )
- Known problem with Claude Code: Fake extension copies on Cursor's marketplace (29 Oct) (, cursor.com)
- Watch out with Claude Code: Claude Code is not on the free Claude plan; it uses your Pro or Max usage limits, and a batch of photos burns through them faster than text. Do 30 to 50 receipts at a time. From a recipe
- Real example with Claude Code: Burned a 5-hour Claude Max quota in 30 minutes via subagent file reads vs Spotify's 90% token-reduction harness. The catch: Self-reported developer post on X (24 Oct 2026) and architectural summary of Spotify's engineering setup; token savings depend on codebase size and subagent… (source dated )
Stretch a Codex Plus usage limit: 5 habits that cut re-reads Slow Claude Code token burn: idle compaction, resume warnings and /rate-limit-options
Sources (3): public reports, not re-tested by us
Moonfold (r/ChatGPTCoding) clauth (@BIGBULLapp on X) Sesori (@sesori_ai on X)