{"slug": "show-hn-resume-claude-code-subagents-killed-by-a-usage-limit-don-t-redo-them", "title": "Show HN: Resume Claude Code subagents killed by a usage limit, don't redo them", "summary": "Developer tool agent-limit-retry launched as a Claude Code plugin that resumes subagents killed by usage limits by id instead of re-dispatching them, according to the project's Show HN post. The tool reads Claude Code's rate_limits status-line data and quotaLimits.resetsAt transcript fields to surface exact 5-hour and 7-day reset times, writes a HANDOFF.md at 90% of a window, and runs headless claude -p jobs that sleep through a reset and resume the same session via --resume, with --max-resumes defaulting to 5. A paid Pro tier at retry.autorun.fun adds subagent recovery for Claude Code, Codex (CLI and Desktop), and ZCode on the GLM Coding Plan.", "body_md": "**Keep Claude Code working through usage limits.** Know the exact reset time, hand off before the limit hits, and run headless jobs that sleep through the reset and resume themselves.\n\n```\nnpx agent-limit-retry    # one question, then the plugin is installed and the status line is tapped\nalr selftest                      # simulated limit hit + resume against a local fake API; no quota spent\nalr status                        # your 5-hour / 7-day windows, reset times, recent limit hits\n```\n\nRestart Claude Code after installing. Everything runs locally: no proxy, no account, no telemetry, no update ping.\n\nOn a Pro/Max plan you have a 5-hour window and a weekly one, and neither waits for a good moment. Claude Code's\nown auto-continue covers less than it seems: it continues the *main conversation*, in an *interactive* session,\nwhen the reset is *under 24 hours* away. It does not cover headless `claude -p` runs, weekly limits, or the work\nthat was in flight when the limit hit.\n\nagent-limit-retry reads what Claude Code already writes (the `rate_limits` it passes to the status line, the\n`quotaLimits.resetsAt` field in transcripts) and fills those gaps.\n\n|  | Claude Code built-in | agent-limit-retry | \n|---|---|---|\n| Continue the main conversation after a 5-hour reset (interactive) | ✅ | – | \n| Exact reset time of a limit hit + desktop notification | ❌ | ✅ | \n| Handoff file written *before* the limit hits (at 90 % of a window) | ❌ | ✅ | \n| Headless `claude -p` runs that sleep through the reset and resume the same session | ❌ | ✅ `alr run` | \n| Weekly limits | ❌ | ✅ | \n| Subagents killed by the limit resumed by id, not re-dispatched | ❌ | [Pro](https://retry.autorun.fun) | \n\nFour hooks in a Claude Code plugin, plus a status-line tap. No process sits between you and the API.\n\n1. **Status line tap.** Claude Code passes the status line your plan's`rate_limits` (5-hour and 7-day\npercentages and reset times). alr saves them, then prints your own status line unchanged, or a compact`⏳ 5h 62% · 7d 41%` if you had none.\n2. **Handoff before the limit** (`PostToolUse` ). Once a window passes the threshold, the agent is told to\nfinish its current step and write`HANDOFF.md` : goal, what's done, what's in flight, next steps, gotchas.\nOnce per window.\n3. **Stop guard** (`Stop` ). If the agent tries to end the turn without writing the handoff, it gets one\nreminder. It is never blocked twice.\n4. **Pick up later** (`SessionStart` ). A new or resumed session in that project is pointed at the handoff.\n5. **Limit hit** (`StopFailure` ). The hit is recorded with its exact reset time and you get a desktop\nnotification (macOS, Linux, Windows).\n\n```\nalr run \"migrate the test suite to vitest\" -- --permission-mode acceptEdits\n```\n\nRuns `claude -p`. If the run hits a usage limit, `alr run` reads the exact reset time from the session\ntranscript, sleeps until then (a laptop that slept through the reset carries on once it wakes), and resumes the\nsame session with `--resume`, telling the agent to read the handoff first. Weekly limits work the same way.\nKeep the process alive in tmux or with `nohup`. `--max-resumes` caps the retries (default 5).\n\nWhen a limit hits while the main agent has parallel subagents running, every subagent fails at once. Each one\nstill has its full context on disk and can be woken by id. After the reset the main agent almost never does\nthat: it re-dispatches the same tasks from scratch (same quota again) or forgets them, and often tries *before*\nthe reset so they fail twice.\n\n**Pro** finds the subagents a limit (or a crash) cut off, reads what each was doing (task, files changed, last\nsteps), and once the limit has actually reset tells the main agent to resume them by id. It is silent whenever\nClaude Code already handled a case itself. The same for **Codex** (CLI + Desktop, macOS/Windows, plus an\nauto-continue watcher since Codex has none) and **ZCode** (GLM Coding Plan).\n\n→ **[https://retry.autorun.fun](https://retry.autorun.fun)** · one-time purchase, full source, installs on top of this package.\n\n`~/.agent-limit-retry/config.json`\n\n| key | default |  | \n|---|---|---|\n| `threshold` | `90` | percent of a window that triggers the handoff | \n| `handoffFile` | `HANDOFF.md` | written in the project root (add it to `.gitignore` if you like) | \n| `maxResumes` | `5` | `alr run` gives up after this many resumes | \n| `resumeDelaySeconds` | `90` | extra wait after the reset time | \n| `notify` | `true` | desktop notification on a limit hit / handoff written | \n\n**Does it need my API key or account?** No. It only reads files Claude Code writes on your machine\n(`~/.claude/projects/**/*.jsonl`) and the JSON Claude Code pipes into the status line.\n\n**Will it change my settings?** `alr init` backs up `~/.claude/settings.json` before editing it, keeps an\nexisting status line and passes the same input through. `alr uninstall` restores everything.\n\n**Requirements.** Node.js 18+, Claude Code ≥ 2.1.234, a Pro or Max plan. API-key users have no usage windows,\nso nothing happens.\n\n**Does anything leave my machine?** No. `alr report` writes a JSON file to your desktop with timestamps, event\ntypes and tool names only (no conversation content, no code, project paths hashed) that you can send by hand\nwhen reporting a bug.\n\n**Can it raise my limits or rotate accounts?** No, and it never will. It only helps you use the plan you\nalready have.\n\n```\nnpm test                                    # node:test, no dependencies\nclaude -p \"...\" --plugin-dir ./plugin       # try the hooks without installing\nALR_HOME=/tmp/x ALR_DEBUG=1 alr ...         # isolated state and hook debug events\n```\n\nBug reports and PRs welcome. If a limit hit wasn't handled, attach the output of `alr report`.\n\nMIT © autorun", "url": "https://wpnews.pro/news/show-hn-resume-claude-code-subagents-killed-by-a-usage-limit-don-t-redo-them", "canonical_source": "https://github.com/error0702/agent-limit-retry", "published_at": "2026-09-24 14:41:43+00:00", "updated_at": "2026-09-24 14:59:39.636368+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["agent-limit-retry", "Claude Code", "Anthropic", "Codex", "ZCode", "GLM Coding Plan", "retry.autorun.fun"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-resume-claude-code-subagents-killed-by-a-usage-limit-don-t-redo-them", "markdown": "https://wpnews.pro/news/show-hn-resume-claude-code-subagents-killed-by-a-usage-limit-don-t-redo-them.md", "text": "https://wpnews.pro/news/show-hn-resume-claude-code-subagents-killed-by-a-usage-limit-don-t-redo-them.txt", "jsonld": "https://wpnews.pro/news/show-hn-resume-claude-code-subagents-killed-by-a-usage-limit-don-t-redo-them.jsonld"}}