Claude Code

Make Claude Restart the Moment Your Usage Limit Lifts

A new Claude Code setting lets an unattended run notice that your usage limit is already gone and carry on at once. The two settings, a copy-paste setup, and the catches that decide whether it works for you

2min read
1prompts to copy
4numbered steps
4sections

Claude Code 2.1.305 added a setting called CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS. In unattended retry mode, Claude used to wait out a usage limit until its reset time. With this setting it checks every few minutes whether the limit was lifted early, and sends the stuck request as soon as it was.

Here is what it does, how to turn it on, and the catches.

What it does

SettingWhat it does
CLAUDE_CODE_RETRY_WATCHDOG=1Unattended mode: retries capacity errors and waits out a usage limit instead of failing
CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MSHow often to check if the limit was already lifted: 60000 (1 minute) to 10800000 (3 hours)

When a check finds the limit lifted, the waiting request goes out at once.

Set it up

  1. Update Claude Code to version 2.1.305 or later.
  2. Turn on unattended retry mode for the run: export CLAUDE_CODE_RETRY_WATCHDOG=1
  3. Choose how often to check, in milliseconds. For every 5 minutes: export CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS=300000
  4. Start your unattended job as usual, for example a CI job or an overnight run.
RUN IN YOUR TERMINAL
export CLAUDE_CODE_RETRY_WATCHDOG=1
export CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS=300000
claude -p "your task here"

Free, for your email

Get the full setup steps + the copy-paste setup prompt

The rest of this guide (2 more sections) opens right here. The setup prompt, one paste into Claude that sets it all up, comes by email only. Use your real address.

50,000+ follow where these guides come from. No spam, unsubscribe in one click.

Read next