Skip to content
Back to search

wechat-claude-code

微信消息桥接 - 在微信中与 Claude Code 聊天。支持文字对话、图片识别、实时进度推送、斜杠命令。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/wechat-gggithub-wechat-claude-code/badge.svg)](/listings/wechat-gggithub-wechat-claude-code)

HTML

<a href="/listings/wechat-gggithub-wechat-claude-code"><img src="/api/listings/wechat-gggithub-wechat-claude-code/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 139 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: wechat-claude-code
  3. description: 微信消息桥接 - 在微信中与 Claude Code 聊天。支持文字对话、图片识别、实时进度推送、斜杠命令。
  4. ---
  5. # WeChat Claude Code Bridge
  6. 通过个人微信与本地 Claude Code 进行对话。
  7. ## 前置条件
  8. - Node.js >= 18
  9. - macOS(daemon 使用 launchd 管理)
  10. - 个人微信账号(需扫码绑定)
  11. - 已安装 Claude Code(`@anthropic-ai/claude-agent-sdk`)
  12. ## 安装
  13. **方式一:通过 skills CLI(推荐)**
  14. ```bash
  15. npx skills add Wechat-ggGitHub/wechat-claude-code
  16. ```
  17. 首次触发时 skill 会自动克隆完整项目源码并安装依赖。
  18. **方式二:手动克隆**
  19. ```bash
  20. git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git ~/.claude/skills/wechat-claude-code
  21. cd ~/.claude/skills/wechat-claude-code && npm install
  22. ```
  23. ## 触发场景
  24. 用户提到"微信桥接"、"微信聊天"、"wechat bridge"、"连接微信"、"微信状态"、"停止微信"等与微信桥接相关的话题时触发。
  25. ## 触发后的执行流程
  26. **被触发时,不要直接执行任何操作,先探查当前状态再给出可用操作。**
  27. 按顺序检查以下状态:
  28. ### 第 1 步:检查项目是否完整安装
  29. ```bash
  30. test -f ~/.claude/skills/wechat-claude-code/package.json && echo "source_ok" || echo "source_missing"
  31. ```
  32. - 如果 `source_missing`:需要从 GitHub 克隆完整项目。执行:
  33. ```bash
  34. git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git /tmp/wechat-claude-code-install && cp -r /tmp/wechat-claude-code-install/{src,scripts,*.ts,*.json,*.md,LICENSE} ~/.claude/skills/wechat-claude-code/ && rm -rf /tmp/wechat-claude-code-install
  35. ```
  36. 然后继续检查依赖。
  37. - 如果 `source_ok`:继续检查依赖。
  38. ```bash
  39. cd ~/.claude/skills/wechat-claude-code && test -d node_modules && echo "deps_ok" || echo "deps_missing"
  40. ```
  41. - 如果 `deps_missing`:执行 `cd ~/.claude/skills/wechat-claude-code && npm install` 安装依赖,然后继续。
  42. - 如果 `deps_ok`:继续下一步。
  43. ### 第 2 步:检查是否已绑定微信账号
  44. ```bash
  45. ls ~/.wechat-claude-code/accounts/*.json 2>/dev/null | head -1
  46. ```
  47. - 如果没有账号文件:提示用户需要先执行 setup 扫码绑定,询问是否现在执行。
  48. - 如果有账号文件:继续下一步。
  49. ### 第 3 步:检查 daemon 运行状态
  50. ```bash
  51. cd ~/.claude/skills/wechat-claude-code && npm run daemon -- status
  52. ```
  53. ### 第 4 步:根据状态展示信息
  54. **如果 daemon 未运行:**
  55. ```
  56. 微信桥接已绑定但未运行。
  57. 可用操作:
  58. setup 重新扫码绑定(换号或过期时使用)
  59. start 启动服务
  60. logs 查看上次运行的日志
  61. ```
  62. **如果 daemon 正在运行:**
  63. ```
  64. 微信桥接正在运行(PID: xxx)。
  65. 可用操作:
  66. stop 停止服务
  67. restart 重启服务(代码更新后使用)
  68. logs 查看运行日志
  69. 微信端命令(直接在微信中发送):
  70. /help 显示帮助
  71. /clear 清除当前会话,开始新对话
  72. /status 查看当前会话状态
  73. /model 切换 Claude 模型
  74. /prompt 设置系统提示词
  75. /cwd 切换工作目录
  76. /skills 查看已安装的 skill
  77. ```
  78. 如果用户明确指定了操作(如"启动微信"、"停止微信服务"、"看看日志"等),跳过状态展示直接执行对应命令。
  79. ## 子命令参考
  80. 所有命令的工作目录为 `~/.claude/skills/wechat-claude-code`。
  81. | 命令 | 执行 | 说明 |
  82. |------|------|------|
  83. | setup | `npm run setup` | 首次安装向导:生成 QR 码 → 微信扫码 → 配置工作目录 |
  84. | start | `npm run daemon -- start` | 启动 launchd 守护进程(开机自启、自动重启) |
  85. | stop | `npm run daemon -- stop` | 停止守护进程 |
  86. | restart | `npm run daemon -- restart` | 重启守护进程 |
  87. | status | `npm run daemon -- status` | 查看运行状态 |
  88. | logs | `npm run daemon -- logs` | 查看最近日志(tail -100) |
  89. ## 数据目录
  90. 所有数据存储在 `~/.wechat-claude-code/`:
  91. ```
  92. ~/.wechat-claude-code/
  93. ├── accounts/ # 绑定的微信账号数据(每个账号一个 JSON)
  94. ├── config.env # 全局配置(工作目录、模型、系统提示词)
  95. ├── sessions/ # 会话数据(每个账号一个 JSON)
  96. ├── get_updates_buf # 消息轮询同步缓冲
  97. └── logs/ # 运行日志(每日轮转,保留 30 天)
  98. ```
