Auto-Claude is a Python-based automation wrapper for the Claude CLI that allows you to schedule delayed inputs to handle rate limits automatically. Perfect for long-running conversations where you need to send "Continue" or custom messages after a specific time delay.
When working with the Claude CLI, you may encounter rate limits that require you to wait before continuing your conversation. Auto-Claude solves this by:
- Opening Claude CLI in a separate window - Keeps your main terminal free for scheduling commands
- Scheduling delayed inputs - Set timers to automatically send messages after a specified duration
- Interactive wizard - Simple command interface to schedule "Continue" or custom messages
- Automatic message injection - Uses Windows VBScript to inject keystrokes into the Claude CLI window
Auto-Claude acts as a wrapper around the Claude CLI. Here's the workflow:
- Launch: Run
autoclaudecommand in your terminal - Separate Window: A new CMD window opens with the Claude CLI running
- Schedule Messages: In your original terminal, type
!timerto schedule a delayed message - Wizard Interface: Follow the prompts to set:
- ⏱️ Duration (e.g.,
5s,10m,1h,5h) - 💬 Action (Send "Continue" or a custom message)
- ⏱️ Duration (e.g.,
- Automatic Injection: After the timer expires, the message is automatically sent to the Claude CLI window
- Process Management: Spawns a detached CMD process with the Claude CLI
- Threading: Uses Python threads to handle user input and timer execution concurrently
- Window Activation: Leverages VBScript's
AppActivateto focus the Claude window by PID or title - Keystroke Injection: Uses
SendKeysto inject the scheduled message and press Enter - Color Support: Sets environment variables (
FORCE_COLOR,TERM) to preserve CLI colors
- Python 3.x installed and available in your PATH
- Claude CLI installed and configured (Anthropic Claude CLI)
- Windows OS (uses Windows-specific VBScript for keystroke injection)
-
Clone this repository:
git clone https://github.com/yourusername/auto-claude.git cd auto-claude -
Run the installer script:
.\install.ps1
-
Reload your PowerShell profile:
. $PROFILE
The installer creates an autoclaude alias in your PowerShell profile that points to the Python script.
-
Start Auto-Claude:
autoclaude
-
A new window opens with Claude CLI. Accept the initial prompt manually in that window.
-
In your original terminal, type
!timerwhen you want to schedule a message. -
Follow the wizard:
--- ⏸️ MODO DE PROGRAMACIÓN ⏸️ --- ⏱️ Introduce el tiempo de espera (ej: 5s, 10m, 1h, 5h): > 5m 💬 Elige acción: 1. Enviar 'Continue' 2. Mensaje personalizado > 1 ✅ Programado: Enviar "Continue" en 300.0 segundos.
5s- 5 seconds10m- 10 minutes1h- 1 hour5h- 5 hours
Scenario 1: Rate Limit Handling
You: [Long conversation with Claude]
Claude: [Rate limit message - wait 5 minutes]
You: !timer
> 5m
> 1 (Send "Continue")
[Wait 5 minutes - Auto-Claude sends "Continue" automatically]
Scenario 2: Custom Scheduled Message
You: !timer
> 10m
> 2 (Custom message)
> Please summarize our discussion
[After 10 minutes, sends "Please summarize our discussion"]
auto-claude/
├── auto_claude.py # Main Python wrapper script
├── install.ps1 # PowerShell installation script
├── .gitignore # Git ignore patterns
└── README.md # This file
-
auto_claude.py: Core script that handles:- Process spawning and management
- Input reading and command interception
- Timer scheduling and execution
- VBScript generation for keystroke injection
-
install.ps1: PowerShell installer that:- Creates a PowerShell function
Start-AutoClaude - Sets up the
autoclaudealias - Adds the configuration to your PowerShell profile
- Creates a PowerShell function
You can modify the following constants in auto_claude.py:
TARGET_CMD = ["cmd.exe", "/K", "claude"] # Command to launch
WINDOW_TITLE = "Claude Auto" # Default window title prefix- Ensure the Claude CLI window is visible (not minimized)
- Check that the window title matches the expected format
- Look for debug output in the original terminal showing VBScript execution results
The script tries multiple fallback methods:
- Activate by Process ID (most reliable)
- Activate by unique window title
- Activate by "claude" keyword
If all fail, you'll see an error message with details.
The script sets FORCE_COLOR=1 and TERM=xterm-256color. If colors still don't work, your terminal may not support ANSI colors.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This project is open source and available under the MIT License.
- Built for the Anthropic Claude CLI
- Inspired by the need to automate rate limit handling in long conversations
Note: This tool is designed for Windows. For macOS/Linux support, the keystroke injection mechanism would need to be adapted (e.g., using xdotool or AppleScript).