Environment Variables
Required
TELEGRAM_BOT_TOKEN
Bot token from BotFather. Used to authenticate with the Telegram Bot API.
Example: 123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Obtain via: send /newbot to @BotFather.
WHITELIST
Comma-separated list of Telegram user IDs who are allowed to use the bot. All other users are silently ignored.
Example: 111222333,444555666
To find your Telegram user ID, message @userinfobot.
Optional
CLAUDE_BIN
Default: claude
Path to the Claude Code binary. Set this if claude is not on your PATH.
CLAUDE_MODEL
Default: sonnet
Model used for all Claude Code sessions. Valid values: haiku, sonnet, opus.
SESSIONS_DIR
Default: ./sessions
Root directory for all user workspace data. Each user gets a subdirectory named by their chat ID.
IDLE_TIMEOUT_MS
Default: 600000 (10 minutes)
Idle timeout in milliseconds. The Claude subprocess is terminated after this long with no incoming messages.
All variables at a glance
| Variable | Required | Default |
|---|---|---|
TELEGRAM_BOT_TOKEN | ✅ | — |
WHITELIST | ✅ | — |
CLAUDE_BIN | ❌ | claude |
CLAUDE_MODEL | ❌ | sonnet |
SESSIONS_DIR | ❌ | ./sessions |
IDLE_TIMEOUT_MS | ❌ | 600000 |