
claude-to-im
Bridge THIS Claude Code or Codex session to Telegram, Discord, Feishu/Lark, QQ, or WeChat so the user can chat with Claude from their phone. Use for: setting up, starting, stopping, or diagnosing the claude-to-im bridge daemon; forwarding Claude replies to a messaging app; any phrase like "claude-to-im", "bridge", "消息推送", "消息转发", "桥接", "连上飞书", "手机上看claude", "启动后台服务", "诊断", "查看日志", "配置". Subcommands: setup, start, stop, status, logs, reconfigure, doctor. Do NOT use for: building standalone bots, webhook integrations, or coding with IM platform SDKs — those are regular programming tasks.
- Installs
- 7.1K
- Last 24h
- —
- Trending rank
- —
- Security
- Fail
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/op7418/claude-to-im-skill --skill claude-to-im- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads claude-to-im automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Claude-to-IM Bridge Skill
You are managing the Claude-to-IM bridge.
User data is stored at ~/.claude-to-im/.
The skill directory (SKILL_DIR) is at ~/.claude/skills/claude-to-im.
In Codex installs it may instead be ~/.codex/skills/Claude-to-IM-skill.
If neither path exists, fall back to Glob with pattern **/skills/**/claude-to-im/SKILL.md or **/skills/**/Claude-to-IM-skill/SKILL.md and derive the root from the result.
Command parsing
Parse the user's intent from $ARGUMENTS into one of these subcommands:
| User says (examples) | Subcommand |
|---|---|
setup, configure, 配置, 我想在飞书上用 Claude, 帮我连接 Telegram, 帮我接微信 | setup |
start, start bridge, 启动, 启动桥接 | start |
stop, stop bridge, 停止, 停止桥接 | stop |
status, bridge status, 状态, 运行状态, 怎么看桥接的运行状态 | status |
logs, logs 200, 查看日志, 查看日志 200 | logs |
reconfigure, 修改配置, 帮我改一下 token, 换个 bot | reconfigure |
doctor, diagnose, 诊断, 挂了, 没反应了, bot 没反应, 出问题了 | doctor |
Disambiguation: status vs doctor — Use status when the user just wants to check if the bridge is running (informational). Use doctor when the user reports a problem or suspects something is broken (diagnostic). When in doubt and the user describes a symptom (e.g., "没反应了", "挂了"), prefer doctor.
Extract optional numeric argument for logs (default 50).
Before asking users for any platform credentials, read SKILL_DIR/references/setup-guides.md internally so you know where to find each credential. Do NOT dump the full guide to the user upfront — only mention the specific next step they need to do (e.g., "Go to https://open.feishu.cn → your app → Credentials to find the App ID"). If the user says they don't know how, then show the relevant section of the guide.
Runtime detection
Before executing any subcommand, detect which environment you are running in:
- Claude Code —
AskUserQuestiontool is available. Use it for interactive setup wizards. - Codex / other —
AskUserQuestionis NOT available. Fall back to non-interactive guidance: explain the steps, showSKILL_DIR/config.env.example, and ask the user to create~/.claude-to-im/config.envmanually.
You can test this by checking if AskUserQuestion is in your available tools list.
Config check (applies to start, stop, status, logs, reconfigure, doctor)
Before running any subcommand other than setup, check if ~/.claude-to-im/config.env exists:
- If it does NOT exist:
- In Claude Code: tell the user "No configuration found" and automatically start the
setupwizard using AskUserQuestion. - In Codex: tell the user "No configuration found. Please create
~/.claude-to-im/config.envbased on the example:" then show the contents ofSKILL_DIR/config.env.exampleand stop. Don't attempt to start the daemon — without config.env the process will crash on startup and leave behind a stale PID file that blocks future starts.
- In Claude Code: tell the user "No configuration found" and automatically start the
- If it exists: proceed with the requested subcommand.
Subcommands
setup
Run an interactive setup wizard. This subcommand requires AskUserQuestion. If it is not available (Codex environment), instead show the contents of SKILL_DIR/config.env.example with field-by-field explanations and instruct the user to create the config file manually.
When AskUserQuestion IS available, collect input one field at a time. After each answer, confirm the value back to the user (masking secrets to last 4 chars only) before moving to the next question.
Step 1 — Choose channels
Ask which channels to enable (telegram, discord, feishu, qq, weixin). Accept comma-separated input. Briefly describe each:
- telegram — Best for personal use. Streaming preview, inline permission buttons.
- discord — Good for team use. Server/channel/user-level access control.
- feishu (Lark) — For Feishu/Lark teams. Streaming cards, tool progress, inline permission buttons.
- qq — QQ C2C private chat only. No inline permission buttons, no streaming preview. Permissions use text
/perm ...commands. - weixin — WeChat QR login. Single linked account only; a new login replaces the previous one. No inline permission buttons, no streaming preview. Permissions use text
/perm ...commands or quick1/2/3replies. Voice messages only use WeChat's own speech-to-text text; raw voice audio is not transcribed by the bridge.
Step 2 — Collect tokens per channel
For each enabled channel, collect one credential at a time. Tell the user where to find each value in one sentence. Only show the full guide section (from SKILL_DIR/references/setup-guides.md) if the user asks for help or says they don't know how:
- Telegram: Bot Token → confirm (masked) → Chat ID (see guide for how to get it) → confirm → Allowed User IDs (optional). Important: At least one of Chat ID or Allowed User IDs must be set, otherwise the bot will reject all messages.
- Discord: Bot Token → confirm (masked) → Allowed User IDs → Allowed Channel IDs (optional) → Allowed Guild IDs (optional). Important: At least one of Allowed User IDs or Allowed Channel IDs must be set, otherwise the bot will reject all messages (default-deny).
- Feishu: App ID → confirm → App Secret → confirm (masked) → Domain (optional) → Allowed User IDs (optional). After collecting credentials, explain the two-phase setup the user must complete:
- Phase 1 (before starting bridge): (A) batch-add permissions, (B) enable bot capability, (C) publish first version + admin approve. This makes permissions and bot effective.
- Phase 2 (requires running bridge): (D) run
/claude-to-im start, (E) configure events (im.message.receive_v1) and callback (card.action.trigger) with long connection mode, (F) publish second version + admin approve. - Why two phases: Feishu validates WebSocket connection when saving event subscription — if the bridge isn't running, saving will fail. The bridge needs published permissions to connect.
- Keep this to a short checklist — show the full guide only if asked.
- QQ: Collect two required fields, then optional ones:
- QQ App ID (required) → confirm
- QQ App Secret (required) → confirm (masked)
- Tell the user: these two values can be found at https://q.qq.com/qqbot/openclaw
- Allowed User OpenIDs (optional, press Enter to skip) — note: this is
user_openid, NOT QQ number. If the user doesn't have openid yet, they can leave it empty. - Image Enabled (optional, default true, press Enter to skip) — if the underlying provider doesn't support image input, set to false
- Max Image Size MB (optional, default 20, press Enter to skip)
- Remind user: QQ first version only supports C2C private chat sandbox access. No group/channel support, no inline buttons, no streaming preview.
- Weixin: Do not ask for a static token. Instead:
- Tell the user this channel uses QR login, not manual credential entry.
- Run
cd SKILL_DIR && npm run weixin:login - The helper writes
~/.claude-to-im/runtime/weixin-login.htmland tries to open it automatically in the local browser. - If auto-open fails, tell the user to open that HTML file manually and scan the QR code with WeChat.
- Wait for the helper to report success, then confirm that the linked account was saved locally.
- Explain briefly: the linked Weixin account is stored in
~/.claude-to-im/data/weixin-accounts.json. Running the helper again replaces the previously linked account. - Explain briefly:
CTI_WEIXIN_MEDIA_ENABLEDonly controls inbound image/file/video downloads. For voice messages, the bridge only accepts the text returned by WeChat's built-in speech-to-text. If WeChat does not provide a transcript, the bridge replies with an error instead of downloading/transcribing raw audio.
Step 3 — General settings
Ask for runtime, default working directory, model, and mode:
- Runtime:
claude(default),codex,autoclaude— uses Claude Code CLI + Claude Agent SDK (requiresclaudeCLI installed)codex— uses OpenAI Codex SDK (requirescodexCLI; auth viacodex auth loginorOPENAI_API_KEY)auto— tries Claude first, falls back to Codex if Claude CLI not found
- Working Directory: default
$CWD - Model (optional): Leave blank to inherit the runtime's own default model. If the user wants to override, ask them to enter a model name. Do NOT hardcode or suggest specific model names — the available models change over time.
- Mode:
code(default),plan,ask
Step 4 — Write config and validate
- Show a final summary table with all settings (secrets masked to last 4 chars)
- Ask user to confirm before writing
- Use Bash to create directory structure:
mkdir -p ~/.claude-to-im/{data,logs,runtime,data/messages} - Use Write to create
~/.claude-to-im/config.envwith all settings in KEY=VALUE format - Use Bash to set permissions:
chmod 600 ~/.claude-to-im/config.env - Validate tokens — read
SKILL_DIR/references/token-validation.mdfor the exact commands and expected responses for each platform. This catches typos and wrong credentials before the user tries to start the daemon. For Weixin, a successful QR login already counts as validation. - Report results with a summary table. If any validation fails, explain what might be wrong and how to fix it.
- On success, tell the user: "Setup complete! Run
/claude-to-im startto start the bridge."
start
Pre-check: Verify ~/.claude-to-im/config.env exists (see "Config check" above). Without it, the daemon will crash immediately and leave a stale PID file.
Run: bash "SKILL_DIR/scripts/daemon.sh" start
Show the output to the user. If it fails, tell the user:
- Run
doctorto diagnose:/claude-to-im doctor - Check recent logs:
/claude-to-im logs
stop
Run: bash "SKILL_DIR/scripts/daemon.sh" stop
status
Run: bash "SKILL_DIR/scripts/daemon.sh" status
logs
Extract optional line count N from arguments (default 50).
Run: bash "SKILL_DIR/scripts/daemon.sh" logs N
reconfigure
- Read current config from
~/.claude-to-im/config.env - Show current settings in a clear table format, with all secrets masked (only last 4 chars visible)
- Use AskUserQuestion to ask what the user wants to change
- When collecting new values, tell the user where to find the value; only show the full guide from
SKILL_DIR/references/setup-guides.mdif they ask for help - Update the config file atomically (write to tmp, rename)
- Re-validate any changed tokens
- Remind user: "Run
/claude-to-im stopthen/claude-to-im startto apply the changes."
If the user wants to switch Weixin accounts during reconfigure, run cd SKILL_DIR && npm run weixin:login again. Each successful scan replaces the previously linked local account.
doctor
Run: bash "SKILL_DIR/scripts/doctor.sh"
Show results and suggest fixes for any failures. Common fixes:
- SDK cli.js missing →
cd SKILL_DIR && npm install - dist/daemon.mjs stale →
cd SKILL_DIR && npm run build - Config missing → run
setup - Weixin account missing / expired →
cd SKILL_DIR && npm run weixin:login - Weixin voice message reports missing speech-to-text → enable WeChat's own voice transcription and resend; the bridge does not transcribe raw voice audio itself
For more complex issues (messages not received, permission timeouts, high memory, stale PID files), read SKILL_DIR/references/troubleshooting.md for detailed diagnosis steps.
Feishu upgrade note: If the user upgraded from an older version of this skill and Feishu is returning permission errors (e.g. streaming cards not working, typing indicators failing, permission buttons unresponsive), the root cause is almost certainly missing permissions or callbacks in the Feishu backend. Refer the user to the "Upgrading from a previous version" section in SKILL_DIR/references/setup-guides.md — they need to add new scopes (cardkit:card:write, cardkit:card:read, im:message:update, im:message.reactions:read, im:message.reactions:write_only), add the card.action.trigger callback, and re-publish the app. The upgrade requires two publish cycles because adding the callback needs an active WebSocket connection (bridge must be running).
Notes
- Always mask secrets in output (show only last 4 characters) — users often share terminal output in bug reports, so exposed tokens would be a security incident.
- Always check for config.env before starting the daemon — without it the process crashes on startup and leaves a stale PID file that blocks future starts (requiring manual cleanup).
- The daemon runs as a background Node.js process managed by platform supervisor (launchd on macOS, setsid on Linux, WinSW/NSSM on Windows).
- Config persists at
~/.claude-to-im/config.env— survives across sessions.
FAQ
What does the claude-to-im skill do?
Bridge THIS Claude Code or Codex session to Telegram, Discord, Feishu/Lark, QQ, or WeChat so the user can chat with Claude from their phone. Use for: setting up, starting, stopping, or diagnosing the claude-to-im bridge daemon; forwarding Claude replies to a messaging app; any phrase like "claude-to-im", "bridge", "消息推送", "消息转发", "桥接", "连上飞书", "手机上看claude", "启动后台服务", "诊断", "查看日志", "配置". Subcommands: setup, start, stop, status, logs, reconfigure, doctor. Do NOT use for: building standalone bots, webhook integrations, or coding with IM platform SDKs — those are regular programming tasks.
How do I install claude-to-im?
Run npx skills add https://github.com/op7418/claude-to-im-skill --skill claude-to-im in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/claude-to-im/ (personal) or .claude/skills/claude-to-im/ (project).
Which AI agents can use claude-to-im?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is claude-to-im safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk flagged risks; Runlayer flagged risks; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains claude-to-im?
It is published by op7418 in op7418/claude-to-im-skill. It has 7,075 recorded installs.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。