/install agent-config-sync
Agent Config Sync (v1.2)
Keep configuration consistent across multiple OpenClaw agents using version tracking, CHANGELOG-based change detection, and automatic sync dispatch with journal-backed two-phase commit.
New in v1.2: Scripts now read agent list from
agent-registry.json(single source of truth). Bilingual output (--lang en|zh).--dry-runand--demomodes. See Upgrading for v1.1 → v1.2 migration.Security: This skill writes to agent workspaces across your OpenClaw deployment. Read the full SECURITY.md for permission scope, path validation, cross-agent isolation, and user consent flow. Key highlights:
- All scripts require
--confirmfor write operations (use--dry-runto preview first)- Only paths under
~/.openclaw/workspace-*are allowed (path validation enforced)- Each agent can only read/write its own workspace files
- No network access, no external API calls, no credential access
⚙️ Customization Variables
Edit references/agent-registry.json — this is the only file you need to change for your deployment:
| Variable | Location | Example | Description |
|---|---|---|---|
workspace_root |
vars in registry |
~/.openclaw |
Base path for all agent workspaces |
master_agent |
vars in registry |
amaster |
ID of your coordination/master agent |
master_memory |
vars in registry |
${workspace_root}/workspace-amaster/memory |
Path to master's memory directory |
| (each agent) | agents in registry |
See below | Add/remove/rename agents to match your setup |
Example — after customization for user "Alice" with agents alice-dev, alice-biz, alice-ops:
{
"vars": {
"workspace_root": "~/.openclaw",
"master_agent": "alice-ops",
"master_memory": "${vars.workspace_root}/workspace-${vars.master_agent}/memory"
},
"agents": {
"alice-dev": { "name": "Alice Dev", "role": "Development",
"workspace": "${vars.workspace_root}/workspace-alice-dev" },
"alice-biz": { "name": "Alice Biz", "role": "Business",
"workspace": "${vars.workspace_root}/workspace-alice-biz" },
"alice-ops": { "name": "Alice Ops", "role": "Coordination",
"workspace": "${vars.workspace_root}/workspace-alice-ops" }
}
}
Scripts resolve ${vars.xxx} placeholders at runtime — no hardcoded paths.
Overview
Architecture
┌─ Version Tracking ──────────────────────┐
│ .current_system_version (monotonic) │
│ .last_sync_version (last synced) │
│ CHANGELOG.md (structured) │
│ .sync_journal.jsonl (atomicity) │
└──────────────────────────────────────────┘
│ version mismatch detected by HEARTBEAT
▼
┌─ Sync Journal (two-phase commit) ────────┐
│ PREPARE → journal entry written │
│ DISPATCH → sessions_send / pending_sync │
│ COMMIT → mark done or retry later │
└──────────────────────────────────────────┘
│ each agent processes independently
▼
┌─ Agent Side ────────────────────────────┐
│ BOOTSTRAP.md → ls pending_sync_*.md │
│ HEARTBEAT.md → check + verify SHA256 │
│ SYNC.md → manual sync instructions │
└──────────────────────────────────────────┘
What it syncs
| Type | Examples |
|---|---|
| 🖥️ System code | Quant system, price compare, data pipelines |
| 🤖 Agent config | SOUL.md, AGENTS.md, IDENTITY.md, USER.md, TOOLS.md |
| ⚙️ OpenClaw config | Models, skills, service addresses, plugins |
| 🎯 Task config | API keys, cron jobs, data sources, ports |
Installation
Prerequisites
- OpenClaw with 2+ agents
- One designated "master" coordination agent
clawhubCLI installed
Step 1: Install the Skill
clawhub install agent-config-sync
Step 2: Customize Agent Registry
Edit ~/.openclaw/skills/agent-config-sync/references/agent-registry.json:
- Change
vars.master_agentto your coordination agent's ID - Replace the
agentsentries with your own agents - Adjust
vars.workspace_rootif your OpenClaw workspace is not~/.openclaw
See the Customization Variables table above, or the English quickstart at references/quickstart.md.
Step 3: Initialize Sync Infrastructure
cd ~/.openclaw/skills/agent-config-sync
# Preview what will be created (safe, no changes required)
bash scripts/init_sync.sh --dry-run
# Run the real setup (--confirm required for write operations)
bash scripts/init_sync.sh --confirm
⚠️ Safety:
--confirmis required for any write operation. Without it, the script exits with a prompt explaining how to preview with--dry-runfirst.--dry-runmode does not need--confirm.
This creates:
- Version sentinel files (
.current_system_version,.last_sync_version) in master'smemory/ CHANGELOG.mdwith structured format.sync_journal.jsonlfor sync atomicitySYNC.md, bootstrappedBOOTSTRAP.md, andHEARTBEAT.mdsync checks in each agent workspace
Step 4: Add HEARTBEAT Item to Master Agent
Copy the HEARTBEAT item from references/sync-setup.md into your master agent's HEARTBEAT.md. This is item 12 — the heartbeat check that detects version mismatches and dispatches syncs.
Step 5: Verify Setup
# Check version files
cat ~/.openclaw/workspace-\x3Cmaster>/memory/.current_system_version # should be v1.0
# Check agent sync files
ls ~/.openclaw/workspace-*/SYNC.md
Configuration
Agent Registry (references/agent-registry.json)
The single source of truth. Fields:
| Field | Description |
|---|---|
vars.workspace_root |
Root directory for all agent workspaces |
vars.master_agent |
ID of the coordination agent (sends syncs) |
vars.master_memory |
Path to master's memory directory (uses placeholders) |
agents.\x3Cid>.name |
Display name (English) |
agents.\x3Cid>.name_zh |
Display name (Chinese) — optional |
agents.\x3Cid>.role |
Short role description |
agents.\x3Cid>.workspace |
Path to agent workspace (uses ${vars.workspace_root}) |
sync.* |
Sync behavior config (sentinel filenames, prefix, limits) |
CHANGELOG Format
All version entries must follow the structured format defined in references/sync-setup.md:
## vX.Y (YYYY-MM-DD)
**Change Type**: \x3Ccategory>
**Affected Agents**: \x3Cwhich agents>
**Author**: \x3Cwho made the change>
**Priority**: normal | high | critical
### Added / Changed / Deprecated
- \x3Cdescription>
Language
Scripts support --lang en and --lang zh (default). Use --lang en for English output:
bash scripts/init_sync.sh --lang en
bash scripts/force_sync.sh --lang en ~/memory v1.0 v1.1
Usage Scenarios
Scenario A: Adding a new model to all agents
Situation: You want all agents to switch to a new default model.
-
Update
CHANGELOG.mdin master's memory directory:## v3.2 (2026-05-16) **Change Type**: ⚙️ OpenClaw Config **Affected Agents**: all **Author**: AMaster **Priority**: high ### Changed - Default model switched to deepseek-v4-pro for all agents - Fallback model set to deepseek-v3 -
Bump the version:
echo "v3.2" > memory/.current_system_version -
Next HEARTBEAT (every 5 min): version mismatch detected → dispatches to all agents. Agents update their model configs accordingly.
-
Agents delete their
pending_sync_v3.2_\x3Csha>.mdafter applying.
Scenario B: Coordinated code deployment
Situation: You fix a bug in shared code used by multiple agents.
-
Fix the bug, tell the master agent to record the change.
-
Master updates
CHANGELOG.mdwith the version entry, bumps.current_system_version. -
HEARTBEAT dispatches. Online agents receive via
sessions_send; offline agents getpending_syncfiles. -
All agents verify version before running the shared system.
Daily Operations
Recording a Change
Whenever a config or system change affects multiple agents:
- Edit
CHANGELOG.mdin master'smemory/directory — add a new## vX.Ysection - Bump the version —
echo "vX.Y" > memory/.current_system_version - The change is dispatched automatically on the next master heartbeat
Force-Syncing Immediately
cd ~/.openclaw/skills/agent-config-sync
# Preview the version change
bash scripts/force_sync.sh --dry-run ~/.openclaw/workspace-\x3Cmaster>/memory v3.0 v3.1
# Execute (--confirm required for write operations)
bash scripts/force_sync.sh --confirm ~/.openclaw/workspace-\x3Cmaster>/memory v3.0 v3.1
After running, the next heartbeat detects current (v3.1) != last_sync (v3.0) and dispatches.
Checking Sync Status
# Check version sentinel files
cat ~/.openclaw/workspace-\x3Cmaster>/memory/.current_system_version
cat ~/.openclaw/workspace-\x3Cmaster>/memory/.last_sync_version
# Check journal for recent sync records
tail -5 ~/.openclaw/workspace-\x3Cmaster>/memory/.sync_journal.jsonl
# Check for pending syncs on an agent
ls ~/.openclaw/workspace-\x3Cagent>/pending_sync_*.md
Demo Mode (Learning)
cd ~/.openclaw/skills/agent-config-sync
bash scripts/init_sync.sh --demo --lang en
Creates a complete demo deployment in /tmp/ showing the full file structure without touching real workspaces.
Manual Sync Trigger
bash skills/agent-config-sync/scripts/force_sync.sh \
~/.openclaw/workspace-amaster/memory v3.0 v3.1
This creates a version mismatch (old=3.0, new=3.1) — next heartbeat dispatches.
Troubleshooting
Agents Not Receiving Updates
| Symptom | Likely Cause | Fix |
|---|---|---|
| No dispatch on heartbeat | HEARTBEAT item 12 not added to master | Follow references/sync-setup.md exactly; verify grep agent-config-sync in master's HEARTBEAT.md |
| Dispatched but not processed | Agent missing BOOTSTRAP sync check | Re-run init_sync.sh for that agent's workspace |
pending_sync files piling up |
Agent never deletes after processing | Check agent's HEARTBEAT.md has sync check with delete step |
| Same version synced repeatedly | .last_sync_version not updated |
Run force_sync.sh to reset, or check journal for stale records |
Version Conflicts
| Symptom | Likely Cause | Fix |
|---|---|---|
| Wrong version on agent | Partial sync interrupted | Check journal for status=prepared records; master re-dispatches on next heartbeat |
Multiple pending_sync files |
Back-to-back changes | Process latest version first; all files are cumulative |
| SHA256 verification fails | File tampered or truncated | Request master to re-dispatch that version |
| "Backup failed" in force_sync | Memory dir permission issue | chmod 755 memory/ and retry |
Journal Issues
| Symptom | Likely Cause | Fix |
|---|---|---|
| Stale prepared records (>24h) | Agent was offline too long | Mark as abandoned in journal, re-trigger sync with force_sync.sh |
| Journal growing too large | Many sync records | Archive old committed entries periodically |
| Corrupt journal line | Partial write or disk issue | Delete the last line (corrupt), re-trigger sync |
Rolling Back a Change
To undo a sync that was dispatched but shouldn't have been:
- Revert the version:
echo "v3.0" > memory/.current_system_version(back to previous) - Revert the last_sync:
echo "v3.0" > memory/.last_sync_version - Mark the journal record: Edit
.sync_journal.jsonl, find the record with"to":"v3.1"and changestatusto"reverted" - Notify agents: Agents check
pending_syncfiles on heartbeat — delete old ones - Verify:
ls ~/.openclaw/workspace-*/pending_sync_*.mdshould be empty
Alternatively, use force_sync.sh in "reverse":
bash scripts/force_sync.sh memory/ v3.0 v3.1 # created mismatch forward
bash scripts/force_sync.sh memory/ v3.1 v3.0 # reverse: current=v3.0, last=v3.1 → no dispatch (current \x3C last)
⚠️
force_sync.shonly creates the version mismatch — actual rollback requires reverting the changes in CHANGELOG and agent configs manually.
🌐 Internationalization
This skill supports both Chinese and English environments:
| Resource | Chinese | English |
|---|---|---|
SKILL.md (this file) |
— | ✅ Full English |
references/quickstart.md |
— | ✅ English quickstart for new users |
references/sync-setup.md |
✅ Full Chinese | — (code pseudocode is language-agnostic) |
references/sync-journal.md |
✅ Full Chinese | — (JSONL format is language-agnostic) |
scripts/init_sync.sh |
--lang zh (default) |
--lang en |
scripts/force_sync.sh |
--lang zh (default) |
--lang en |
| Registry agent names | name_zh field |
name field |
| Generated SYNC.md | Chinese template | English template (via --lang en) |
| Generated CHANGELOG.md | Chinese template | English template (via --lang en) |
Using English:
# Install and initialize in English
bash scripts/init_sync.sh --lang en
# Demo in English
bash scripts/init_sync.sh --lang en --demo
New English-speaking users should start with references/quickstart.md.
Upgrading
From v1.0 to v1.1
agent-registry.jsonintroduced (previously agent list was hardcoded)pending_syncfiles now use version-named format (pending_sync_v3.1_a1b2c3.md) instead of singlepending_sync.md- Journal-based two-phase commit added
- No breaking changes — existing sentinel files and CHANGELOG format unchanged
From v1.1 to v1.2
- Registry is now single source of truth: scripts read agent list from
agent-registry.jsoninstead of command-line args - Bilingual scripts:
--lang en|zhflag on bothinit_sync.shandforce_sync.sh - New flags:
--dry-run(preview),--demo(learning mode),--help - English quickstart:
references/quickstart.mdadded agent-registry.jsonformat changed: addedvarssection with placeholders
Migration steps (v1.1 → v1.2)
-
Update
agent-registry.json:// Add this at the top of your existing agent-registry.json: "vars": { "workspace_root": "~/.openclaw", "master_agent": "amaster", "master_memory": "${vars.workspace_root}/workspace-${vars.master_agent}/memory" }, // Update workspace paths to use placeholders: "agents": { "acode": { "workspace": "${vars.workspace_root}/workspace-acode" // \x3C-- use placeholder } } -
Verify with dry-run:
bash scripts/init_sync.sh --dry-run -
Re-run init:
bash scripts/init_sync.sh(safe — skips existing files)
Compatibility notes
- Existing
CHANGELOG.md, sentinel files, and.sync_journal.jsonlare fully compatible - Agent-side
pending_sync_*.md/SYNC.md/BOOTSTRAP.mdformat unchanged force_sync.shpositional args unchanged; new flags are additive
Files
| File | Purpose |
|---|---|
SKILL.md |
This skill definition |
SECURITY.md |
Security model, permissions, and user consent flow |
references/quickstart.md |
🆕 English quickstart for new users |
references/sync-setup.md |
HEARTBEAT item 12 + structured CHANGELOG spec |
references/pending-sync-template.md |
pending_sync file template (version-named) |
references/sync-journal.md |
Journal-based two-phase commit mechanism |
references/agent-registry.json |
Single source of truth for agent IDs and workspaces |
scripts/init_sync.sh |
Full setup in one command (now reads registry) |
scripts/force_sync.sh |
Trigger immediate sync detection |
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-config-sync - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-config-sync触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Agent Config Sync 是什么?
Synchronize configuration versions across OpenClaw multi-agent deployments. Tracks changes in a master workspace using sentinel version files and CHANGELOG,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 70 次。
如何安装 Agent Config Sync?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-config-sync」即可一键安装,无需额外配置。
Agent Config Sync 是免费的吗?
是的,Agent Config Sync 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Agent Config Sync 支持哪些平台?
Agent Config Sync 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Config Sync?
由 LeonSong(@stevensongxx)开发并维护,当前版本 v1.3.0。