claude-code-sync (OpenClaw gateway plugin)
Turn an OpenClaw channel thread (a Telegram DM/group, etc.) into something you can ride from a
terminal as the single active driver, and relay those terminal turns back into the channel so
the thread sees them live. The gateway-side half of the ride/relay pair — install the
openclaw-session-sync Claude Code plugin on
the terminal side.
All plugin-SDK surface — no OpenClaw core change.
What it does
sessions_rideable— resolves each agent's session store into the channel threads that can be ridden: a thread is rideable if it has a resumable claude session or is relay-ready (a channel thread with an echo target). Returns{channel, displayName, title, conversationId, cliSessionId, echoTarget, relayReady, lastActivity}.- Driver lock —
ride_claim/ride_release/ride_status/ride_check: a file-backed lock so one terminal drives a thread at a time. Auto-expires afterrideTtlMinutes(default 30) so a crashed driver never holds a thread forever. - Relay — while a thread is ridden with
relay, a webchat-originchat.sendturn is echoed into the channel (message_sending → ALLOW (relay echo)) and the channel's own turn is suppressed (reply_payload_sending → CANCEL (ridden)), so the prompt+reply appear in the thread and two drivers never write the session at once.
Install
openclaw plugins install clawhub:<owner>/claude-code-sync
Then enable it in your gateway config (plugins.entries.claude-code-sync).
Config
| Field | Type | Meaning |
|---|---|---|
lockBackend | "file" | "none" | Driver-lock backend (file = local ownership lock). |
lockDir | string | Lock directory (default ~/.openclaw/claude-code-locks). |
rideTtlMinutes | number | Ride-claim TTL in minutes (default 30). |
relayToChannel | boolean | Fan ride turns back to the bound channel (e.g. Telegram). |
enableRemoteControl | boolean | Advisory: reported via ride_config for the paired CC side / deploy unit (this plugin does not itself register an RC unit). |
remoteControlSpawn | "same-dir" | "worktree" | "session" | Advisory RC spawn mode reported via ride_config. |
syncMirrorDir | string | Advisory: where the paired CC plugin mirrors transcripts. |
Requirements
- Loads on OpenClaw 2026.5.31+ (
openclaw.compat/buildinpackage.json). - The relay half additionally needs the gateway-side channel-echo build (
sessions.echo, openclaw #88815), which is not yet upstream. Ride + the driver lock work on any 2026.5.31+ gateway; relay is a no-op until #88815 lands.
See deploy/ for the optional Remote Control systemd unit.