Developer Builds 20-Line Shell Script to Auto-Resume Rate-Limited Claude Code Sessions
A developer has shared a lightweight shell script that automatically resumes Claude Code AI sessions when they are interrupted by rate limits. The core problem was that unattended long-running tasks would silently halt on a rate limit, lose context, and restart from scratch upon manual intervention. The solution uses a file called PROGRESS.md, which Claude is instructed to update continuously as a work log, so any restart can pick up exactly where the session left off. The script loops up to 20 times, waits a configurable number of minutes after each non-zero exit code, then re-invokes Claude with a prompt to read PROGRESS.md and continue. The author notes that the --dangerously-skip-permissions flag is required for fully unattended operation but advises scoping it carefully to trusted tasks.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in