Back to search
wechat-claude-code
SkillWorks with Claude CodeGitHub
微信消息桥接 - 在微信中与 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
Markdown
[](/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)
- ---
- name: wechat-claude-code
- description: 微信消息桥接 - 在微信中与 Claude Code 聊天。支持文字对话、图片识别、实时进度推送、斜杠命令。
- ---
- # WeChat Claude Code Bridge
- 通过个人微信与本地 Claude Code 进行对话。
- ## 前置条件
- - Node.js >= 18
- - macOS(daemon 使用 launchd 管理)
- - 个人微信账号(需扫码绑定)
- - 已安装 Claude Code(`@anthropic-ai/claude-agent-sdk`)
- ## 安装
- **方式一:通过 skills CLI(推荐)**
- ```bash
- npx skills add Wechat-ggGitHub/wechat-claude-code
- ```
- 首次触发时 skill 会自动克隆完整项目源码并安装依赖。
- **方式二:手动克隆**
- ```bash
- git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git ~/.claude/skills/wechat-claude-code
- cd ~/.claude/skills/wechat-claude-code && npm install
- ```
- ## 触发场景
- 用户提到"微信桥接"、"微信聊天"、"wechat bridge"、"连接微信"、"微信状态"、"停止微信"等与微信桥接相关的话题时触发。
- ## 触发后的执行流程
- **被触发时,不要直接执行任何操作,先探查当前状态再给出可用操作。**
- 按顺序检查以下状态:
- ### 第 1 步:检查项目是否完整安装
- ```bash
- test -f ~/.claude/skills/wechat-claude-code/package.json && echo "source_ok" || echo "source_missing"
- ```
- - 如果 `source_missing`:需要从 GitHub 克隆完整项目。执行:
- ```bash
- 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
- ```
- 然后继续检查依赖。
- - 如果 `source_ok`:继续检查依赖。
- ```bash
- cd ~/.claude/skills/wechat-claude-code && test -d node_modules && echo "deps_ok" || echo "deps_missing"
- ```
- - 如果 `deps_missing`:执行 `cd ~/.claude/skills/wechat-claude-code && npm install` 安装依赖,然后继续。
- - 如果 `deps_ok`:继续下一步。
- ### 第 2 步:检查是否已绑定微信账号
- ```bash
- ls ~/.wechat-claude-code/accounts/*.json 2>/dev/null | head -1
- ```
- - 如果没有账号文件:提示用户需要先执行 setup 扫码绑定,询问是否现在执行。
- - 如果有账号文件:继续下一步。
- ### 第 3 步:检查 daemon 运行状态
- ```bash
- cd ~/.claude/skills/wechat-claude-code && npm run daemon -- status
- ```
- ### 第 4 步:根据状态展示信息
- **如果 daemon 未运行:**
- ```
- 微信桥接已绑定但未运行。
- 可用操作:
- setup 重新扫码绑定(换号或过期时使用)
- start 启动服务
- logs 查看上次运行的日志
- ```
- **如果 daemon 正在运行:**
- ```
- 微信桥接正在运行(PID: xxx)。
- 可用操作:
- stop 停止服务
- restart 重启服务(代码更新后使用)
- logs 查看运行日志
- 微信端命令(直接在微信中发送):
- /help 显示帮助
- /clear 清除当前会话,开始新对话
- /status 查看当前会话状态
- /model 切换 Claude 模型
- /prompt 设置系统提示词
- /cwd 切换工作目录
- /skills 查看已安装的 skill
- ```
- 如果用户明确指定了操作(如"启动微信"、"停止微信服务"、"看看日志"等),跳过状态展示直接执行对应命令。
- ## 子命令参考
- 所有命令的工作目录为 `~/.claude/skills/wechat-claude-code`。
- | 命令 | 执行 | 说明 |
- |------|------|------|
- | setup | `npm run setup` | 首次安装向导:生成 QR 码 → 微信扫码 → 配置工作目录 |
- | start | `npm run daemon -- start` | 启动 launchd 守护进程(开机自启、自动重启) |
- | stop | `npm run daemon -- stop` | 停止守护进程 |
- | restart | `npm run daemon -- restart` | 重启守护进程 |
- | status | `npm run daemon -- status` | 查看运行状态 |
- | logs | `npm run daemon -- logs` | 查看最近日志(tail -100) |
- ## 数据目录
- 所有数据存储在 `~/.wechat-claude-code/`:
- ```
- ~/.wechat-claude-code/
- ├── accounts/ # 绑定的微信账号数据(每个账号一个 JSON)
- ├── config.env # 全局配置(工作目录、模型、系统提示词)
- ├── sessions/ # 会话数据(每个账号一个 JSON)
- ├── get_updates_buf # 消息轮询同步缓冲
- └── logs/ # 运行日志(每日轮转,保留 30 天)
- ```
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)
- # WeChat Claude Code Bridge
- <p align="center">
- <strong>Chat with Claude Code in WeChat, just like texting a friend</strong>
- </p>
- <p align="center">
- <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>
- <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>
- <a href="README_en.md"><img src="https://img.shields.io/badge/Lang-English-lightgrey?style=flat-square" alt="English"></a>
- </p>
- 扫码绑定微信后,你的微信里会多出一个好友。给它发消息,消息会自动转发给你电脑上运行的 Claude Code,回复也会实时推送到微信。支持文字、图片、语音、文件的收发。
- <img width="3018" height="1216" alt="ScreenShot_2026-06-10_211251_410" src="https://github.com/user-attachments/assets/2ba4c53b-9c63-4ffd-bd0a-71935a6eabec" />
- ## 核心亮点
- | | |
- |---|---|
- | **扫码即用** | 不用注册账号,不用部署服务器。微信扫码绑定,一分钟搞定。数据全在本地,隐私有保障。 |
- | **消息不刷屏** | 只推送核心信息——进度、结果、关键决策。工具调用、中间过程等噪音自动过滤,阅读体验清爽。 |
- | **"对方正在输入中..."** | Claude 在处理任务时,微信顶部会显示输入状态,随时感知它在干活。 |
- | **电脑手机体验一致** | 手机端和电脑端 Claude Code 行为完全相同——同样的编排逻辑、同样的输出效果。不是两个割裂的 AI。 |
- | **文件双向收发** | 发图片、Word、PDF 给 Claude 分析;Claude 生成的文件也会直接推送到微信,不用回到电脑前查看。 |
- | **超时安抚** | 任务超过 5 分钟没响应?它会自动发一条消息告诉你还在干,不会让你对着空白聊天框干等。 |
- ## 快速安装
- **方式一:skills CLI(推荐)**
- ```bash
- npx skills add Wechat-ggGitHub/wechat-claude-code
- ```
- 首次在对话中触发时,会自动克隆项目源码并安装依赖。
- **方式二:手动克隆**
- ```bash
- git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git ~/.claude/skills/wechat-claude-code
- cd ~/.claude/skills/wechat-claude-code && npm install
- ```
- ## 快速开始
- ### 1. 扫码绑定
- ```bash
- cd ~/.claude/skills/wechat-claude-code
- npm run setup
- ```
- 弹出二维码,用微信扫码。
- ### 2. 启动服务
- ```bash
- npm run daemon -- start
- ```
- macOS 下自动注册 launchd,开机自启、崩溃自动重启。
- ### 3. 开始聊天
- 打开微信,给你新出现的那个"好友"发条消息试试。
- ### 管理服务
- ```bash
- npm run daemon -- status # 查看运行状态
- npm run daemon -- stop # 停止服务
- npm run daemon -- restart # 重启服务(更新代码后使用)
- npm run daemon -- logs # 查看日志
- ```
- ## 微信端命令
- 直接在微信聊天中发送即可:
- | 命令 | 说明 |
- |------|------|
- | `/help` | 显示帮助 |
- | `/clear` | 清除当前会话,开始新对话 |
- | `/stop` | 停止当前任务 |
- | `/model <名称>` | 切换 Claude 模型 |
- | `/prompt <内容>` | 设置系统提示词(如"用中文回答") |
- | `/cwd <路径>` | 切换工作目录 |
- | `/skills` | 查看已安装的 Skill |
- | `/status` | 查看当前会话状态 |
- | `/history [数量]` | 查看最近对话记录 |
- | `/compact` | 压缩上下文,开始新 CLI 会话 |
- | `/reset` | 完全重置(包括工作目录等设置) |
- | `/undo [数量]` | 撤销最近几条对话 |
- | `/<skill> [参数]` | 触发任意已安装的 Skill |
- ## 工作原理
- ```
- 微信(手机) ←→ ilink Bot API ←→ Node.js 守护进程 ←→ Claude Code CLI(本地)
- ```
- 守护进程通过长轮询监听微信消息,转发给本地 `claude` CLI 处理,回复实时流式推送回微信。全程跑在你自己电脑上。
- ## 后续计划
- - **消息队列优化** — 连续发多条指令时,回复容易串。正在研究更好的队列策略,也欢迎讨论。
- - **电脑休眠不中断** — 利用 macOS 的 `caffeinate` 命令阻止系统睡眠,合上盖子也能响应微信消息。
- - **接续电脑会话** — 在电脑上聊了很久,出门想接着聊。计划支持从当前电脑端的 Claude Code 会话直接续聊,工作空间和上下文保持一致。
- ## 前置条件
- - Node.js >= 18
- - macOS 或 Linux
- - 个人微信账号
- - 已安装 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI 并完成认证
- > **提示:** Claude Code 支持第三方 API 提供商(OpenRouter、AWS Bedrock 等),设置 `ANTHROPIC_BASE_URL` 和 `ANTHROPIC_API_KEY` 即可。
- ## 数据目录
- 所有数据存储在 `~/.wechat-claude-code/`:
- ```
- ~/.wechat-claude-code/
- ├── accounts/ # 微信账号凭证
- ├── config.json # 全局配置
- ├── sessions/ # 会话数据
- └── logs/ # 运行日志(每日轮转,保留 30 天)
- ```
- ## License
- [MIT](LICENSE)
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.