驗證安裝
安裝完成後,在 Claude Code 中執行任意指令,然後點擊下方按鈕確認連線。
Telegram 遠端遙控
透過 Telegram 隨時從手機操控你的 Claude Code session,用自然語言下達指令、查看回覆,並遠端批准工具權限。
手機 Telegram ──訊息──> Telegram Bot
│
▼
Claude Code Channel Plugin (本地)
│ stdio
▼
Claude Code Session ──回覆──> Telegram Bot ──> 手機
- 從手機用自然語言操控 Claude Code
- 即時收到 Claude 的回覆與工作結果
- 遠端批准/拒絕工具使用權限 (Permission Relay)
- Sender Allowlist 安全控制
需要 Claude Code v2.1.80+、claude.ai 帳號登入、
Bun runtime。Team/Enterprise 需管理員啟用 Channels。
在 Telegram 搜尋 @BotFather,發送 /newbot。設定顯示名稱和 username(需以 bot 結尾)。複製 BotFather 回傳的 token。
curl -fsSL https://bun.sh/install | bash
Windows 用戶:
powershell -c "irm bun.sh/install.ps1 | iex"
啟動 Claude Code session,執行:
/plugin install telegram@claude-plugins-official
如果找不到 plugin,先更新 marketplace:
/plugin marketplace add anthropics/claude-plugins-official
/plugin marketplace update claude-plugins-official
安裝後執行 /reload-plugins 啟用設定指令。
用步驟 1 取得的 token 執行:
/telegram:configure <your-bot-token>
Token 會儲存到 ~/.claude/channels/telegram/.env
退出 Claude Code,以 channel 模式重新啟動:
claude --channels plugin:telegram@claude-plugins-official
在 Telegram 對你的 Bot 發送任意訊息,Bot 會回覆一個配對碼。回到 Claude Code 執行:
/telegram:access pair <pairing-code>
/telegram:access policy allowlist
設定 allowlist 後只有你的帳號能發送訊息。
現在從手機發送訊息給 Bot,Claude 會在你的本機執行工作並回覆結果。
搭配 Monitor Dashboard 使用:在 Dashboard 看全局狀態,在 Telegram 操控特定 session。
如果 Claude 碰到需要權限批准的操作,Telegram 會收到提示,你可以直接回覆 yes <id> 或 no <id> 來批准或拒絕。
Discord 也可以!
同樣的流程也適用於 Discord,只需將指令中的 telegram 替換為 discord,並使用 Discord Bot Token。詳見 官方文件。
Monitor Alert Channel
將 Monitor 的告警自動推送到你的 Claude Code session,讓 Claude 在偵測到異常時自動反應。
Monitor Server 偵測到異常
│ HTTP POST /alert
▼
Channel Server (localhost:8789)
│ stdio (MCP)
▼
Claude Code Session ──自動調查/修復
│ reply tool
▼
Monitor Dashboard 顯示回覆
- Session Error 自動偵測並通知 Claude 調查
- 用量接近上限時提醒 Claude 優化
- Session 異常停止時通知
- Claude 的回覆會顯示在 Dashboard
此功能需要先完成「Monitor Hook」基礎安裝。Alert Channel 是額外的增強功能。
curl -fsSL https://bun.sh/install | bash
Windows:
powershell -c "irm bun.sh/install.ps1 | iex"
Mac / Linux:
Windows (PowerShell):
cd ~/.claude/channel && bun install
在你的專案根目錄建立或編輯 .mcp.json:
或加入到全域設定 ~/.claude.json(對所有專案生效)。
告訴 Monitor Server 你的 Channel 在哪裡,讓它能推送告警:
使用開發模式啟動(自訂 channel 目前需要此 flag):
claude --dangerously-load-development-channels server:monitor-alert
Channel Server 會自動隨 Claude Code 啟動,監聽 localhost:8789。當 Monitor 偵測到異常會自動推送告警到你的 session。
手動發送一個測試告警:
curl -X POST http://localhost:8789/alert \
-H "Content-Type: application/json" \
-d '{"alert_type":"custom","message":"Test alert from Monitor","severity":"info"}'
你應該會在 Claude Code session 中看到告警訊息,Claude 會據此作出反應。
告警規則設定
你可以在 Monitor Dashboard 的告警設定中調整規則,或透過 API: