weixin-plugin-cc-cx

WeChat bridge for Claude Code and Codex.
cc-cx stands for Claude Code and Codex.
Credits: This project was primarily built by MiMo-Pro and Kimi-2.5, with Opus serving as the quality inspector who shows up at the end, squints at the code, and says "hmm, let me fix that for you." The Codex bridge portion was implemented mainly by Codex itself — which feels only fair, given that asking everyone else to fake being Codex was getting a little awkward. Think of it as two enthusiastic interns writing most of the app, a senior architect reviewing from a comfy chair, and Codex walking in to wire up its own extension cable. The result? A surprisingly functional WeChat bridge that almost none of them can actually use — because most of them still do not have a WeChat account.
Features
- QR code login — scan to login, session saved and auto-restored across restarts
- Long-poll message delivery — real-time WeChat message bridging
- Media support — send/receive images, video, files (up to 50MB)
- Access control — pairing mode (default), allowlist, or disabled
- Auto-chunking — long replies split at WeChat's ~2048 char limit
- Permission relay — approve/deny Claude Code tool permissions from WeChat
- Typing indicator — shows typing status while processing
- Codex backend — optional standalone bridge to
codex app-server
Installation
Standalone Claude Code plugin mode is no longer supported. You must run the daemon from a local clone of this repository first, then connect Claude Code to it.
1. Clone And Start The Daemon
Clone the repository locally:
git clone https://github.com/kkk0913/weixin-plugin-cc-cx.git
cd weixin-plugin-cc-cx
Start the daemon from the cloned repo:
npm run start
Optional environment variables can be set either in your shell or in a project-root .env file. See .env.example.
Optional environment variables:
| Variable | Default | Description |
|---|
WEIXIN_STATE_DIR | ${XDG_STATE_HOME:-~/.local/state}/weixin-plugin-cc-cx | State directory for session, routes, socket, cache, and inbox |
WEIXIN_CLAUDE_CONFIG_DIR | ~/.claude | Claude local config directory used for .credentials.json and stats-cache.json |
WEIXIN_CODEX_CWD | current working directory | Workspace passed to codex -C ... app-server |
WEIXIN_CODEX_MODEL | unset | Override Codex model |
WEIXIN_CODEX_APPROVAL_POLICY | on-request | Codex approval policy |
WEIXIN_CODEX_SANDBOX | workspace-write | Codex sandbox mode |
WEIXIN_CODEX_COMMAND | codex | Codex CLI executable |
WEIXIN_CLAUDE_CONFIG_DIR is only used to read local Claude files such as .credentials.json and stats-cache.json. Claude Code itself still connects through the local proxy/socket managed by the daemon.
Example:
WEIXIN_STATE_DIR=/path/to/state WEIXIN_CLAUDE_CONFIG_DIR=/home/me/.claude-official WEIXIN_CODEX_CWD=/path/to/repo WEIXIN_CODEX_MODEL=gpt-5.4 npm run start
2. Connect Claude Code
Add the marketplace in Claude Code:
/plugin marketplace add kkk0913/weixin-plugin-cc-cx
Install the plugin:
/plugin install weixin@weixin-plugin-cc-cx
Reload plugins.
Start Claude Code with the development channels flag:
claude --dangerously-load-development-channels plugin:weixin@weixin-plugin-cc-cx
The Claude plugin process no longer polls WeChat by itself. It only proxies Claude's MCP channel over a local socket to the daemon started from your local clone.
First Run
Prefer the npm entrypoints for setup and login. The cc skills remain available, but they are secondary.
- Start the daemon with
npm run start
- Check current state with
npm run status
- Trigger login with
npm run login
- If Claude Code needs to reconnect its local proxy, run
/reload-plugins
- The daemon prints a browser login link to stderr — open it in your browser and scan with WeChat within 8 minutes
- Session is saved under
${XDG_STATE_HOME:-~/.local/state}/weixin-plugin-cc-cx/account.json by default, or WEIXIN_STATE_DIR if set
Use npm scripts for setup and login (no skill equivalent):
Useful CLI helpers:
npm run status
npm run relogin
npm run clear
npm test
Useful WeChat commands:
| Message | Effect |
|---|
/stats | Show Claude Code usage, Codex rate limits, and current backend connection status |
/status | Show runtime status for the current chat, including active backend, pending approvals, and auto-approve state |
Session Expiry
When the session expires, the server stops polling and logs the error code. Run:
npm run clear
npm run login