How to make Claude Code's unattended retry mode notice a usage limit lifted early
When you run Claude Code unattended, such as in CI or overnight jobs, with retry watchdog mode (CLAUDE_CODE_RETRY_WATCHDOG=1), a request that hits a usage limit waits until the limit resets. Version 2.1.305, released October 20, adds CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS: set it and, while waiting, Claude Code checks whether the limit was already lifted and sends the request at once if so.
export CLAUDE_CODE_RETRY_WATCHDOG=1
export CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS=600000 # check at most every 10 minutes
The value is the minimum interval between checks, in whole milliseconds, from 60000 (one minute) to 10800000 (three hours). When unset or outside that range, no checks are made.
Some conditions apply.
- Checks are made only for a claude.ai subscription's session or weekly limit, and not while usage credits are in use.
- No checks are made while
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICis set. - It requires Claude Code 2.1.305 or later.
To end the request instead of waiting when the reset is too far away, also set CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS from 2.1.301.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.