Auto-resume after usage limit window resets
Resolved 💬 4 comments Opened Mar 19, 2026 by evolv-to Closed Mar 23, 2026
Problem
When a user hits their 5-hour usage limit with "extra usage" disabled, Claude Code hard-stops with no recovery path. The user must manually restart after the window resets.
Expected behavior
Claude Code should offer to wait and automatically resume when the usage window resets, rather than forcing a manual restart. This is a simple polling loop:
- Detect rate-limit / quota-exhausted response
- Display countdown or periodic status ("Usage window resets in ~Xm, waiting...")
- Auto-retry when the window opens
- Resume the session (or start a new one with context carried over via
--continue)
Why this matters
- Long-running agentic tasks get silently killed mid-execution
- Users on Pro/Team plans without extra usage lose session context
- The workaround is trivial (shell loop checking exit codes), which makes the missing built-in support feel like an oversight
Current workaround
#!/usr/bin/env bash
# claude-resume: auto-restart after rate limit
POLL_INTERVAL="${CLAUDE_POLL_INTERVAL:-300}"
while true; do
claude "$@"
EXIT_CODE=$?
[[ $EXIT_CODE -eq 0 ]] && break
echo "Rate-limited. Retrying in ${POLL_INTERVAL}s... (Ctrl+C to quit)"
sleep "$POLL_INTERVAL" || break
done
Suggested implementation
- Specific exit code for rate-limit (e.g., exit 75) so wrappers can distinguish from crashes
- Built-in
--wait-on-limitflag that enables the poll-and-resume loop natively - Ideally, keep the session alive in a paused state rather than exiting
Environment
- Claude Code 2.1.79
- macOS 15.5
- Plan: Pro (extra usage off)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