MateCode — management tool for the Claude Code Telegram Bridge. Used to start, stop, and monitor the Telegram remote-control service.
通过 Telegram 远程控制 Claude Code。
# 启动服务
./matecode.sh start
# 停止服务
./matecode.sh stop
# 重启服务
./matecode.sh restart
# 查看状态
./matecode.sh status
# 查看日志
./matecode.sh logs
# macOS
brew install tmux
# Ubuntu/Debian
sudo apt-get install tmux
从 @BotFather 获取 bot token,然后设置环境变量:
export TELEGRAM_BOT_TOKEN="your_token_here"
# 添加到 ~/.zshrc 或 ~/.bashrc 使其永久生效
echo 'export TELEGRAM_BOT_TOKEN="your_token_here"' >> ~/.zshrc
cp hooks/send-to-telegram.sh ~/.claude/hooks/
nano ~/.claude/hooks/send-to-telegram.sh # 编辑设置 bot token
chmod +x ~/.claude/hooks/send-to-telegram.sh
添加到 ~/.claude/settings.json:
{
"hooks": {
"Stop": [{"hooks": [{"type": "command", "command": "~/.claude/hooks/send-to-telegram.sh"}]}]
}
}
| 文件 | 用途 |
|------|------|
| matecode.sh | 主启动脚本 |
| bridge.py | Telegram 桥接服务 |
| hooks/send-to-telegram.sh | Claude 响应钩子 |
| start_bridge.sh / stop_bridge.sh | 单独控制 bridge |
| 命令 | 功能 |
|------|------|
| /status | 检查 tmux 状态 |
| /clear | 清空对话 |
| /continue_ | 继续最近会话 |
| /resume | 选择会话恢复 |
| /stop | 中断 Claude |
# 检查环境变量
echo $TELEGRAM_BOT_TOKEN
# 检查端口占用
lsof -i :8081
# 查看详细日志
cat bridge.log
tail -f bridge.log
# 手动连接到会话
tmux attach -t claude
# 强制关闭所有相关进程
pkill -f "bridge\.py"
tmux kill-session -t claude
~/.claude/hooks/send-to-telegram.sh 是否正确配置TELEGRAM_BOT_TOKEN 已设置~/.claude/telegram_chat_id 是否存在~/.claude/settings.json 的 hooks 配置Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer