This guide walks you through connecting cc-connect to Telegram, so you can chat with your local Claude Code via a Telegram bot.
- A Telegram account
- A machine that can run cc-connect (no public IP needed)
- Claude Code installed and configured
💡 Advantage: Uses Long Polling mode — no public IP, no domain, no reverse proxy needed.
Search for @BotFather in Telegram (the official bot manager) and start a chat.
⚠️ Make sure it's the verified official BotFather — don't use third-party imitations.
Send the command /newbot. BotFather will ask you to provide a name and username.
Enter a display name for your bot (e.g. cc-connect).
Enter a username (must end with bot, e.g. cc_connect_bot).
💡 Naming rules:
- Must end with
bot(case-insensitive)- Only letters, numbers, and underscores
- Must be globally unique
After creation, BotFather will reply with something like:
Done! Congratulations on your new bot...
Use this token to access the HTTP API:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz-123456
Keep your token secure...
⚠️ Save this token immediately — it's only shown once! If lost, use/mybots→ select bot →API Token→Revoke current tokento regenerate.
Add the token to your config.toml:
[[projects]]
name = "my-project"
[projects.agent]
type = "claudecode"
[projects.agent.options]
work_dir = "/path/to/your/project"
mode = "default"
[[projects.platforms]]
type = "telegram"
[projects.platforms.options]
token = "1234567890:ABCdefGHIjklMNOpqrsTUVwxyz-123456"If you want to restrict the bot to specific users/groups, you'll need the Chat ID.
- Send any message to your bot
- Visit the following URL (replace
{{TOKEN}}with your token):
https://api.telegram.org/bot{{TOKEN}}/getUpdates
- Find the
chat.idfield in the returned JSON
- Add the bot to a group
- Send a message mentioning @your_bot in the group
- Check the
getUpdatesURL — group Chat IDs are usually negative numbers
Note: Chat ID whitelisting is planned for a future release.
In BotFather, send:
/setcommands
Select your bot, then enter the command list:
help - Show available commands
new - Start a new session
list - List sessions
/setdescription
Enter a description — users will see this when they first open the bot.
cc-connect
# Or specify a config file
cc-connect -config /path/to/config.tomlYou should see logs like:
level=INFO msg="telegram: connected" bot=cc_connect_bot
level=INFO msg="platform started" project=my-project platform=telegram
level=INFO msg="cc-connect is running" projects=1
- Search for your bot's username in Telegram
- Click "Start" to begin
- Send a message
- Create or open a group
- Go to group settings → Add members
- Search and add your bot
- Send messages in the group
User: Help me analyze the current project structure
cc-connect: 🤔 Thinking...
cc-connect: 🔧 Tool: Bash(ls -la)
cc-connect: Here's the project structure...
┌─────────────────────────────────────────────────────────────┐
│ Telegram Cloud │
│ │
│ User Message ──→ Telegram Bot API ◄── Long Polling │
│ ▲ │
└──────────────────────────┼───────────────────────────────────┘
│
│ HTTPS (no public IP needed)
▼
┌─────────────────────────────────────────────────────────────┐
│ Your Local Machine │
│ │
│ cc-connect ◄──► Claude Code CLI ◄──► Your Project Code │
│ │
└─────────────────────────────────────────────────────────────┘
| Feature | Long Polling | Webhook |
|---|---|---|
| Public IP | ❌ Not needed | ✅ Required |
| Domain | ❌ Not needed | ✅ Required |
| HTTPS cert | ❌ Not needed | ✅ Required |
| Complexity | Simple | More complex |
| Latency | Low (long poll) | Low |
| Best for | Local dev, private network | Production |
Check the following:
- Is cc-connect running?
- Is the bot token correct?
- Have you sent a message after starting cc-connect? (The bot only receives messages after startup)
- Send
/mybotsto BotFather - Select your bot
- Click
API Token→Revoke current token
Make sure Group Privacy mode is disabled. In BotFather: /mybots → select bot → Bot Settings → Group Privacy → Turn off.