claude-auto-retry: The Zero-Dependency Tool That Beats Claude Code's 5-Hour Limit

claude-auto-retry: The Zero-Dependency Tool That Beats Claude Code's 5-Hour Limit

A new tmux-based tool automatically detects Claude Code's subscription rate limit, waits for the reset, and sends 'continue'—letting you run long tasks unattended.

4h ago·3 min read·4 views·via hn_claude_code
Share:

The Problem: The 5-Hour Wall

Every Claude Code developer knows the frustration. You're deep into a complex refactor or a long-running analysis, and the TUI suddenly halts with the message: You've hit your limit · resets 3pm (Europe/Dublin). Your workflow is dead for hours. If you're running tasks overnight or stepping away from your machine, you must remember to come back and manually type continue. This interruption kills momentum and productivity.

The Solution: Automatic, Invisible Retries

claude-auto-retry is a new, dependency-free Node.js tool that solves this by acting as an intelligent monitor. You install it globally, run a setup command, and from then on, you just type claude as usual. The tool works by injecting a shell function into your .bashrc or .zshrc. When you start Claude Code, it transparently manages the session inside a tmux pane and runs a background monitor.

Here’s the core workflow it enables:

# 1. Install the tool
npm i -g claude-auto-retry

# 2. Run the installer (modifies your shell config)
claude-auto-retry install

# 3. Use Claude exactly as before
claude

When the rate limit message appears in the terminal, the background monitor (using ~0% CPU) detects it. It parses the reset time—timezone and DST-aware—waits for that time plus a 60-second safety margin, verifies Claude is still the foreground process, and then automatically sends the continue command via tmux send-keys.

Key Advantage: Tmux Persistence

The magic is its use of tmux. If you're not already in a tmux session, it creates one transparently. This means if your SSH connection drops, your terminal closes, or your laptop sleeps, the tmux session keeps running. The monitor keeps waiting. When you reconnect with tmux attach, you'll find Claude has already resumed and continued your task. This is a fundamental advantage over simple wrapper scripts that would die with your terminal session.

Configuration and Safety

The tool is designed to be safe and configurable. It verifies Claude is the foreground process before sending any keys to prevent input corruption. You can customize its behavior with a JSON config file at ~/.claude-auto-retry.json.

{
  "maxRetries": 5,
  "pollIntervalSeconds": 5,
  "marginSeconds": 60,
  "retryMessage": "Continue where you left off. The previous attempt was rate limited."
}

All configuration values are optional, and invalid entries fall back to safe defaults instead of crashing. It also supports --print mode, buffering output and retrying cleanly for piped or scripted usage.

Why This Matters for Your Workflow

Claude Code's subscription-based rate limits are a hard constraint for power users engaged in long-form development sessions. This tool doesn't change the limit but changes your relationship to it. It transforms the limit from an active blocker requiring your attention into a passive, managed pause. You can now start a multi-step code generation task before leaving work or going to bed, trusting it will complete. For developers using Claude Code in agentic workflows—where the assistant plans and executes a series of steps autonomously—this reliability is essential.

AI Analysis

Claude Code users should install `claude-auto-retry` today if they ever hit the subscription limit. It requires zero change to your existing `claude` command or TUI interaction. The primary action is to run the two installation commands and then forget about it. Integrate this into your long-running task strategy. Before starting a major refactor, codebase analysis, or overnight batch task, simply ensure you've launched Claude via your standard terminal. The tool handles the rest. This is particularly powerful for users who rely on SSH or who frequently close their laptops while tasks run. Consider creating the config file to tailor the retry message. A prompt like "Continue the previous task. We were interrupted by a rate limit. Please proceed with the next step in the plan." can help Claude maintain better context across the interruption, especially in complex, multi-turn sessions.
Original sourcegithub.com

Trending Now

More in Products & Launches

Browse more AI articles