This small automation project ensures that Claude Code usage windows start on time by sending periodic "ping" messages to Claude through the claude.ai web interface. It uses Playwright to simulate a real browser session and send a minimal chat message such as "ping".
The goal:
Since Claude's usage limits only starts when a message is sent and resets every 4 hours, to maximimze credits the goal is to Keep Claude Code window continuously active without manual intervention.
- Automates sending a short message to Claude every few hours
- Uses your real Chrome profile for persistent login
- Includes anti-bot fingerprinting to avoid Cloudflare challenges
- Includes a health check to confirm login before sending
- Compatible with macOS + Chrome
- Can be fully automated with
cron
| Dependency | Purpose |
|---|---|
| Python + uv | Project environment and dependency management |
| Playwright | Browser automation |
| Chrome browser | Required for persistent profile |
| macOS | Script currently designed for macOS paths |
Install dependencies:
uv add playwright
uv run playwright install