Developer builds 46-line script to auto-resume Claude Code after rate limit blocks
A developer known as Lily created a shell script called resume-on-ratelimit.sh to automatically handle Claude Code's 5-hour rate limit interruptions without user intervention. The script monitors the Claude Code process exit code and, upon detecting a rate-limit-caused failure, waits a set number of minutes before retrying with the --continue flag, repeating up to 20 times over roughly 100 minutes. A key challenge the script addresses is that resuming a session alone does not restore working intent or task context, which is lost when a session is severed. To solve this, the workflow relies on a companion file called PROGRESS.md, where task state, completed steps, and next actions are continuously logged so the resumed session can pick up where it left off. Lily credits this system-oriented approach — letting automation run unattended through the night — as a contributing factor to rebuilding a ¥1.2 million per month revenue stream after a sudden job loss.
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