claude-auto-resume

by terrysoVerified

A shell script utility that automatically resumes Claude CLI tasks when usage limits are lifted.

816
Stars
68
Forks
Shell
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/terryso/claude-auto-resume

Getting Started

Guides for using skills like claude-auto-resume.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

Claude Auto-Resume

BMAD

A shell script utility that automatically resumes Claude CLI tasks when usage limits are lifted, or executes custom shell commands after waiting periods. It detects Claude usage restrictions, waits intelligently, and resumes task execution automatically.

English | 中文

Claude/Codex 拼车服务

平台类型服务扫码拼团
ctok.ai🤝 合作伙伴✅ Claude Code
✅ Codex CLI

ko-fi

⚠️ SECURITY WARNING

This script uses --dangerously-skip-permissions flag when executing Claude commands and can execute arbitrary shell commands, which means:

  • Claude Code will execute tasks WITHOUT asking for permission
  • Custom shell commands will execute WITHOUT user confirmation
  • File operations, system commands, and code changes will run automatically
  • Use ONLY in trusted environments and with trusted prompts/commands
  • Review your prompt or command carefully before running this script

Recommended Usage:

  • Use in isolated development environments
  • Avoid on production systems or with sensitive data
  • Be specific with your prompts to limit scope of actions
  • Consider the potential impact of automated execution

Use Cases

This script is particularly useful when using Claude Code for development in the following scenarios:

  1. Task Interrupted by Usage Limits: When your Claude Code shows Claude usage limit reached. but your task is not yet completely finished
  2. Automatic Task Resumption: Simply run claude-auto-resume in your project's root directory, and when the usage limit is lifted, the script will automatically let Claude Code continue executing your previously unfinished task
  3. Custom Command Execution: Execute any shell command after waiting for usage limits, useful for restarting services, running builds, or processing data

Features

  • 🔄 Automatically detects Claude CLI usage limits
  • ⏰ Smart waiting with countdown display
  • 🚀 Automatic task resumption
  • 🔧 Custom command execution after wait periods
  • 🛡️ Security warnings with cancellation options
  • 🔗 Support for complex commands (pipes, redirections, operators)
  • 🧪 Built-in test mode for development and validation
  • 🖥️ Cross-platform support (Linux/macOS/Windows PowerShell)
  • 📦 Zero external dependencies (only standard Unix tools required)

Installation

Linux/macOS installation steps are identical to the original upstream repository and are kept unchanged below.

method 1: using wget (Recommended)

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

method 2: using Makefile

# Global installation
sudo make install

# Install to custom location
sudo make install PREFIX=/opt/local

# Uninstall
sudo make uninstall

method 3: Manual Installation

# Copy to system path
sudo cp claude-auto-resume.sh /usr/local/bin/claude-auto-resume
sudo chmod +x /usr/local/bin/claude-auto-resume

# Or create symbolic link
sudo ln -s $(pwd)/claude-auto-resume.sh /usr/local/bin/claude-auto-resume

method 4: Direct Usage (No Installation)

# Make script executable
chmod +x claude-auto-resume.sh

# Run directly
./claude-auto-resume.sh

Windows (PowerShell)

These Windows steps are specific to this fork. Linux/macOS users should use the methods above.

# From the repo root
$dest = Join-Path $env:USERPROFILE "bin"
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Copy-Item .\claude-auto-resume.ps1, .\claude-auto-resume.cmd $dest

Ensure the destination folder is on your user PATH, then run:

claude-auto-resume --help

Notes:

  • The .cmd wrapper lets you run claude-auto-resume directly from PowerShell or CMD.
  • The wrapper uses pwsh if available, otherwise falls back to Windows PowerShell.

Usage

Windows uses the same command-line options and flags as Linux/macOS.

Basic Usage

# Start new session with default prompt "continue"
claude-auto-resume

# Start new session with custom prompt
claude-auto-resume "implement user authentication"

# Start new session with custom prompt using flag
claude-auto-resume -p "write unit tests"

# Continue previous conversation with custom prompt
claude-auto-resume -c "please continue the previous task"

# Continue previous conversation with custom prompt using flag
claude-auto-resume -c -p "resume where we left off"

# Execute custom command after wait period
claude-auto-resume -e "npm run dev"

# Execute custom command with alias flag
claude-auto-resume --cmd "python app.py"

# Show help
claude-auto-resume --help

Local Usage (Before Installation)

# Ensure script is executable
chmod +x claude-auto-resume.sh

# Start new session with default prompt
./claude-auto-resume.sh

# Start new session with custom prompt
./claude-auto-resume.sh "create login page"

# Continue previous conversation
./claude-auto-resume.sh -c "continue with the implementation"

# Execute custom command after wait period
./claude-auto-resume.sh -e "make build"

How It Works

  1. Detect Limits: Execute claude -p 'check' command
  2. Parse Output: Look for Claude AI usage limit reached|<timestamp> format messages
  3. Calculate Wait Time: Calculate required wait time based on timestamp
  4. Display Countdown: Show real-time remaining wait time
  5. Auto Resume: Automatically execute either:
    • claude --dangerously-skip-permissions -p "<custom-prompt>" (new session, default)
    • claude -c --dangerously-skip-permissions -p "<custom-prompt>" (continue conversation with -c flag)
    • Custom shell command with -e/--execute or --cmd flags

