Clawdbot Sync 🔄
Synchronize memory, preferences, and skills between multiple Clawdbot instances over Tailscale/SSH.
Features
- - Bi-directional sync between Clawdbot instances
- Smart conflict resolution (newest wins, or merge for logs)
- Selective sync — choose what to sync
- Peer discovery via Tailscale
- Dry-run mode for preview
Commands
| Command | Action |
|---|
| INLINECODE0 | Show status and configured peers |
| INLINECODE1 |
Check connection to all peers |
|
/sync now [peer] | Sync with peer (or all) |
|
/sync push [peer] | Push local changes to peer |
|
/sync pull [peer] | Pull changes from peer |
|
/sync add <name> <host> [user] [path] | Add a peer |
|
/sync remove <name> | Remove a peer |
|
/sync diff [peer] | Show what would change |
|
/sync history | Show sync history |
Setup
1. Configure Peers
CODEBLOCK0
2. Ensure SSH Access
Both machines need SSH key auth:
CODEBLOCK1
3. Test Connection
CODEBLOCK2
What Gets Synced
| Item | Default | Notes |
|---|
| INLINECODE9 | ✅ Yes | All memory files and skill data |
| INLINECODE10 |
✅ Yes | Main memory file |
|
USER.md | ✅ Yes | User profile |
|
IDENTITY.md | ❌ No | Each instance has its own identity |
|
skills/ | ⚙️ Optional | Installed skills |
|
config/ | ❌ No | Instance-specific config |
Handler Commands
CODEBLOCK3
Conflict Resolution
- 1. Timestamp-based: Newer file wins
- Merge for logs: Append-only files are merged
- Skip conflicts: Option to skip conflicting files
- Manual resolution: Flag for review
Data Files
Stored in $WORKSPACE/memory/clawdbot-sync/:
| File | Purpose |
|---|
| INLINECODE16 | Configured peers |
| INLINECODE17 |
Sync history log |
|
config.json | Sync preferences |
|
conflicts/ | Conflicting files for review |
Example Session
CODEBLOCK4
Requirements
- -
rsync (for efficient file sync) - INLINECODE21 (for secure transport)
- Tailscale or direct network access between peers
- SSH key authentication configured
Security
- - Uses SSH for all transfers (encrypted)
- No passwords stored (key-based auth only)
- Sync paths are restricted to workspace
- No system files are ever synced
Clawdbot 同步 🔄
在多个 Clawdbot 实例之间通过 Tailscale/SSH 同步记忆、偏好设置和技能。
功能特性
- - 双向同步 在 Clawdbot 实例之间
- 智能冲突解决(以最新为准,日志则合并)
- 选择性同步 — 选择要同步的内容
- 对等发现 通过 Tailscale
- 试运行模式 用于预览
命令
| 命令 | 操作 |
|---|
| /sync | 显示状态和已配置的对等节点 |
| /sync status |
检查与所有对等节点的连接 |
| /sync now [peer] | 与对等节点同步(或全部) |
| /sync push [peer] | 将本地更改推送到对等节点 |
| /sync pull [peer] | 从对等节点拉取更改 |
| /sync add <名称> <主机> [用户] [路径] | 添加对等节点 |
| /sync remove <名称> | 移除对等节点 |
| /sync diff [peer] | 显示将要更改的内容 |
| /sync history | 显示同步历史 |
设置
1. 配置对等节点
bash
handler.sh add mac-mini 100.95.193.55 clawdbot /Users/clawdbot/clawd $WORKSPACE
handler.sh add server 100.89.48.26 clawdbot /home/clawdbot/clawd $WORKSPACE
2. 确保 SSH 访问
两台机器都需要 SSH 密钥认证:
bash
ssh-copy-id clawdbot@100.95.193.55
3. 测试连接
bash
handler.sh status $WORKSPACE
同步内容
| 项目 | 默认 | 说明 |
|---|
| memory/ | ✅ 是 | 所有记忆文件和技能数据 |
| MEMORY.md |
✅ 是 | 主记忆文件 |
| USER.md | ✅ 是 | 用户配置文件 |
| IDENTITY.md | ❌ 否 | 每个实例拥有自己的身份 |
| skills/ | ⚙️ 可选 | 已安装的技能 |
| config/ | ❌ 否 | 实例特定配置 |
处理程序命令
bash
handler.sh status $WORKSPACE # 检查对等节点和连接
handler.sh sync $WORKSPACE # 双向同步
handler.sh push $WORKSPACE # 推送到对等节点
handler.sh pull $WORKSPACE # 从对等节点拉取
handler.sh diff $WORKSPACE # 显示差异
handler.sh add <名称> <主机> <用户> <路径> $WS # 添加对等节点
handler.sh remove <名称> $WORKSPACE # 移除对等节点
handler.sh history $WORKSPACE # 同步历史
handler.sh auto $WORKSPACE # 心跳时自动同步
冲突解决
- 1. 基于时间戳:以较新的文件为准
- 日志合并:仅追加的文件会被合并
- 跳过冲突:可选择跳过冲突文件
- 手动解决:标记以供审查
数据文件
存储在 $WORKSPACE/memory/clawdbot-sync/ 中:
| 文件 | 用途 |
|---|
| peers.json | 已配置的对等节点 |
| history.json |
同步历史日志 |
| config.json | 同步偏好设置 |
| conflicts/ | 待审查的冲突文件 |
示例会话
用户:/sync now mac-mini
机器人:🔄 正在与 mac-mini (100.95.193.55) 同步...
📤 推送:3 个文件已更改
• memory/streaming-buddy/preferences.json
• memory/2026-01-26.md
• MEMORY.md
📥 拉取:1 个文件已更改
• memory/2026-01-25.md
✅ 同步完成!已同步 4 个文件。
要求
- - rsync(用于高效文件同步)
- ssh(用于安全传输)
- 对等节点之间的 Tailscale 或直接网络访问
- 已配置 SSH 密钥认证
安全性
- - 所有传输均使用 SSH(加密)
- 不存储密码(仅基于密钥认证)
- 同步路径限制在工作空间内
- 绝不同步系统文件