npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@liyiyong/claude-wechat

v0.1.0

Published

Optional Claude Code Hook relay for a local WeChat bridge

Readme

Claude Code 微信 Hook Bridge

这是一个独立的本地桥接程序,通过 Claude Code Hooks 将权限请求和 AskUserQuestion 转发到微信。微信模式使用 iLink Bot API,不启动第二个 Claude Code,也不复制 Claude 会话。

已实现

  • ccw 原样启动本机的 claude
  • ccw --wechat login 使用二维码登录 iLink Bot;
  • Windows 使用 DPAPI 保护 iLink Bot 凭据;
  • ccw --wechat pair 绑定一个允许操作的微信用户;
  • ccw --wechat status 查看非敏感状态;
  • ccw --wechat logout 清除登录凭据和桥接状态;
  • ccw --wechat 启动 iLink 长轮询、本地 Hook Relay 和当前唯一的 Claude Code 进程;
  • ccw --wechat --mock 使用本地模拟传输验证 Hook 协议;
  • 单一待处理请求可直接在微信回复允许、拒绝或选项序号;
  • 多条并发请求使用短请求码安全区分。

安装

当前发布版本仅支持 Windows,因为 iLink 凭据使用 Windows DPAPI 保存。需要 Node.js 20 或更高版本,并且目标电脑应已单独安装并配置好 Claude Code。

从 npm 全局安装:

npm install -g @liyiyong/claude-wechat

安装后可直接使用:

ccw --wechat login
ccw --wechat pair
ccw --wechat

未发布到 npm 前,也可以从源码仓库构建使用,见下方开发章节。

开发

npm install
npm run typecheck
npm test
npm run build

本地开发运行:

npm run dev -- --help

首次使用

npm run build
node dist/cli.js --wechat login
node dist/cli.js --wechat pair
node dist/cli.js --wechat status
node dist/cli.js --wechat --resume <session-id>

登录时在终端扫描二维码。配对时,使用准备授权的微信账号向 iLink Bot 发送终端显示的消息,例如:

绑定 739241

权限请求默认可以直接回复:

允许
拒绝

AskUserQuestion 默认可以直接回复选项序号或完整选项文本:

1

如果微信中同时存在多条尚未处理的请求,请使用消息中显示的短请求码来消除歧义:

允许 AB12CD
拒绝 AB12CD
AB12CD 1

短请求码只在当前桥接程序运行期间有效。完整 UUID 格式仍可兼容使用,但不再需要复制;歧义、过期、未知或错误的回复会被忽略,并在 Hook 超时后安全拒绝。多问题时使用逗号、分号或 | 分隔答案。

状态和安全

默认状态目录为:

%APPDATA%\ClaudeWechatBridge\
  credentials.dat
  state.json

credentials.dat 使用当前 Windows 用户的 DPAPI 加密。Bot Token、GPT API Key 和完整敏感工具输入不会写入普通日志或发送到微信。Hook Relay 只监听 127.0.0.1,Hook 超时、桥接错误和无效回答均按拒绝处理。

在另一台电脑使用

每台电脑都必须独立执行 ccw --wechat loginccw --wechat pair。不要复制 %APPDATA%\ClaudeWechatBridge\credentials.datstate.json:前者只能由创建它的 Windows 用户账户解密,后者也不应跨机器复用。

当前实现限制为单个活动 bridge。不要让两台电脑同时使用同一个 iLink Bot 运行 ccw --wechat,否则多个长轮询实例可能使微信回复路由到错误的本地 Claude Code 会话。换电脑使用前,先停止旧电脑上的 bridge;如需并发使用,请使用不同的 iLink Bot。

当前边界

  • 单 Bot、单微信用户、单个 Claude Code 进程;
  • 不支持把任意微信文本注入空闲 Claude 会话;
  • 不保证微信和 Claude 原生弹窗同时显示;
  • iLink 的凭据过期、网络断线和当前 Claude Code 版本的 Hook 行为仍需在本机手工验证;
  • 非 Windows 环境没有未经保护的明文凭据回退,DPAPI 凭据存储会明确报错。

许可证

MIT License © 2026 liyiyong。源码仓库:https://github.com/lambda0302/claude-wechat-hook-bridge