agent-limit-retryfor Claude Code, Codex and ZCode on subscription plans
When a usage limit cuts your subagents off, they pick up where they stopped. Nothing gets redone.
A CLI and plugin that hands off before the limit, waits for the reset, and tells the main agent which subagents were cut off so it wakes them by id instead of dispatching them again. Runs on your machine: no proxy, no account, no telemetry.
One-time payment, full refund within 14 days. Checkout opens on creem.io.
Without the main agent sends the same tasks again
With agent-limit-retry each subagent is woken by id and continues
Install the free version
MIT-licensed. Node.js 18 or newer.
npx agent-limit-retry # one question, then the plugin and status line tap are installed
alr selftest # simulated limit hit and resume against a local fake API, no quota spent
alr status # your Claude Code and Codex quota windows
alr init backs up ~/.claude/settings.json before editing it and keeps an existing status line. alr uninstall undoes everything.
What goes wrong when the limit hits
On a Pro, Max, Plus or GLM plan you have a 5-hour window and a weekly one. Neither waits for a good moment.
If the limit hits while the main agent has parallel subagents running, every subagent fails at once. Each one still has its full context on disk and can be woken by id. After the reset the main agent almost never does that: it sends the same task again from scratch, paying quota for work that was already half done, or forgets the subagent entirely.
Claude Code's own auto-continue covers less than it seems. It continues the main conversation, in an interactive session, when the reset is under 24 hours away. Not the subagents, not weekly limits, not headless claude -p runs. Codex has no auto-continue at all, and none of its hooks fire on a limit error.
- 476
- subagents cut off by a usage limit across 5 of the author's own sessions
- 449
- never touched again after the cut: re-dispatched from scratch or forgotten
- 27
- got a message afterwards, 19 of them while testing this tool
The data to fix this is already there. Claude Code writes a quotaLimits.resetsAt field with the exact reset time; Codex writes a token_count.rate_limits snapshot right before the failure. Each subagent's transcript says what it was doing, which files it changed and what its last steps were.
How it works
Four hooks and one watcher. Nothing sits between you and the vendor's API.
Watch the windowsClaude Code passes your 5-hour and 7-day percentages to the status line; alr saves them. For Codex a per-thread watcher reads the rollout file.
Hand off at 90%The agent is told to finish its current step and write
HANDOFF.md: goal, done, in flight (including subagents), next steps, gotchas. Once per window.Record the limitThe exact reset time is taken from the transcript and you get a desktop notification. Pro also maps the killed subagents from their transcripts.
After the resetFree:
alr runresumes headless runs. Pro: the main agent is told to wake each subagent by id, and Codex gets a queued "continue".
What the main agent receives after the reset. Shortened example, Pro.
[agent-limit-retry] The usage limit reset at 18:00. It cut off 3 subagents that were still running. Resume them by id with SendMessage. Do not dispatch new agents for the same tasks.
- a1f3c2 "migrate auth tests to vitest"
changed: test/auth.test.ts, vitest.config.ts
last: rewriting mock for session store (step 4 of 6) - b77e01 "update API docs for v2"
changed: docs/api.md
last: writing the pagination section - c04d9a "fix flaky CI job"
changed: (none yet)
last: reading .github/workflows/ci.yml
In Codex the same message asks for followup_task on each child thread's path. In ZCode it asks for SendMessage, or ReadSessionContext plus a fresh agent if ZCode was restarted since. When the vendor already handled a case, alr says nothing.
Free and Pro
The free version does the handoff and the headless resume. Pro adds the part that saves the most quota: subagents.
| Feature | What it does | Free | Pro |
|---|---|---|---|
| One-command install | npx agent-limit-retry. Backs up your settings, keeps an existing status line. | Included | Included |
alr status | Claude Code and Codex quota windows with reset times. | Included | Included |
alr selftest | Simulated limit hit and resume against a local fake API. No quota spent. | Included | Included |
| Handoff before the limit | At 90% the agent finishes its step and writes HANDOFF.md. Claude Code only; ZCode has no status line. | Included | Included |
alr run "<task>" | Headless run that sleeps until the exact reset, then resumes the same session. Weekly limits included. | Included | Included |
| Desktop notifications | On a limit hit and when a handoff is written. | Included | Included |
alr report | Feedback file with events, tool names, subagent ids and states. No conversation content, no code; paths hashed. | Included | Included |
| Subagent resume | After the reset, the main agent is told which subagents the limit killed (id or path, task, files changed, last steps) and to wake them by id. Silent when the vendor already handled it. | Not included | Included |
| Codex auto-continue | A per-thread watcher waits for the reset and queues "continue" with codex queue. CLI and Desktop, macOS and Windows. | Not included | Included |
| Agents | Which coding agents the plugin hooks into. | Claude Code | Claude Code, Codex, ZCode |
Pricing
For developers who run long tasks with parallel subagents and have watched the same subagent get dispatched twice.
Pro is $29, once.
Full source, delivered as a zip with a SHA-256 checksum. Use it on every machine and plan you own.
- Subagent resume for Claude Code, Codex and ZCode
- Codex auto-continue after 5-hour and weekly limits
- No license server, no telemetry; the license file is informational
- 12 months of updates
- Full refund within 14 days, for any reason
Payments are processed by Creem as merchant of record; your card never reaches us. Ordering means you accept the terms. The license lets you use and modify the source on any machines and accounts you control, and not publish or resell it.
What it can't do
So you don't buy it for the wrong reason.
- It cannot raise your limits or change any vendor's policy. It only helps you use the plan you already have.
- It never rotates accounts, shares sessions, or touches your credentials.
- Claude Code handles the quit-or-crash case itself since 2.1.270. alr stays quiet there and only speaks up for subagents Claude Code didn't report.
- Verified end to end on macOS. Windows support for Codex is new and comes from early testers. The ZCode adapter was written from ZCode's source and fixtures; live reports are still coming in.
Questions
Claude Code already continues after a limit. Why this?
Its built-in auto-continue covers the main conversation, in an interactive session, when the reset is less than 24 hours away. It does not resume subagents (it reports them as "failed"), it does not cover weekly limits, and it does not cover headless claude -p runs. alr covers those three and stays out of the way otherwise.
How does it know which subagents were killed, and when the reset is?
From files the vendors already write. Claude Code stores a quotaLimits.resetsAt field with the exact reset time, and each subagent's transcript records its task, the files it changed and its last steps. Codex writes a token_count.rate_limits snapshot right before the failure and a rollout file per thread. ZCode keeps a SQLite session store. alr reads those and nothing else.
Why is subagent resume paid when the rest is free?
It is the part that took the work: reading three transcript formats, deciding which subagents were actually running at the moment of the cut, ignoring the ones already replaced or already reported by the vendor, and writing the instruction the main agent will follow. It is also the part that saves the most quota. The free version is complete on its own and stays MIT.
Does anything leave my machine?
No. There is no telemetry, no license check and no update ping. alr report writes a JSON file to your desktop that you can inspect and send by hand if you want to; it contains timestamps, event types, tool names and subagent ids, with project paths and task names hashed. Buying is separate: Creem handles your email and payment details as merchant of record.
Which agents and platforms are supported?
Claude Code 2.1.234 or newer on a Pro or Max plan, Codex CLI and Desktop, and ZCode. macOS is verified end to end; Windows support for Codex is reported by early testers. Codex asks you to trust newly installed hooks once, and alr codex-check tells you whether that happened. API-key users have no quota windows, so there is nothing to track.
What exactly do I get when I buy Pro?
A zip with the full source and a SHA-256 checksum, delivered by email within 24 hours, plus a license ID. Updates for 12 months. It installs the same way as the free version.
Support and refunds
Email support@autorun.fun with your order number. Full refund within 14 days of purchase, for any reason. Bugs and questions about the free version go to GitHub issues.