HermesClaw: Run Hermes Agent, OpenClaw, and OpenCode on One WeChat Account
Connects Hermes Agent, OpenClaw, and OpenCode to one WeChat account via iLink proxy.
- Author
- AaronWong1999
- Stars
- 696
- Language
- Python
- License
- MIT
- Upstream updated
- 2026-06-15

HermesClaw Reference Guide
Overview
HermesClaw is a lightweight Python proxy that enables running Hermes Agent, OpenClaw, and OpenCode simultaneously on a single WeChat account. It resolves iLink connection conflicts that occur when multiple agents attempt to poll the same WeChat session directly. By acting as a sole iLink poller and routing traffic through local proxy ports, HermesClaw prevents 403 errors and token conflicts, allowing you to switch between agents on the fly.
This guide covers all capabilities, installation procedures, configuration parameters, constraints, and failure modes. It is intended for system administrators and developers who need to run multiple AI agents on one WeChat account for debugging, complementary tasks, or voice-driven Vibe Coding via OpenCode.
When to Use HermesClaw
Use HermesClaw in the following scenarios:
- You want to run multiple AI agents (Hermes Agent, OpenClaw, OpenCode) on the same WeChat account without encountering iLink 403 errors.
- You need to switch between agents using commands like
/hermes,/openclaw,/opencode,/both, or/three. - You want to use OpenCode's Vibe Coding via WeChat voice messages.
- You need to run agents concurrently for debugging or complementary tasks.
Capabilities
HermesClaw provides the following capabilities:
- Runs Hermes Agent, OpenClaw, and OpenCode on one WeChat account.
- Routes traffic via local proxies to prevent iLink 403 errors.
- Supports voice-driven Vibe Coding via OpenCode integration.
- Switches between agents with commands:
/hermes,/openclaw,/opencode,/both,/three. - Forwards raw iLink protocol messages (text, voice transcription, images, video, files) to each gateway.
- Provides a sole iLink poller to avoid token conflicts.
- Includes an auto-detecting installer script.
- Supports non-interactive/automated installation with
-yflag orHERMESCLAW_YES=1environment variable. - Detects installed gateways (OpenClaw, Hermes Agent) and extracts iLink token.
- Patches gateway configurations to use local proxy ports.
- Detects OpenCode CLI and sets up ACP bridge.
- Creates systemd service (Linux) or launchd service (macOS).
- Offers optional patch to disable newline-based message splitting in Hermes Agent.
- Supports
/whoamicommand to show current route and status. - In
/bothand/threemodes, prefixes replies with[Hermes Agent],[OpenClaw],[OpenCode]for attribution. - Handles dead subprocess recovery for OpenCode.
- Supports headless ACP permissions with
OPENCODE_PERMISSION_STRATEGY=allow_always. - Sends and keeps alive WeChat typing indicator for OpenCode mode.
- Re-running
install.shon existing install pulls latest code. - Uninstall procedure restores original configurations and removes service.
Prerequisites
Before installing HermesClaw, ensure the following are in place:
- At least one of: OpenClaw + clawbot (openclaw-weixin) installed and logged into WeChat, OR Hermes Agent + WeChat gateway installed with
hermes gatewayconfigured. python3andpip3installed.systemd(Linux) orlaunchd(macOS) for background service.- For OpenCode: Node.js and npm to install
opencode-aiglobally. - Internet access to download install script and dependencies.
Installation Procedures
Quick Install
- Ensure at least one of OpenClaw+clawbot or Hermes Agent+WeChat gateway is installed and logged into WeChat.
- Run the following command:
curl -fsSL https://raw.githubusercontent.com/AaronWong1999/hermesclaw/main/install.sh | bash - For non-interactive install, use one of:
Or:curl -fsSL https://raw.githubusercontent.com/AaronWong1999/hermesclaw/main/install.sh | HERMESCLAW_YES=1 bashbash install.sh -y - The installer performs the following actions:
- Detects installed gateways.
- Extracts iLink token from gateway account files.
- Patches
openclaw-weixinbaseUrl tohttp://127.0.0.1:19999. - Patches Hermes
WEIXIN_BASE_URLtohttp://127.0.0.1:19998. - Detects OpenCode CLI (optional).
- Installs Python dependencies (
requests,python-dotenv). - Creates OpenClaw media symlink.
- Sets up
hermesclawsystemd service.
- After install, restart your gateways and send
/whoamiin WeChat to verify.
AI-Assisted Install
- On the target machine, run:
curl -fsSL https://raw.githubusercontent.com/AaronWong1999/hermesclaw/main/install.sh | bash - Read
README.mdandinstall.shfrom the installed HermesClaw directory. - Detect whether Hermes Agent, OpenClaw, their WeChat gateways,
python3,pip3, andsystemdare present. At least one gateway must be configured. - Extract the iLink token from the first available gateway account file.
- Patch
openclaw-weixinbaseUrl tohttp://127.0.0.1:19999and HermesWEIXIN_BASE_URLtohttp://127.0.0.1:19998. - Install dependencies and systemd service.
- Detect OpenCode CLI: run
command -v opencodeor check~/.npm-global/bin/opencode. If not found, suggest installing with:npm install -g opencode-ai - Set
OPENCODE_CMDin.envto the detected path (or empty if not found).OPENCODE_MODELdefaults toopencode/minimax-m2.5-free(free, no API key needed). - If Hermes Agent WeChat gateway is detected, offer to patch
weixin.pyto disable newline-based message splitting (recommended). Accept this patch so long replies are sent as single messages. The fix script is atfix_hermes_splitting.sh. - Restart gateways. Verify
/whoamiworks in WeChat.
OpenCode Setup
- Install OpenCode CLI:
npm install -g opencode-ai - Set
OPENCODE_CMDin.env(installer auto-detects it). - Use
/opencodeor/threecommands once OpenCode is installed.
Uninstall (AI-Assisted)
- Stop and disable the
hermesclawsystemd service. - Restore
openclaw-weixinaccount.bakfiles. - Remove
WEIXIN_BASE_URLoverride from~/.hermes/.env(or restore.bak). - Optionally remove
~/hermesclawdirectory.
Uninstall (Manual)
- Stop and disable the service:
sudo systemctl stop hermesclaw sudo systemctl disable hermesclaw sudo rm -f /etc/systemd/system/hermesclaw.service sudo systemctl daemon-reload - Restore OpenClaw configs:
find "$HOME" -maxdepth 5 -name "*.json.bak" -path "*/openclaw-weixin/accounts/*" -exec sh -c 'for f; do cp "$f" "${f%.bak}"; done' sh {} + - Restore Hermes
.env:[ -f "$HOME/.hermes/.env.bak" ] && cp "$HOME/.hermes/.env.bak" "$HOME/.hermes/.env" - Remove HermesClaw directory:
rm -rf "$HOME/hermesclaw"
Configuration Parameters
The following parameters can be set in the .env file or as environment variables:
HERMESCLAW_YES: Environment variable to skip all confirmation prompts during install. Optional, for non-interactive installs.-yflag: Command-line flag forinstall.shto skip all confirmation prompts. Optional, for non-interactive installs.OPENCODE_CMD: Path to the opencode CLI binary, set in.envfile. Optional, enables/opencodeand/threecommands.OPENCODE_MODEL: Model to use for OpenCode; defaults toopencode/minimax-m2.5-free. Optional, defaults to free model.OPENCODE_PERMISSION_STRATEGY: Strategy for handling OpenCode permission prompts; set toallow_alwaysfor headless operation. Optional, defaults toallow_alwaysin installer.
Constraints and Caveats
- HermesClaw is a thin Python proxy (~500 lines); it does not process media, call agent APIs, or touch agent memory.
- Each gateway handles its own media decryption, markdown formatting, and AI interaction natively.
- At least one gateway (OpenClaw+clawbot or Hermes Agent+WeChat gateway) must be installed and logged into WeChat before installing HermesClaw.
- Default route is Hermes.
- In
/bothand/threemodes, proxy replies are prefixed with[Hermes Agent],[OpenClaw],[OpenCode]for attribution. - OpenCode connects via its native ACP subprocess protocol; no proxy port needed.
- HermesClaw forwards raw iLink protocol messages; it does not do AES decryption, CDN downloads, or media re-encoding.
- macOS support uses
launchdinstead ofsystemd;install.shcreates~/Library/LaunchAgents/com.hermesclaw.plist. - macOS ships with bash 3.2 which lacks
mapfile; installer uses portablewhile IFS= read -rloops. - With
set -euo pipefail, barereadcalls can return non-zero on EOF when stdin is a pipe; installer detects non-tty stdin and redirects prompts to/dev/tty, falling back to auto-yes if/dev/ttyunavailable. - Re-running
install.shon an existing install pulls the latest code before continuing. - If opencode binary is not found,
/opencodeand/threeshow a helpful install hint instead of crashing. - OpenCode permission prompts are handled automatically with
OPENCODE_PERMISSION_STRATEGY=allow_alwaysto prevent hanging. - HermesClaw is not affiliated with NousResearch or OpenClaw; it is a community bridge.
Failure Modes
- iLink 403 errors if both gateways try to poll simultaneously without HermesClaw.
- Token conflict causing dropped messages if multiple gateways connect directly to iLink.
- OpenCode subprocess exiting mid-session causing pending prompts to hang; HermesClaw unblocks with error instead of waiting 120s timeout.
- Hermes Agent message splitting (long replies split by paragraphs) if
weixin.pypatch is not applied. - OpenClaw ENOENT on media files if symlink is not created (installer creates it).
- macOS install failure due to missing
mapfilebuiltin (fixed in v0.3.6). curl | bashsilent abort due to barereadcalls withset -euo pipefail(fixed in v0.3.6).BrokenPipeErrorcaught and logged as DEBUG (improved error handling).
Examples
Switching Agents
Send the following commands in WeChat to change routing:
/hermes- Route to Hermes only./openclaw- Route to OpenClaw only./opencode- Route to OpenCode only./both- Route to Hermes and OpenClaw./three- Route to all three agents.
Voice-Driven Vibe Coding
Speak a voice message in WeChat. HermesClaw forwards the transcription to OpenCode for processing, enabling voice-driven Vibe Coding.
Before and After
Without HermesClaw, Hermes and OpenClaw each work individually but cannot run on the same account due to token conflict and 403 errors. With HermesClaw, all three agents work simultaneously on one account, and OpenCode gains WeChat support via the ACP bridge.
Additional Notes
The year 2026 is referenced in the project's version history as a milestone for future development. The command -v opencode command is used by the installer to detect the OpenCode CLI binary during setup.
Sources & References
This page was researched from 2 independent sources, combined and verified for completeness.
- 1.AaronWong1999/hermesclawBlog · primary source
- 2.AaronWong1999/hermesclaw READMEOfficial documentation
The #1 AI Newsletter
The most important ai updates, guides, and fixes — one weekly email.
No spam, unsubscribe anytime. Privacy policy