If you run the Claude Code agent overnight for deep refactoring or test generation, you have probably hit the rolling 5-hour message limit: once the quota runs out, the standard CLI fails with an error, losing your progress.
Starting with version v2.1.305, the utility includes a built-in watchdog timer. When the limit is exceeded, the agent pauses rather than exiting until the quota resets:
# Automatically wait for quota reset
export CLAUDE_CODE_RETRY_WATCHDOG=1
# Check API availability every 10 minutes
export CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS=600000
The second parameter is crucial: Anthropic periodically lifts limits early when cluster load drops. Pinging at an interval between 60 seconds and 3 hours lets the agent resume work ahead of the scheduled timer.
As we noted in our roundup of Claude Code tips, this pair of settings turns the terminal bot into a reliable autonomous worker that finishes the job in time for your morning coffee.
![Node.JS [ru]](/api/digests/it_development/daily/20261105/assets/sources/we-use-js.jpg?v=dd82e88a7e726190393fcef7d544ee35baed63c81bf03d147365326a808ee3c1)