Repository navigation
Description
What variant of Codex are you using?
App
What feature would you like to see?
Feature Request: Usage-Limit Awareness and Automatic Agent Handoff for Codex
Problem
When Codex approaches its five-hour or weekly usage limit, an active development session can be interrupted without the agent having an opportunity to prepare a continuation plan.
This is especially problematic during complex software engineering tasks involving multiple files, architecture decisions, debugging, and partially completed implementations.
The next Codex session—or another agent—may have to reconstruct the previous agent's reasoning, progress, and outstanding work.
Proposed Solution
Make usage-limit information available to the Codex agent before its allowance is exhausted.
When the runtime detects that the agent is approaching its usage limit, it should notify the agent and provide an opportunity to transition into a structured handoff phase.
During this phase, Codex should:
- Summarize the original task and its objectives.
- Identify completed work and modified files.
- Document architectural decisions and important discoveries.
- Identify unfinished work, blockers, and known issues.
- Record verification results, including tests that passed or failed.
- Generate a clear continuation prompt for another agent or a future Codex session.
- Save the handoff in a persistent, machine-readable format when supported.
Suggested Architecture
The runtime should own usage-limit monitoring and notifications.
The agent should own reasoning, summarization, and preparation of the continuation plan.
The handoff should be stored as a durable artifact, rather than relying exclusively on conversation history.
Expected Behavior
Instead of abruptly terminating an active task when the usage allowance expires, Codex would proactively enter a handoff phase when sufficient budget remains.
If a handoff cannot be completed, the runtime should still preserve the latest available execution state.
When access becomes available again, Codex—or another compatible agent—could resume from the saved checkpoint without unnecessarily repeating completed work.
Benefits
- Less lost work when usage limits are reached.
- Easier continuation across Codex sessions.
- Improved interoperability between coding agents.
- Reduced repeated analysis and wasted tokens.
- More reliable execution of long-running engineering tasks.
- Better user experience for developers working on complex projects.
The core principle: A usage limit should pause execution, not destroy continuity.
Additional information
No response
Activity
github-actions commentedon Nov 6, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
DrPei12 commentedon Nov 6, 2026
The fallback when no model budget remains seems especially important. I would persist a small runtime checkpoint during execution, then let the model enrich it when an early warning is available. That avoids making recovery depend on one final successful summarization call.
For the checkpoint, I would include:
A useful acceptance test would cut off model access in the middle of a file edit or a long-running test, restart from the checkpoint, and check that it neither loses the edit nor launches duplicate work.
Disclosure: I maintain TeamSwarm, which keeps project material and work threads outside native harness sessions for continuation. That addresses part of the continuity problem inside its own workspace; it does not add advance Codex quota warnings or attach to arbitrary existing Codex sessions. Would a portable, user-readable checkpoint be useful for your workflow even before quota-triggered handoff is available?
tw159tw commentedon Nov 8, 2026
I strongly support this feature request. I would like to suggest a few additional improvements, particularly regarding configurable usage thresholds and automatic checkpointing.
1. User-Configurable Low-Quota Threshold
Allow users to set a warning threshold (for example, 5%, 10%, 15%, or 20% remaining) for applicable five-hour and weekly usage limits.
When the remaining allowance falls below the selected threshold, Codex should proactively prepare for a possible interruption rather than continuing until the limit is exhausted.
The threshold should be configurable globally and, ideally, per task or session.
2. Automatic Progress Preservation
When the warning threshold is reached, Codex should automatically:
The checkpoint should be stored persistently, not only in the conversation context.
3. Reliable Recovery After Usage Limits Reset
After the usage allowance becomes available again, Codex should be able to resume from the latest checkpoint.
Ideally, users could choose between manual resumption and automatic resumption where supported.
Before continuing, Codex should verify the saved file and task state to avoid repeating completed operations or overwriting existing progress.
4. Reserve Capacity for Checkpointing
A critical concern is that an agent might reach its usage limit before it can finish saving its progress.
I suggest maintaining lightweight checkpoints throughout execution, with a final structured handoff when the warning threshold is reached.
This would make recovery more reliable even if the remaining quota is insufficient for a complete final summary.
Expected Result
Usage limits should interrupt task execution when necessary, but they should not cause users to lose progress, repeat completed work, or spend additional usage reconstructing the previous session.
Thank you for considering these improvements.
bellowsai commentedon Nov 9, 2026
Disclosure: I'm Rob, and I built this.
Bellows, a desktop app for Windows, macOS and Linux that runs Codex alongside Claude, Gemini CLI, Qwen Code and any ACP agent, does this handoff today, and it doesn't depend on Codex having budget left for one last summary.
The checkpoint is kept as you go. After every turn, Bellows itself writes a line to
.bellows/memory.mdin the project: which agent, what you asked, which files changed, whether the last test run passed, what it cost. No model is involved, so the record is there when the limit hits.When Codex stops at its limit, Bellows says so and reads when it resets. You get two choices:
How it works: https://bellowsai.app/guides/resume-a-coding-agent-after-a-usage-limit?utm_source=github&utm_medium=reply
Give it a try on your next long task and tell me what's missing. We act fast on feedback.
bellowsai commentedon Nov 18, 2026
Update for anyone following this: since Bellows 1.28 (17 Nov) the handoff is automatic.
When Codex stops mid-task at its usage limit, the next agent you've set up (Claude, Gemini CLI, Qwen Code or any ACP agent) takes the task over straight away, in the same folder, with Codex's last exchanges and the project memory, and carries on. Nothing to click, and no last model call from Codex.
When Codex's limit resets, and the other agent is between turns, the task goes back to Codex with a handover. A limit that resets within five minutes is simply waited out. Every switch is on the audit trail, and Settings › Sessions › "Keep going at usage limits" chooses who takes over first, or turns it off.
It's free: https://bellowsai.app/guides/resume-a-coding-agent-after-a-usage-limit?utm_source=github&utm_medium=reply
Tell me how it holds up on a real limit. We act fast on feedback.
dijarvrella commentedon Nov 20, 2026
Keeping the work available to the next agent is exactly what we built WorkLedger for. We build it at Digital Disruptors.
The task, specification, decisions, unfinished work and recorded verification evidence live in WorkLedger as the agents work. For WorkBridge-managed jobs, you can enable handover at a configurable usage threshold before the allowance is exhausted. The job can pass to the next configured supported agent with capacity, including between Codex and Claude Code, on the same work item. The successor starts with the recorded context and next action.
That gives you a way to keep the task moving across usage limits today. Happy to demonstrate a Codex-to-Claude handover on a real task through our free guided 30-day pilot:
https://workledger-ai.com/early-access?utm_source=github&utm_medium=referral&utm_campaign=workledger-usage-handoff-2026-11-20
jappabl commentedon Nov 21, 2026
Until Codex can hand off on its own, it helps to keep the durable facts outside any one agent's session. I built Dawnmere for that: one memory on your Mac that Codex and Claude Code both read through their prompt hooks, so the notes you saved along the way come back in the other tool when you ask in similar words. One catch: a note typed in Codex is passed on at your next Codex prompt, so the very last one can wait. It won't carry a half-finished plan or the working diff. Free beta, Apple silicon Macs only. https://dawnmere.app/?src=gh-reply