Alphainfix/wechat-clawbot

wechat-clawbot

💬 Chat with your DeepSeek Harness agent from WeChat through the official WeChat ClawBot channel: native photo understanding, sending files both ways, reminders, long-term memory, and a "typing..." indicator while the bot is thinking.

Uncategorizedagentbotdeepseek-harness

wechat-clawbot

English | 中文

Chat with the DeepSeek Harness (DSH) agent on your computer from WeChat. Clawbot is a DSH plugin and fully open source. It replies with the AI you use in DSH and does not upload your information. Away from your desk, you can still ask it to look through files, edit documents or run commands, and the results come back to the WeChat chat. It can also plan your days from the system calendar, create events for you, and set alarms that ring on your phone (macOS only).

It uses WeChat's official 微信ClawBot channel: just scan a QR code to log in.

After nearly two months of development and real-world use, wechat-clawbot has become steadily more stable and economical, and the stable release v1.0.0 came out on 10 October 2026.

What it does

  • Put your computer to work from WeChat: "what's the newest PDF in Downloads?", "run this script"
  • Understands photos: send a picture and ask what it is. If the model accepts images, the photo goes to it directly
  • Sends files back: "send me README.md", "make a chart and send it". Images, PDFs, Office files and archives all work
  • "Typing…": while it thinks, works or sends you a file, WeChat shows the bot as typing, just like a person, until the reply arrives
  • Reminders: "remind me at 9 tomorrow to hand in the report", and you get a WeChat message on time
  • Long-term memory: remembers your habits and preferences, so you don't have to repeat them
  • Asks before it acts: anything that needs your approval (e.g. touching files outside its working directory) is asked in WeChat; reply 同意 / 拒绝 (or yes / no)
  • Understands quotes: reply to an older message with WeChat's quote feature and it knows which one you mean
  • Long chats stay quick: when the conversation gets long, it tidies older messages into a summary during a quiet spell after a reply, so your next message never waits for it
  • All-day secretary (macOS only, off until you turn it on): plans your days and creates events from the Mac's calendar, and sets alarms that really ring. It plans by default rules you can rewrite, and you set up any daily routine in chat.

All-day secretary: plan your days and set alarms from WeChat (new; macOS only, off until you turn it on)

  • Sees your whole schedule: reads every account in the Mac Calendar app (iCloud, Google, Exchange, subscribed calendars), notes included. Ask "am I free tomorrow afternoon?" and it checks the calendar before answering.
  • Plans straight into your calendar: tell it "the report is due Thursday and I still have two papers to read". It finds free time, puts the work into a dedicated calendar you name yourself, and replies in a few lines: what happens when, what got moved, where things clash. The calendar is created in iCloud when you have it, so the events show up on your phone too, and it still reminds you on WeChat when it's time.
  • Free hand only in its own calendar: it adds, changes and deletes events in the dedicated calendar by itself. For anything in your other calendars it asks you on WeChat first and waits for a yes, unless you switch off 改别的日历前先问我 in the settings (it still asks first about a change that would notify other attendees).
  • Reminders stay reminders: a plain "remind me to…" becomes a WeChat reminder and stays out of the calendar. Only things that take up time go into the calendar.
  • Alarms that really ring: "wake me at 6:30 tomorrow", "set an alarm for my flight". The bot sets an urgent reminder in its own Reminders list, and when the time comes your iPhone rings like an alarm clock, even if it is silenced or a Focus is on. It doesn't go through WeChat, so it rings even when WeChat won't let the bot message you. See Requirements for the Mac and phone it needs.
  • Routines you set up in chat: for example "every evening at 9, look at tomorrow's calendar and wake me an hour and a half before my first event, none at weekends". The bot creates a daily task and carries it out by your rules, without bothering you when there is nothing to say. To change the rules, just tell it. The Mac has to be awake, with DSH running, at that time: a task it sleeps through runs when it wakes, and alarm times that have passed by then are skipped.
  • Your rules: how it plans and sets alarms is written in the ## 全天候秘书 section of your long-term memory file, memory.md. Edit it however you like: the 打开 memory.md button in the settings opens it.

This feature is macOS only and off by default. To turn it on:

  1. In the DSH web UI, open Plugins → wechat-clawbot → 微信 Bot → 全天候秘书: type a name for the dedicated calendar and switch it on.
  2. On the Mac, click "Allow" for Calendars and for Reminders (if nothing pops up, press 一键授权, one-click authorization; below macOS 26.2 there are no alarms, so only Calendars is asked).
  3. Once, on the iPhone: in Reminders, mark any reminder as urgent by hand and allow the prompt that appears, and check that Find My uses this iPhone as your location. Without this, alarms don't ring.
  4. Press 测试闹钟 (test alarm) and listen for your phone about two minutes later.

