Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
用微信控制 Claude Code。扫码即用,不需要 OpenClaw。
Fork of paceaitian/cc-wechat(MIT)。 本分支计划叠加一组 Hook 脚本,解决"消息无反馈 / reply 参数被污染 / 用量耗尽时无应答"三个体验痛点,详见 dranixj 的文章。Hook 能力会在后续版本落地,当前版本与上游
cc-wechat功能等价。
微信 → 腾讯 iLink API → MCP Server (long-poll) → Claude Code
← sendMessage ← reply tool
底层直接调用腾讯的 iLink Bot API,不依赖 OpenClaw。
npx claude-weixin-channel@latest install
这会:
Claude Code 的 Channels 功能受服务端灰度控制,部分用户需要 patch 才能使用:
npx claude-weixin-channel@latest patch
.patched 文件,按提示手动替换即可npx claude-weixin-channel unpatch也可用独立的零依赖补丁包
claude-weixin-channel-patch(fork 自上游cc-channel-patch),效果等价。
claude --dangerously-skip-permissions --dangerously-load-development-channels server:wechat-channel
⚠️ 必须开启 yolo 模式(
--dangerously-skip-permissions)微信侧不存在"允许/拒绝"的交互界面,若 Claude Code 在工具调用前弹出权限审批,对话就会卡死。 因此远程 IM 场景下必须用 yolo 模式让 Claude 直接执行工具。这也意味着:当前版本对模型生成的 命令没有二次校验,请在可控/非敏感的项目中使用。
后续计划在 hook 层加入安全校验(
PreToolUse拦截rm -rf/curl | sh/ 写入敏感路径等危险模式),在保留 yolo 便利性的同时恢复一道兜底。见 路线图。
npm i -g claude-weixin-channel
claude mcp add -s user wechat-channel -- npx -y claude-weixin-channel@latest
npx claude-weixin-channel login
claude --dangerously-skip-permissions --dangerously-load-development-channels server:wechat-channel
登录后,在微信里发消息,Claude Code 会实时收到并处理。Claude 通过 reply 工具回复,消息会出现在你的微信对话里。
支持发送图片、视频和文件(通过 reply 工具的 media 参数)。
npx claude-weixin-channel login
如果已经在 Claude Code 中,直接用 login 工具扫码。
直接调用腾讯的 iLink Bot API(7 个 HTTP 接口):
| API | 功能 |
|---|---|
| get_bot_qrcode | 获取登录二维码 |
| get_qrcode_status | 轮询扫码状态 |
| getupdates | 长轮询收消息(35s 超时) |
| sendmessage | 发送消息 |
| sendtyping | 打字状态指示 |
| getconfig | 获取 typing ticket |
| getuploadurl | 获取 CDN 上传签名(媒体发送) |
通过 WECHAT_PROFILE 环境变量,不同项目可以绑定不同的微信号:
// 项目 .mcp.json
{
"mcpServers": {
"wechat-channel": {
"command": "npx",
"args": ["-y", "claude-weixin-channel@latest"],
"env": { "WECHAT_PROFILE": "work" }
}
}
}
每个 profile 独立存储凭证和会话:
~/.claude/channels/wechat/
├── default/ # 默认账号(未设 WECHAT_PROFILE 时使用)
│ ├── account.json
│ └── sync-buf.txt
├── work/ # WECHAT_PROFILE=work
│ ├── account.json
│ └── sync-buf.txt
└── personal/ # WECHAT_PROFILE=personal
├── account.json
└── sync-buf.txt
claude.json 的配置作为默认账号,不需要设 WECHAT_PROFILE.mcp.json 中声明同名 wechat-channel 会覆盖全局配置WECHAT_PROFILE=work npx claude-weixin-channel login)~/.claude/channels/wechat/<profile>/
├── account.json # 登录凭证
└── sync-buf.txt # 消息同步游标
在安装步骤之后再跑一次:
npx claude-weixin-channel install-hooks
即可把四个生命周期 hook 合并进 ~/.claude/settings.json(原文件自动备份为 .bak):
| 脚本 | 事件 | 作用 |
|---|---|---|
wechat-ack.sh | UserPromptSubmit | 即时回复 "收到,处理中...";持久化会话状态;支持斜杠命令 |
wechat-progress.sh | PostToolUse | 工具执行进度实时推送到微信 |
wechat-stream.sh | PostChunk | Claude 流式输出实时转发到微信 |
wechat-stop-notify.sh | Stop | 未命中 .replied 时向微信推送"处理中断"通知(用量耗尽等异常) |
在微信对话中发送以下命令控制行为:
/new — 开始新话题(清除上下文链接)/clear — 清空编辑器上下文(截断 transcript)/mode <name> — 切换角色模式(code/review/explain/concise/off)/compact — 精简响应模式/think — 开启深度思考模式/stream on|off — 切换流式转发(默认开启)/progress on|off — 切换工具进度通知(默认关闭)/session-status — 查看当前会话状态/help — 显示帮助信息🛈 关于斜杠命令的控制台告警
斜杠命令由
wechat-ack.sh在UserPromptSubmithook 里拦截并处理(改写 transcript、切换 mode 等), 并不是 Claude Code 原生的 slash command。当你在微信发/mode code、/clear等命令时,Claude Code 控制台可能会打印Unknown command或类似提示 —— 这是预期行为,因为 Claude Code 本身并不认识这些 命令,实际动作由 hook 完成,可以忽略。
原文里第四个脚本
wechat-reply-fix.sh(PreToolUse清洗 XML 污染)已内置到 MCP server 的sanitizeReplyArgs(),无需外部 hook。
卸载:npx claude-weixin-channel uninstall-hooks
更多设计说明与环境变量见 hooks/README.md。
npm run build # 编译 → dist/
npm run dev # 监听模式
npm run typecheck # 仅类型检查
npm run lint # ESLint
npm test # node --test 跑 test/*.test.ts
单元测试当前覆盖 sanitize.ts 和 text-utils.ts 等纯函数模块,使用 Node 自带的 node:test,
无额外运行时依赖。
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: name: Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Plugins from other owners that cover similar ground