Resume Claude CLI tasks automatically
New!
Top 63.5% on sourcepulse
This utility is a shell script designed to automatically resume Claude CLI tasks that have been interrupted by usage limits, or to execute custom shell commands after specified waiting periods. It is targeted at developers using Claude Code who experience interruptions due to rate limiting, providing a way to automatically continue work or trigger subsequent build/deployment steps.
How It Works
The script monitors Claude CLI output for specific messages indicating usage limits. Upon detection, it parses timestamps to calculate the remaining wait time, displaying a countdown. Once the limit is lifted, it automatically re-executes the Claude CLI command, either to continue a previous conversation or start a new session with a custom prompt. Alternatively, it can execute user-defined shell commands after the wait period.
Quick Start & Requirements
wget -qO- https://raw.githubusercontent.com/terryso/claude-auto-resume/refs/heads/develop/claude-auto-resume.sh | sudo tee /usr/local/bin/claude-auto-resume >/dev/null && sudo chmod +x /usr/local/bin/claude-auto-resume
or via make install
.grep
, date
, sleep
, awk
).claude-auto-resume
to start a new session, claude-auto-resume -c
to continue a previous one, claude-auto-resume -e "command"
to execute a custom command.Highlighted Details
-c
) or starting new sessions with custom prompts (-p
).-e
or --cmd
).--test-mode
) for development and validation.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The script uses --dangerously-skip-permissions
, meaning Claude commands execute without confirmation, posing a security risk if used with untrusted prompts or in production environments. It relies on the Claude CLI's output format, which may require script updates if changed by the Claude CLI maintainers.
2 weeks ago
Inactive