claude-auto-resume  by terryso

Resume Claude CLI tasks automatically

created 4 weeks ago

New!

493 stars

Top 63.5% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

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

  • Install: 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.
  • Prerequisites: Claude CLI installed and in PATH, standard Unix tools (grep, date, sleep, awk).
  • Usage: 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.
  • Docs: https://github.com/terryso/claude-auto-resume

Highlighted Details

  • Automatically detects Claude CLI usage limits and calculates wait times.
  • Supports resuming previous conversations (-c) or starting new sessions with custom prompts (-p).
  • Allows execution of arbitrary shell commands after waiting periods (-e or --cmd).
  • Includes a test mode (--test-mode) for development and validation.

Maintenance & Community

  • The project has a roadmap outlining future improvements.
  • Contributions are welcome via pull requests.

Licensing & Compatibility

  • Licensed under the MIT License.
  • Compatible with commercial and closed-source projects.

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.

Health Check
Last commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
9
Star History
504 stars in the last 90 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic) and Adam Wolff Adam Wolff(Claude Code Core; MTS at Anthropic).

claude-code-sdk-python by anthropics

4.0%
744
SDK for Claude Code interaction
created 1 month ago
updated 2 days ago
Feedback? Help us improve.