If you're a Claude Code Pro subscriber, you know the pain: you burn through your session at 3pm, and then you're locked out until 8pm. That's a 5-hour cooldown with zero usage. Half your workday, gone.
I built a Telegram bot to fix this.
The problem
Claude Code Pro gives you a 5-hour session window. Once it expires, you wait 5 hours before you can start a new one. There's no way to queue up your next session in advance, so you either waste prime working hours waiting, or you carefully plan your usage around the clock.
Neither option is great.
My solution: automated warmups
Claude Code Session Bot is a self-hosted Telegram bot that starts Claude Code sessions on a schedule. The idea is simple: start the session while you sleep, work out or are away from your keyboard so it's partially used up but still active when you need it.
Example usage scenario: schedule /schedule tomorrow 9am before bed. The bot calculates that it needs to warm up at 6am. By the time 9am rolls around, you still have 2 hours of usage left. That's enough for a productive morning. By 11am the session expires, the cooldown starts, and after lunch you have a fresh session ready to go.
How it works
The bot runs on a VPS (or any always-on machine) with the Claude CLI installed and authenticated. When a scheduled warmup fires, it runs:
claude -p "ready" --output-format json
This sends a minimal prompt to Claude, which starts the 5-hour session timer. The bot records the session in a local SQLite database and tracks time remaining.
Commands
| Command | What it does |
|---|---|
/warmup |
Start a session immediately |
/session |
Check active session status (time left, expiry) |
/schedule <datetime> [hours] |
Schedule a warmup so you have [hours] remaining at <datetime>
|
/schedules |
List pending scheduled warmups |
/cancel <id> |
Cancel a scheduled warmup |
/history |
View recent session history |
See the GitHub repo for full instructions.
Scheduling examples
/schedule tomorrow 9am # 2h remaining at 9am (warmup fires at 6am)
/schedule monday 14:00 3 # 3h remaining at 14:00 (warmup fires at 12:00)
/schedule jan 30 8:00 4h # 4h remaining at 8:00 (warmup fires at 7:00)
The math behind this is simple: warmup_time = target_time - (5h - desired_hours_remaining).
Date parsing is handled by chrono-node, so natural language like "tomorrow 9am" or "next monday 14:00" just works.
Architecture
The stack is intentionally minimal:
- TypeScript with strict mode
- SQLite (via better-sqlite3, WAL mode) for persistence
- node-telegram-bot-api for the Telegram interface
-
In-memory
setTimeouttimers restored from DB on restart
No external services, no Redis, no message queues. Schedules survive restarts because they're persisted to SQLite and restored when the bot boots.
Limitations
The bot only tracks sessions it starts. There's no Anthropic API to query your current session status, and reverse-engineering internal endpoints risks account bans. So if you start a session manually from your dev machine, the bot won't know about it.
For best results, use the bot as your sole session starter from a dedicated VPS.
Final thoughts
This is a simple tool for a specific annoyance. If you're a Claude Code Pro user who's tired of session cooldowns eating into your productive hours, give it a try.
The project is open source (MIT license) - contributions and feedback welcome.
Top comments (0)