@anagnorisis2peripeteia

Claude Code Session Sync & Ride

Adopt Claude Code sessions into OpenClaw, expose channel threads as rideable via the sessions_rideable gateway method, arbitrate one active driver per thread (file-backed lock), and relay ride turns into the bound channel via #88815 channel-echo. Pairs with the openclaw-session-sync Claude Code plugin.

当前版本
v0.3.0
code-plugin社区source-linked

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 lockride_claim / ride_release / ride_status / ride_check: a file-backed lock so one terminal drives a thread at a time. Auto-expires after rideTtlMinutes (default 30) so a crashed driver never holds a thread forever.
  • Relay — while a thread is ridden with relay, a webchat-origin chat.send turn 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

FieldTypeMeaning
lockBackend"file" | "none"Driver-lock backend (file = local ownership lock).
lockDirstringLock directory (default ~/.openclaw/claude-code-locks).
rideTtlMinutesnumberRide-claim TTL in minutes (default 30).
relayToChannelbooleanFan ride turns back to the bound channel (e.g. Telegram).
enableRemoteControlbooleanAdvisory: 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.
syncMirrorDirstringAdvisory: where the paired CC plugin mirrors transcripts.

Requirements

  • Loads on OpenClaw 2026.5.31+ (openclaw.compat/build in package.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.

源码与版本

源码仓库

anagnorisis2peripeteia/openclaw

打开仓库

源码提交

67386f5

查看提交

安装命令

openclaw plugins install clawhub:claude-code-sync

元数据

  • 包名: claude-code-sync
  • 创建时间: 2026/06/20
  • 更新时间: 2026/06/20
  • 执行代码:
  • 源码标签: 67386f5

兼容性

  • 构建于 OpenClaw: 2026.5.31
  • 插件 API 范围: >=2026.5.31
  • 标签: latest
  • 文件数: 7