
将Claude Code连接到Telegram,打造个人AI助手
概览
一个个人AI助手,你可以通过Telegram从任何地方发消息。 你知道Claude Code在你的终端里运行,可以读取文件、执行命令、搜索网页等吗?这样你可以通过Telegram从手机和它对话,而不是绑定在电脑上。 你可以做的一些事情:- “我今天的日历上有什么?” - “在网上搜索X的最新新闻” - “阅读我的笔记并做摘要” - “每天早上7点给我发一份每日简报” 反过来也一样——Claude可以通过Telegram给你发消息(任务完成通知、预定简报、提醒等)。 开箱即用,Claude Code 可以读取文件和搜索网页。但要让它真正成为你的助手,必须创建让它访问你内容的技能:- Google 日历(读取你的日程表) - Gmail(只读邮件访问)- 备忘录应用(Obsidian、Apple Notes 等) - 你所在位置的天气 - 你想要的任何功能 技能/文件夹里有示例,方便你入门。
概述(AI 翻译)
一个个人AI助手,你可以通过Telegram从任何地方发消息。
这是什么?
你知道Claude Code在你的终端里运行,可以读取文件、执行命令、搜索网页等吗?这样你可以通过Telegram从手机和它对话,而不是绑定在电脑上。
在机器人运行Claude代码→给它发短信→回复。
你可以做的一些事情:
- “我今天的日历上有什么?”
- “在网上搜索X的最新新闻”
- “阅读我的笔记并进行总结”
- “每天早上7点给我发一份每日简报”
反过来也一样——Claude可以通过Telegram给你发消息(任务完成通知、预定简报、提醒等)。
**关键在于技能。**开箱即用,Claude Code可以读取文件并搜索网页。但要真正让它成为你的助手,创建能让它访问你资料的技能:
- 谷歌日历(阅读您的日程)
- Gmail(只读邮件访问)
- 笔记应用(Obsidian、Apple Notes等)
- 您所在地区的天气
- 你想怎么做都行
skills/ 文件夹里有示例,方便你入门。
快速启动
打开Claude代码并粘贴:
Claude会克隆仓库,并带你完成整个设置。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
claude-code-telegram
A personal AI assistant you can message from anywhere via Telegram.
What is this?
You know how Claude Code runs in your terminal and can read files, run commands, search the web, etc? This lets you talk to it from your phone via Telegram instead of being tied to your computer.
Text your bot → it runs Claude Code → sends back the response.
Some things you can do:
- “What’s on my calendar today?”
- “Search the web for the latest news on X”
- “Read my notes and summarize them”
- “Send me a daily briefing every morning at 7am”
It also works the other way - Claude can message YOU via Telegram (notifications when tasks finish, scheduled briefings, alerts, etc).
The key is skills. Out of the box, Claude Code can read files and search the web. But to make it truly YOUR assistant, create skills that give it access to your stuff:
- Google Calendar (read your schedule)
- Gmail (read-only access to emails)
- Notes app (Obsidian, Apple Notes, etc.)
- Weather for your location
- Whatever else you want
The skills/ folder has examples to get you started.
Quick Start
Open Claude Code and paste:
https://github.com/seedprod/claude-code-telegram - help me set this up
Claude will clone the repo and walk you through the entire setup.
Claude will walk you through:
- Creating a Telegram bot with @BotFather
- Getting your user ID from @userinfobot
- Configuring the
.envfile - Installing the telegram-sender skill globally
- Setting up launchd to run the bot continuously
- (Optional) Setting up scheduled skills like daily briefings
What’s Included
| File | Purpose |
|---|---|
telegram-bot.py |
Receives messages from Telegram → sends to Claude Code |
skills/telegram-sender/ |
Lets Claude send messages TO you |
skills/daily-brief/ |
Example scheduled skill using telegram-sender |
launchd/ |
Templates for running bot + scheduled skills |
How It Works
Inbound (you → Claude):
Telegram → telegram-bot.py → claude -p "message" → response → Telegram
Outbound (Claude → you):
Claude skill → telegram-sender/send.sh → Telegram API → you
Manual Setup
If you prefer to set up manually instead of having Claude guide you:
1. Prerequisites
- Claude Code CLI installed and authenticated
- Python 3.10+
2. Create Telegram Bot
- Message @BotFather on Telegram
- Send
/newbotand follow prompts - Copy the bot token
3. Get Your User ID
- Message @userinfobot on Telegram
- Copy your user ID
4. Configure
cp .env.example .env
# Edit .env with your token and user ID
5. Install Dependencies
pip install -r requirements.txt
6. Install Skill Globally
cp -r skills/telegram-sender ~/.claude/skills/
7. Run Bot (Manual)
python telegram-bot.py
8. Run Bot (launchd - Recommended)
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add seedprod/claude-code-telegram