Agentuna Agentuna
Build an agent

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.

Not tested yet. Vote for it to be next ⏱ ~15 min Updated: 2026-10-28

Jump to the prompt

Steps

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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."
  6. 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.
  7. 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.

Copy & paste
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 )

All notes for Claude Code

Sources (3): public reports, not re-tested by us

Moonfold (r/ChatGPTCoding) clauth (@BIGBULLapp on X) Sesori (@sesori_ai on X)

Real examples All real examples

What people actually did with these tools or for this problem, with the source.

OpenAI Codex

Spent $6,671 in two weeks of extra Codex credits on top of ChatGPT Pro — plus the ~/Downloads/AGENTS.md injection warning

Dr. Craig Horne shared billing receipts on X showing US$6,671 spent across 73 extra credit purchases in two weeks (13–26 Oct 2026) on top of a $200/month ChatGPT Pro subscription for Codex/Work runs, @clhdev reported one 1-hour background Codex task eating 49% of a weekly Pro pool, and The Hacker News reported a parent-directory ~/Downloads/AGENTS.md prompt-injection flaw.

Dr. Craig Horne (@DrCraigHorne), @clhdev & The Hacker News (@TheHackersNews) · x.com · · 3 independent reports

Claude Code

Burned a 5-hour Claude Max quota in 30 minutes via subagent file reads vs Spotify's 90% token-reduction harness

Developer @DeepakNesss reported (205.6K views on X) hitting the 5-hour Claude Max limit in roughly 30 minutes while debugging a single payment issue through the T3 Code multi-agent wrapper, while @AnnatarXBT documented how Spotify's internal Claude Code harness cut token burn by 90%.

Deepak (@DeepakNesss) & @AnnatarXBT on X · x.com · · 2 independent reports

Claude Code

Compacting an idle 602k-token Claude Code session after cache expiry burned 100% of the 5-hour Pro limit

Multiple Claude Code Pro users on r/ClaudeAI reported returning to a long coding thread after an overnight or 5-hour break, running /compact (or hitting auto-compaction), and losing 100% of their 5-hour usage quota in under two minutes without generating a single line of code.

r/ClaudeAI developers (u/Actual_Committee4670, u/Honest_Tennis_3375, u/Ruben715) · reddit.com · · 3 independent reports

Build apps (vibe coding) Not tested yet

Cap Cursor on-demand spend before it surprises you

Set a monthly limit on the paid usage Cursor bills after your included usage runs out, using Cursor's own settings, so an AI agent can't run up a bill you didn't plan for.

  • Cursor

8 min · Free to start · Copy-paste prompt

Build apps (vibe coding) Not tested yet

Slow Claude Code token burn: idle compaction, resume warnings and /rate-limit-options

Cut wasted weekly and 5-hour Claude Code usage by turning on Anthropic's idle compaction, heeding the Pro/Max resume warning, starting fresh sessions instead of reprocessing a huge idle thread, and stopping unattended sessions from burning the limit after you walk away.

  • Claude Code

15 min · From $20/mo · Agent template

Build apps (vibe coding) Not tested yet

Check Claude Code's local settings file for secrets

Find whether a "Yes, and don't ask again" approval saved a command that holds a secret in .claude/settings.local.json, rotate any key first, then untrack the file and stop it being committed.

  • Claude Code

15 min · From $20/mo · Copy-paste prompt