Command Line Options

  • No arguments: Start new session with default prompt "continue"
  • Single argument: Start new session with custom prompt (e.g., claude-auto-resume "implement feature")
  • -p, --prompt: Specify custom prompt with flag (e.g., claude-auto-resume -p "write tests")
  • -c, --continue: Continue previous conversation (adds -c flag to claude command)
  • -e, --execute: Execute custom shell command after wait period (e.g., claude-auto-resume -e "npm run dev")
  • --cmd: Alias for -e/--execute (e.g., claude-auto-resume --cmd "python app.py")
  • --test-mode: [DEV] Simulate usage limit with specified wait time in seconds
  • -h, --help: Show help message and usage examples
  • -v, --version: Show version information
  • --check: Show system check information

Session Types

Start New Session (Default)

Uses claude without -c for fresh conversation:

claude-auto-resume                    # New session with "continue"
claude-auto-resume "new feature"      # New session with custom prompt
claude-auto-resume -p "write tests"   # New session with flag

Continue Previous Conversation

Uses claude -c to continue the last conversation:

claude-auto-resume -c "keep going"           # Continue with custom prompt
claude-auto-resume -c -p "resume work"       # Continue with flag

Execute Custom Commands

Execute any shell command after the wait period:

claude-auto-resume -e "npm run dev"                    # Start development server
claude-auto-resume --cmd "python app.py"               # Run Python application
claude-auto-resume -e "make build && ./app"            # Complex command with operators
claude-auto-resume -e "ls -la | grep '.js' | wc -l"    # Pipeline commands
claude-auto-resume -e "echo 'Step 1'; echo 'Step 2'"   # Multiple commands

Development and Testing

Use the built-in test mode for development and validation:

claude-auto-resume --test-mode 5 -e "echo 'Test command'"    # Test with 5-second wait
claude-auto-resume --test-mode 10 --cmd "npm run test"       # Test build process

Requirements

  • Claude CLI: Must be installed and available in PATH
  • Standard Unix Tools: grep, date, sleep, awk (usually pre-installed)
  • Windows: PowerShell 5.1+ or PowerShell 7+ (when using the Windows script)

Security Considerations

Permission Bypass

This script uses --dangerously-skip-permissions to enable unattended operation. This means:

  1. No interactive prompts: Claude will not ask for confirmation before executing commands
  2. Automatic execution: File changes, system commands, and other operations run without user approval
  3. Trust requirement: You must trust both the script and the prompt you provide

Best Practices

  • Environment isolation: Use only in development/testing environments
  • Prompt review: Carefully craft prompts to limit scope (e.g., "continue implementing the login function in src/auth.js")
  • Command review: Verify custom commands are safe and appropriate for your environment
  • Backup your work: Ensure you have version control or backups before running
  • Monitor execution: Check the output to understand what actions were taken
  • Limit scope: Use specific prompts/commands rather than open-ended ones

Error Handling

The script includes comprehensive error handling:

  • Exit Code 1: Claude CLI execution failed
  • Exit Code 2: Unable to extract valid resume timestamp
  • Exit Code 4: Resume command execution failed

Testing

# Syntax check
make test

# Or use bash directly
bash -n claude-auto-resume.sh

Project Structure

claude-auto-resume/
├── claude-auto-resume.sh    # Main script
├── claude-auto-resume.ps1   # Windows PowerShell script
├── claude-auto-resume.cmd   # Windows wrapper
├── Makefile                 # Installation/uninstallation script
├── docs/                    # Project documentation
│   ├── architecture.md      # Architecture documentation
│   ├── prd.md              # Product requirements document
│   └── stories/            # User stories
├── CLAUDE.md               # Claude Code guide
├── README.md               # Project description (English)
└── README.zh.md            # Project description (中文)

Roadmap

See our Development Roadmap for planned features and improvements, including:

  • Phase 1: Core stability improvements (environment validation, error handling)
  • Phase 2: Feature extensions (custom command execution, configuration options)
  • Phase 3: User experience optimization (enhanced help, better time display)

Contributing

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Create a Pull Request

Before contributing new features, please check our roadmap to ensure alignment with project goals.

License

This project is licensed under the MIT License - see the LICENSE file for details

Credits

Support

If you encounter issues or have suggestions:

  1. Check existing Issues
  2. Create a new Issue describing the problem
  3. Or submit a Pull Request

⭐ Star History

Star History Chart


Note: This tool depends on Claude CLI output format. If Claude CLI updates change the output format, the script may need to be updated.

Frequently Asked Questions

What is claude-auto-resume?

claude-auto-resume is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by terryso. A shell script utility that automatically resumes Claude CLI tasks when usage limits are lifted. It has 816 GitHub stars.

Is claude-auto-resume safe to use?

Yes. claude-auto-resume passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install claude-auto-resume?

Clone the repository with "git clone https://github.com/terryso/claude-auto-resume" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is claude-auto-resume written in?

claude-auto-resume is primarily written in Shell. It is open-source under terryso on GitHub, so you can review or fork the full source.

Are there alternatives to claude-auto-resume?

Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh claude-auto-resume against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI Toolsai-skillsantigravity
View details

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI Tools
View details

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI Tools
View details

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI Tools
View details

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI Tools
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details