The first time, the plugin compiles a small background app, Clawbot-Calendar, on your Mac. This needs the Xcode command line tools (xcode-select --install if you don't have them).

Cost

  • When the author uses gpt-6-luna, one WeChat message costs about $0.005–0.007 on average; at around 7 messages a day that is about $1.4 a month (under ¥10).

Requirements

  • DSH 0.1.7 – 0.2.1 (tested on 0.1.7-rc.2, 0.2.0-rc.2 and 0.2.1-rc.2), Node.js 22+ and pnpm
  • The official 微信ClawBot plugin in the WeChat mobile app (WeChat → Settings → Plugins; the first scan may ask you to update WeChat)
  • A computer that stays on: the bot is online while DSH is running
  • For the all-day secretary (macOS only):
  • Calendar planning: macOS 14 or later and the Xcode command line tools (xcode-select --install if you don't have them)
  • Alarms: the Mac needs macOS 26.2 or later. Any Mac with Apple silicon will do; only four Intel Macs can run macOS 26 (see Apple's list).
  • Phone (for alarms): an iPhone 11 or later, or iPhone SE (2nd or 3rd generation), on iOS 26.2 or later. Reminders has to use iCloud on both the Mac and the iPhone, with the same Apple Account. The alarm rings only on the iPhone that Find My uses as your location; a Mac only shows a notification.

Set up in three steps

0. Got an agent?

Copy the link to this page, or tell any agent wechat-clawbot, and ask it to install it into DSH. Or:

1. Install the plugin

dsh plugin --profile web add wechat-clawbot

Or search for wechat-clawbot under Plugins → Add plugin in the DSH web sidebar. Restart DSH once afterwards.

2. Link your WeChat

npx -y -p wechat-clawbot clawbot login

A QR code appears in the terminal. Scan it with WeChat's "Scan" and confirm.

3. Start chatting

A new contact, 微信ClawBot, shows up in WeChat. Message it. The running DSH picks up the new link automatically and starts a conversation.

Other commands: clawbot status shows who is linked, clawbot logout unlinks (use the same npx -y -p wechat-clawbot prefix).

Settings

Open Plugins → wechat-clawbot → 微信 Bot in the DSH web sidebar. Most changes apply immediately and the WeChat connection stays up (the two switches marked below restart the WeChat listener for a few seconds):

  • Model: pin a provider / model / reasoning effort for the bot. Leave it empty to follow DSH's global default.
  • Who may message the bot: only you (the person who scanned) by default. Add WeChat user ids to let others in.
  • Images: whether photos go straight to the model, and how outgoing images are resized and compressed.
  • 空闲时整理对话 (tidy up while idle): on by default. Off leaves only DSH's own compaction, which runs right before a reply and makes that reply wait.
  • 把工作目录的说明文件交给 bot (workspace instruction files): on by default (DSH's own behaviour: once the bot works in a project, its AGENTS.md / CLAUDE.md is put into the chat, and the whole file again after every edit). Off keeps them out of the WeChat session, which helps when those files are long and change often; the bot can still read them when it needs to.
  • 开放 MCP 桥(Claude / Codex) (MCP bridge): see the integrations below.
  • Codex 会话联动: select a Codex project and conversation, relay a message, or query progress. Off by default; when on, every request carries 5 more tools (about 1k tokens). Changing it restarts the WeChat listener.
  • 全天候秘书 (all-day secretary; macOS only, off by default): type the dedicated calendar's name first, then switch it on. Flipping the switch restarts the WeChat listener (renaming the calendar does not). Switching it on writes the planning and alarm rules into memory.md; switching it off moves them out and keeps a copy, which comes back unchanged next time. 一键授权 (one-click authorization; press it at the Mac) asks for the calendar and reminders permissions that are still missing; 测试闹钟 (test alarm) sets an alarm about two minutes out; 打开 memory.md opens memory.md on the Mac.
  • 日历提醒 (calendar alerts): events the bot adds get an alert 10 minutes before by default. Switch it off or change the minutes.
  • 改别的日历前先问我 (ask before changing other calendars): on by default. Before the bot adds, changes or deletes an event outside its dedicated calendar, it asks you on WeChat; switched off, it just does it (changes that would notify other attendees are still asked first).

A few options (the session id, the working directory, whether to start with DSH) live in the - id: clawbot entry of ~/.dsh/profiles/web/cordis.patch.yml. Changing them restarts the WeChat listener automatically.

Privacy and safety

  • Only you: messages from anyone but the person who scanned the QR code are ignored.
  • Approvals come to you: anything DSH needs you to approve is asked in WeChat, and nothing happens until you answer.
  • Where your messages go: to the model configured for this session in DSH. If you ask the bot to relay a message to Claude Code or Codex, it also sends that message to the selected local coding session.
  • Auto-memory (on by default): short messages that look like lasting facts ("I don't drink coffee") get a second

question to the same model: should this be remembered? To turn it off, add autoMemory: false to the clawbot entry in cordis.patch.yml. It takes effect on the next message.

  • All-day secretary (off by default): when the bot looks at your calendar, the events it reads (notes included) go to the model, and so do the titles and times of what is in its alarm list. Only you can use the calendar and alarms; while anyone else is on the allow list, these tools refuse every request.
  • The WeChat link and the long-term memory are stored on your computer, under ~/.dsh/clawbot/.

FAQ

I sent a message and nothing happened: check that DSH is running, then open Plugins → wechat-clawbot: both components should say "running". If you just upgraded DSH, see the install & troubleshooting guide.

A reminder was late: reminders need the computer and DSH to be running. While the computer sleeps, they wait until it wakes.

An alarm did not ring: on the iPhone, check three things: it runs iOS 26.2 or later; Settings → your name → Find My → My Location is this iPhone; and in Settings → Apps → Reminders, Alarms under "Allow Reminders to Access" is on (if it isn't there yet, mark any reminder urgent by hand once and allow the prompt).

I want the bot on a different model: pin one in the 微信 Bot settings. Then switching models in the web UI no longer affects the bot.

More on installing, upgrading and troubleshooting: wechat-clawbot-INSTALL.md (in Chinese). It is written for an AI agent installing the plugin for you, and it works just as well for people.

Limitations

  • No group chats and no voice messages.
  • One WeChat account per DSH installation.
  • The bot is offline while the computer is off or DSH is not running.
  • The all-day secretary is macOS only, and alarms also need an iPhone (versions under Requirements).

Working with Claude Code (optional)

If you also use Claude Code, the bot can check what a Claude Code session is doing or pass a message to one. A session that is already closed is resumed in the background first. This needs the claude CLI on the same machine.

The plugin also serves a small set of local HTTP routes for an MCP server, so Claude Code can in turn read and drive DSH sessions and send you a WeChat notification. The routes listen on localhost only and require a token. If you don't need them, turn off 开放 MCP 桥(Claude / Codex) in the 微信 Bot settings. Existing Claude MCP clients remain compatible.

Working with Codex (optional)

The integration works in both directions:

  • WeChat → Codex: ask the bot to list Codex projects and conversations, choose one, then relay your message.

DSH gets list_codex_projects, list_codex_sessions, read_codex_session, send_to_codex_session, and read_codex_progress. Projects are grouped by the conversations' working directories. Listings are paginated; use the returned full directory and conversation ID when selecting a target. Ambiguous names return candidates without sending anything.

  • Codex → DSH/WeChat: the bundled clawbot-mcp stdio server exposes the configured DSH WeChat conversation,

DSH session list/read/send tools, a notification tool, and progress publishing/query tools.

Connect Codex to the DSH WeChat session

Build this checkout and register its MCP entry point on the same machine as DSH:

npm ci
npm run build
codex mcp add wechat-clawbot -- node /path/to/wechat-clawbot/lib/mcp-cli.js
node /path/to/wechat-clawbot/lib/mcp-cli.js --check

Replace /path/to/wechat-clawbot with your checkout. For an installed version containing this integration, clawbot-mcp is also a package executable. Reconnect the Codex client after adding the server. DSH must be running with the updated plugin and 开放 MCP 桥(Claude / Codex) enabled. The default origin is http://127.0.0.1:3080; set CLAWBOT_DSH_URL if DSH uses a different port. The token is read from $CLAWBOT_STATE_DIR/mcp-token or $DSH_HOME/clawbot/mcp-token (DSH_HOME defaults to ~/.dsh). Set CLAWBOT_MCP_TOKEN_FILE for another location. Pass these variables with codex mcp add --env KEY=VALUE as needed. Keep the token in its local file, not in command arguments or repository config.

Codex can read clawbot://wechat-session or call dsh_get_wechat_session to see the WeChat session. dsh_notify_wechat({text: "…"}) sends only to the QR-linked owner and records a [Codex 发给用户的] copy in DSH history; it does not start another bot turn. dsh_send_to_session drives a selected DSH conversation without automatically forwarding its replies to WeChat. Use the notification tool when you want a phone update. Both tools are marked as having outside effects, so with Codex's default approval settings it asks you before each call.

Choose the Codex project and conversation from WeChat

The default codexTransport: socket connects to an existing shared App Server using WebSocket over a Unix socket. The default socket is $CODEX_HOME/app-server-control/app-server-control.sock (CODEX_HOME defaults to ~/.codex). Set codexSocket to use a specific shared server's socket. Set codexBinary to select the CLI for standalone mode. These fields belong in the clawbot row of your local DSH cordis.patch.yml; changing them restarts the plugin. codexPeer is the switch in the settings card. It is off by default, and while it is off none of these tools is sent to the model; changing it also restarts the WeChat listener.

The server must be the one executing the selected conversations and support the documented Unix socket WebSocket transport. You can start a local shared service with codex app-server --listen unix:// or --listen unix:///path/to/rpc.sock. An already-running desktop/IDE client must expose or use that shared server for live steering; starting another daemon does not attach it to an unrelated client's running tasks. There is no silent fallback to a separate Codex runner if the shared server is unavailable.

Once connected, say, for example: "List Codex projects", "Show conversations in that project", then "Send 'run the tests' to this conversation". Active turns receive turn/steer with the current turn ID; idle conversations receive turn/start. Both keep the selected conversation's identity and permissions. Delivery is reported immediately; completion must be checked separately. An unloaded conversation requires the original client to be closed and explicit allowResume: true, even in socket mode: another server's live execution cannot be inferred from stored history.

notLoaded only means this server has not loaded the conversation. Use read_codex_session to read its saved history. Reads use summarized pages to avoid pulling large command outputs and tool results. If a response still hits the 8 MiB limit, reduce limit to 1. Reading history does not resume execution and may omit another client's unsaved messages.

A relayed message belongs to the conversation identified by the delivery result's threadId; it is not copied into other conversations open in the app. In a regular local CLI, /app opens the same saved conversation in the desktop app. Live execution on a shared server still requires the clients to connect to that same server. You can also open a known local conversation with codex://threads/; see the desktop deep-link reference and CLI command reference.

For background continuation of stored conversations, explicitly configure codexTransport: stdio. That launches an independent codex app-server --listen stdio:// using your existing Codex login/config. It cannot inspect another client's live execution. A stored, unloaded conversation will only resume after you close its original client and explicitly permit background continuation (allowResume: true). No model, sandbox, or approval policy is overridden. Command/file approval requests and user questions from this independent runner go to WeChat; unsupported permission grants are declined. Shared-server approvals remain with the existing Codex client. stdio mode is experimental: the approval prompts it forwards to WeChat do not yet show full details (exact changes, extra permissions), and they go to whoever is chatting with the bot at the time. Use it only when you are the bot's only allowed sender. The default socket mode is not affected.

Let clawbot report progress

In Codex, ask it to call dsh_report_codex_progress at meaningful milestones and at the end of the task, using the selected conversation's full ID:

{"threadId":"11111111-1111-4111-8111-111111111111","state":"running","summary":"Implementing the parser"}

States are running, waiting, completed, failed, or interrupted. DSH can query read_codex_progress, and MCP clients can query dsh_read_codex_progress. Publishing a report does not send a phone notification; Codex can separately use dsh_notify_wechat when requested. App Server events also populate progress for subscribed conversations. notLoaded means live state is unknown, and a timestamped report is an observation, not a live heartbeat. Progress reports are held in memory (up to 200 conversations) and cleared when the plugin restarts.

The progress HTTP routes are POST /plugins/clawbot/mcp/codex/report and GET /plugins/clawbot/mcp/codex/progress?threadId=…. They use the same bearer token and live mcpBridge switch as the existing session/notification routes. The MCP client accepts loopback origins only and refuses redirects. No login data, conversation snapshots, preferences, project inventories, or local workspace indexes are bundled in the package. Protocol reference: Codex App Server.

Contributors

  • @MistyHuang03: Codex integration (#1)

Development

npm install
npm run build              # compile to lib/
node test/regression.mjs   # offline regression checks: no model calls, no network, no WeChat
npm run test:codex         # synthetic Codex RPC + loopback HTTP + real MCP stdio; no model or WeChat calls

src/ilink/ is the protocol layer ported from Tencent's MIT-licensed @tencent-weixin/openclaw-weixin; the rest is the DSH integration.

License

MIT. The ported iLink client is © Tencent, also under the MIT license; see NOTICE.