claude-auto-retry
Auto-retry Claude Code on subscription rate limits, API overload (529/5xx) and safeguard false positives — waits for the printed reset, exponential backoff, tmu
What is claude-auto-retry?
Auto-retry Claude Code on subscription rate limits, API overload (529/5xx) and safeguard false positives — waits for the printed reset, exponential backoff, tmux-based
Overview of claude-auto-retry
What it is
claude-auto-retry is a tool that automatically retries Claude Code sessions when they are interrupted by Anthropic subscription rate limits, API overload errors (529/5xx), or safeguard false positives. It waits for the printed reset time, applies exponential backoff, and uses tmux to keep the session alive across disconnects. The tool has no dependencies and requires no workflow change—just install and forget. Since Claude Code v2.1.234 (October 2026), native auto-continue handles the core usage-limit wait for interactive subscription sessions, but claude-auto-retry covers scenarios the native feature does not: keeping the wait alive when SSH drops or the terminal closes, waits that never arm (weekly resets >24h out, model-specific limits, Remote Control sessions), and other failure modes (API overloads, safeguard false positives, interrupted streams, near-limit wrap-up).
Key features
- Waits for the printed usage limit reset time and sends “continue” automatically.- tmux wrapper keeps the Claude Code session and the wait alive even if the SSH connection drops or the terminal closes.
- Handles weekly limits resetting more than 24 hours out, model-specific limits, and Remote Control sessions where native auto-continue does not arm.
- Exponential backoff for terminal API overload (529/5xx) after Claude Code’s internal retries give up.
- Bounded re-send for safeguard/AUP false positives.
- Configurable maxRetries (default 5) for repeated limit hits after resuming.
- Safe to run alongside native auto-continue; the monitor defers to native when it is active and acts as a backstop.
Use cases
- Running long Claude Code tasks overnight, over SSH, or unattended.
- When the native auto-continue feature does not arm: weekly limits resetting more than 24 hours out, model-specific limits while running another model, Remote Control sessions, or headless
claude -pruns. - When the session might die due to an SSH drop, terminal close, or machine sleep—the tmux wrapper keeps it alive.
- Handling API overloads (529/5xx), safeguard false positives, interrupted streams, and the near-limit wrap-up parking notice.
Getting started
bashnpm i -g claude-auto-retryclaude-auto-retry installThen type claude as you normally would.
License and pricing
This project is open source under the MIT license.
Based on the project's public README and repository metadata.