README.md · README · 133 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # WeChat Claude Code Bridge
  2. <p align="center">
  3. <strong>Chat with Claude Code in WeChat, just like texting a friend</strong>
  4. </p>
  5. <p align="center">
  6. <a href="https://github.com/Wechat-ggGitHub/wechat-claude-code/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=flat-square" alt="License: MIT"></a>
  7. <a href="https://skills.sh/Wechat-ggGitHub/wechat-claude-code"><img src="https://img.shields.io/badge/skills.sh-view_page-blue?style=flat-square" alt="skills.sh"></a>
  8. <a href="README_en.md"><img src="https://img.shields.io/badge/Lang-English-lightgrey?style=flat-square" alt="English"></a>
  9. </p>
  10. 扫码绑定微信后,你的微信里会多出一个好友。给它发消息,消息会自动转发给你电脑上运行的 Claude Code,回复也会实时推送到微信。支持文字、图片、语音、文件的收发。
  11. <img width="3018" height="1216" alt="ScreenShot_2026-06-10_211251_410" src="https://github.com/user-attachments/assets/2ba4c53b-9c63-4ffd-bd0a-71935a6eabec" />
  12. ## 核心亮点
  13. | | |
  14. |---|---|
  15. | **扫码即用** | 不用注册账号,不用部署服务器。微信扫码绑定,一分钟搞定。数据全在本地,隐私有保障。 |
  16. | **消息不刷屏** | 只推送核心信息——进度、结果、关键决策。工具调用、中间过程等噪音自动过滤,阅读体验清爽。 |
  17. | **"对方正在输入中..."** | Claude 在处理任务时,微信顶部会显示输入状态,随时感知它在干活。 |
  18. | **电脑手机体验一致** | 手机端和电脑端 Claude Code 行为完全相同——同样的编排逻辑、同样的输出效果。不是两个割裂的 AI。 |
  19. | **文件双向收发** | 发图片、Word、PDF 给 Claude 分析;Claude 生成的文件也会直接推送到微信,不用回到电脑前查看。 |
  20. | **超时安抚** | 任务超过 5 分钟没响应?它会自动发一条消息告诉你还在干,不会让你对着空白聊天框干等。 |
  21. ## 快速安装
  22. **方式一:skills CLI(推荐)**
  23. ```bash
  24. npx skills add Wechat-ggGitHub/wechat-claude-code
  25. ```
  26. 首次在对话中触发时,会自动克隆项目源码并安装依赖。
  27. **方式二:手动克隆**
  28. ```bash
  29. git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git ~/.claude/skills/wechat-claude-code
  30. cd ~/.claude/skills/wechat-claude-code && npm install
  31. ```
  32. ## 快速开始
  33. ### 1. 扫码绑定
  34. ```bash
  35. cd ~/.claude/skills/wechat-claude-code
  36. npm run setup
  37. ```
  38. 弹出二维码,用微信扫码。
  39. ### 2. 启动服务
  40. ```bash
  41. npm run daemon -- start
  42. ```
  43. macOS 下自动注册 launchd,开机自启、崩溃自动重启。
  44. ### 3. 开始聊天
  45. 打开微信,给你新出现的那个"好友"发条消息试试。
  46. ### 管理服务
  47. ```bash
  48. npm run daemon -- status # 查看运行状态
  49. npm run daemon -- stop # 停止服务
  50. npm run daemon -- restart # 重启服务(更新代码后使用)
  51. npm run daemon -- logs # 查看日志
  52. ```
  53. ## 微信端命令
  54. 直接在微信聊天中发送即可:
  55. | 命令 | 说明 |
  56. |------|------|
  57. | `/help` | 显示帮助 |
  58. | `/clear` | 清除当前会话,开始新对话 |
  59. | `/stop` | 停止当前任务 |
  60. | `/model <名称>` | 切换 Claude 模型 |
  61. | `/prompt <内容>` | 设置系统提示词(如"用中文回答") |
  62. | `/cwd <路径>` | 切换工作目录 |
  63. | `/skills` | 查看已安装的 Skill |
  64. | `/status` | 查看当前会话状态 |
  65. | `/history [数量]` | 查看最近对话记录 |
  66. | `/compact` | 压缩上下文,开始新 CLI 会话 |
  67. | `/reset` | 完全重置(包括工作目录等设置) |
  68. | `/undo [数量]` | 撤销最近几条对话 |
  69. | `/<skill> [参数]` | 触发任意已安装的 Skill |
  70. ## 工作原理
  71. ```
  72. 微信(手机) ←→ ilink Bot API ←→ Node.js 守护进程 ←→ Claude Code CLI(本地)
  73. ```
  74. 守护进程通过长轮询监听微信消息,转发给本地 `claude` CLI 处理,回复实时流式推送回微信。全程跑在你自己电脑上。
  75. ## 后续计划
  76. - **消息队列优化** — 连续发多条指令时,回复容易串。正在研究更好的队列策略,也欢迎讨论。
  77. - **电脑休眠不中断** — 利用 macOS 的 `caffeinate` 命令阻止系统睡眠,合上盖子也能响应微信消息。
  78. - **接续电脑会话** — 在电脑上聊了很久,出门想接着聊。计划支持从当前电脑端的 Claude Code 会话直接续聊,工作空间和上下文保持一致。
  79. ## 前置条件
  80. - Node.js >= 18
  81. - macOS 或 Linux
  82. - 个人微信账号
  83. - 已安装 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI 并完成认证
  84. > **提示:** Claude Code 支持第三方 API 提供商(OpenRouter、AWS Bedrock 等),设置 `ANTHROPIC_BASE_URL` 和 `ANTHROPIC_API_KEY` 即可。
  85. ## 数据目录
  86. 所有数据存储在 `~/.wechat-claude-code/`:
  87. ```
  88. ~/.wechat-claude-code/
  89. ├── accounts/ # 微信账号凭证
  90. ├── config.json # 全局配置
  91. ├── sessions/ # 会话数据
  92. └── logs/ # 运行日志(每日轮转,保留 30 天)
  93. ```
  94. ## License
  95. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.