The safest way to automate WeChat may be to avoid touching WeChat's interfaces
Yucheng Liu put WeChat into a Tart virtual machine and let Claude Code take screenshots and click via VNC. It changed remarks for 23 contacts and added tags for 87 people, all executed autonomously. The solution is open source, and the pitfalls are documented clearly.
For WeChat automation, avoiding the interfaces is actually more stable. Yucheng Liu's approach is to give the agent its own macOS virtual machine, log into WeChat inside it, and use VNC from outside to take screenshots, click, and type. The entire desktop becomes the object of operation, no longer limited by how much data wx-cli can read.
The video is sped up—don't be fooled by the apparent hand speed.
The results he reported: the agent changed remarks for 23 contacts and added tags for 87 people inside the virtual machine's WeChat, all executed autonomously. Interface-based approaches like wx-cli can solve part of the problem, but they can only see part of the data and cannot output it, and they can't avoid the risk of account bans. The visual approach simulates system operations, so it can do more.
An earlier attempt was wilder: KVM connected to a Mac mini, simulating the keyboard and mouse at the hardware level; it could click all the way through the lock screen and new-user setup. The main approach ultimately landed on a Tart VM plus VNC, for a very practical reason: the agent needs its own screen and can't compete with a human for the mouse.
Breaking down the approach
Run a Tart virtual machine on the host Mac, with 4 cores and 8GB, install WeChat inside it, and enable Screen Sharing. Outside, a vnc-desktop MCP server uses Python and vncdotool to provide Claude Code with tools for screenshots, clicking, typing, pasting, and scrolling. Humans watch read-only via noVNC. If needed, the same server can also connect to other Macs that have Screen Sharing enabled.
The performance comparison was run on the same VM over 20 tasks involving finding people and reading their profiles. Both direct VNC and noVNC + Ego lite ultimately read correctly 19/20, but when reading profile info 0.8 seconds after clicking, the direct connection got 19 and the browser path got 7. Median duration was 12.8 seconds vs. 15.2 seconds. Median screenshot time was 0.03 seconds vs. 0.29 seconds. So the agent uses the direct connection, while humans watch via read-only noVNC.
The tool surface includes screenshot, click/drag/scroll, key, type_text, paste_text, send_confirmed, and click_confirmed. For sending messages, only send_confirmed can press Enter, and it prompts for confirmation every time. Buttons with external side effects go through click_confirmed.
Guards are built into the tools: if a human has just touched the keyboard or mouse, refuse the operation; for message targets, Enter is forbidden; only one agent is allowed per target; cron can use read-only mode; actions are logged. The documentation also admits one gap: the tools can't distinguish WeChat's own Send button, so don't click Send; the rule to use click_confirmed still has to be written into the prompt.
More pitfalls than features
The accuracy of the visual approach is affected by UI crowding and latency. The Chinese input method swallows spaces, so Chinese text and long text always go through the clipboard. The clipboard must be filled before focusing the input field; writing to the clipboard during editing will make the input field lose focus. An edit is best completed within one VNC connection; a new connection will lose focus.
There are even more specific pitfalls in WeChat. 47 pixels to the right of the Tag button is Delete, so the code has to outright reject clicks in that corner. Search for contacts by ID; don't rely only on OCR, because recognizing names across a whole table of Chinese text is error-prone. Don't click the name in the search results; it will open the chat and mark it as read. The tagging flow is: search by ID, select, Tag, paste the tag name, choose or create, press Esc, then search again and read it back to confirm.
There is only one rule for sending messages: don't press Enter, don't click Send; everything goes through send_confirmed, with human confirmation for each message.
Risks and suitable use cases
The open-source documentation itself includes a warning: automating a personal messaging account may violate the terms and lead to account restrictions. Keep human confirmation, low volume, and no mass messaging. In the comments, someone asked about account bans. Yucheng Liu's judgment is that there should be no need to worry; the visual approach is already the safest path he can think of. This judgment has preconditions—don't use it for mass messaging.
This approach is suitable for boring, local, repetitive work: reading profile cards, changing remarks, adding tags, and fixing typos. It isn't elegant, but it shifts the problem from how to call the interface to how not to click the wrong thing. The former requires reverse engineering and account permissions; the latter requires coordinates, clipboard, and confirmation dialogs. It sounds dumb, and it actually is dumb, but it works.
The complete solution is open-sourced in yskills and can be handed directly to an agent as a prompt:
https://github.com/lycfyi/yskills/blob/main/docs/vnc-agent-desktop.md
Original tweet:
发布时间: 2026-12-01 13:29