Telegram Claude Bot - Session Notes
Date: 2026-02-28
What We Worked On
- Set up full infrastructure for a Claude-powered Telegram bot on DigitalOcean
- Created Anthropic API workspaces to separate G&M, Personal, and Hey Royal usage
- Created API key, Telegram bot (@heyroyalbot), and DigitalOcean Droplet
- Deployed bot code, tested end-to-end, and hardened the server
Key Decisions Made
- Bot platform: Telegram (most stable, clean API)
- Hosting: DigitalOcean Droplet ($4/mo, 512MB, Ubuntu 24.04 LTS, NYC3)
- API billing: Separate Anthropic API account (not Max plan — Max doesn't include API access)
- Org structure: Single Anthropic org (Eric's Individual Org) with 4 workspaces: Default (personal), Claude Code, Grain & Mortar, Hey Royal
- Bot workspace: Default workspace (personal project)
- Model: Sonnet (best cost/capability ratio for coding + research tasks)
Infrastructure
DigitalOcean Droplet
- Name: claude-telegram-bot
- Droplet ID: 555128056
- Public IP: 174.138.58.154
- SSH: Key-based access from Eric's Mac (
ssh root@174.138.58.154) - DO Account: hey@heyroyal.co
- Credentials: In
~/Desktop/CLAUDE-BOT-CREDENTIALS.md→ save to 1Password then delete
Bot Details
- Username: @heyroyalbot
- Eric's Telegram User ID: 8630998612 (bot locked to this ID)
- Bot code:
/opt/claude-bot/bot.pyon Droplet - Service:
claude-bot.service(systemd, auto-restart) - Runs as:
claude-botsystem user (not root)
Changes Made
- Created 2 new Anthropic workspaces: "Grain & Mortar" (Gold) and "Hey Royal" (Purple)
- Enabled API key creation in Default workspace
- Created
telegram-botAPI key in Default workspace - Created DigitalOcean Droplet
claude-telegram-botinClaude Botproject - Installed
sshpasslocally via Homebrew, copied SSH key to Droplet - Python 3.12.3 venv with
anthropic(0.84.0) andpython-telegram-bot(22.6) - Wrote and deployed bot.py with conversation history, access control, /whoami, /clear, /model commands
- Created systemd service for auto-start/restart
- Security hardening:
- Enabled UFW firewall (SSH only)
- Disabled SSH password authentication (key-only)
- Installed and enabled fail2ban
- Created dedicated
claude-botuser (bot no longer runs as root) - Access control: only Eric's Telegram ID (8630998612) can use the bot
Completed
- [x] Write the Telegram bot Python code
- [x] Create Python venv and install dependencies
- [x] Configure environment variables on the Droplet
- [x] Set up systemd service for auto-start/restart
- [x] Test the bot end-to-end
- [x] Add access control (locked to Eric's Telegram ID)
- [x] Server security hardening (UFW, fail2ban, no password SSH, non-root bot user)
Still Pending (User Action)
- [ ] Save
~/Desktop/CLAUDE-BOT-CREDENTIALS.mdto 1Password, then delete it - [ ] Add credit card to Anthropic account ($4.68 free credits expire Apr 1, 2026)
Future Enhancements (Discussed)
- GitHub integration (search repos from the bot)
- Web search capability
doctlCLI setup for Droplet management
Technical Notes
- SSH access:
ssh root@174.138.58.154(key-based, no password) - Droplet uses ~45MB RAM for the bot — plenty of headroom on 512MB
- Max plan (claude.ai) does NOT include API access — separate billing required
- Anthropic console doesn't support multiple orgs per account — workspaces are the alternative
- DigitalOcean account is under hey@heyroyal.co (Hey Royal entity)
sshpassinstalled locally at/opt/homebrew/Cellar/sshpass/1.06- Bot uses polling (not webhooks) — no inbound ports needed beyond SSH
Session completed 2026-02-28