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.





