Build your own AI family. Step-by-step instructions for creating, syncing, and managing multiple OpenClaw agents across machines.
This guide teaches you how to set up multiple OpenClaw agents that share a unified workspace through GitHub. Each agent has its own identity but shares memory, documents, and knowledge with the family.
| Component | Minimum | Recommended |
|---|---|---|
| OS | Windows 10 / Ubuntu 20.04 | Windows 11 / Ubuntu 22.04 |
| RAM | 4GB | 8GB+ |
| Storage | 10GB free | 50GB+ SSD |
| Node.js | v18+ | v22+ |
| Git | v2.30+ | v2.40+ |
| Network | Stable internet | Broadband (for GitHub sync) |
Install on each machine where you want an agent.
# Install globally
npm install -g openclaw
# Verify installation
openclaw --version
Use direct API (recommended) instead of bridge plugin.
// ~/.openclaw/openclaw.json (Linux/Mac)
// C:\Users\[Username]\.openclaw\openclaw.json (Windows)
{
"gateway": {
"mode": "local",
"auth": {
"password": "YourSecurePassword123!"
}
},
"agents": {
"defaults": {
"model": "kimi/kimi-code",
"contextWindow": 200000,
"bootstrapMaxChars": 200000,
"bootstrapTotalMaxChars": 1000000
}
},
"providers": {
"kimi": {
"apiKey": "sk-your-moonshot-api-key-here"
}
}
}
# Start the gateway
openclaw gateway start
# Check status
openclaw status
# The dashboard will be at:
# http://127.0.0.1:18789
Set up a GitHub repository for shared files.
# 1. Create new repo on GitHub (e.g., 'my-agent-workspace')
# 2. Don't initialize with README (we'll push existing files)
# 3. In your workspace directory:
cd ~/.openclaw/workspace
git init
git remote add origin https://github.com/YOUR_USERNAME/my-agent-workspace.git
# 4. Create essential files
touch AGENTS.md SOUL.md USER.md MEMORY.md TOOLS.md
# 5. Commit and push
git add .
git commit -m "[KIMI] init: Workspace setup"
git push -u origin main
When you first open the OpenClaw dashboard, you'll see a bootstrap prompt.
IDENTITY.md. This file is local-only and should NOT be synced to GitHub. Add it to .gitignore.
For each new machine/agent:
# 1. Set GitHub PAT as environment variable
$env:GITHUB_PAT="ghp_your_personal_access_token" # Windows
export GITHUB_PAT="ghp_your_personal_access_token" # Linux/Mac
# 2. Clone workspace
cd ~/.openclaw/workspace
git clone https://$env:GITHUB_PAT@github.com/YOUR_USERNAME/my-agent-workspace.git .
# 3. Create local IDENTITY.md (different for each agent)
# 4. Delete BOOTSTRAP.md after first conversation
# 5. Restart gateway
openclaw gateway restart
Create scripts for automatic pulling and pushing.
# Auto-pull script
$workspace = "C:\Users\$env:USERNAME\.openclaw\workspace"
$logFile = "C:\Users\$env:USERNAME\.openclaw\workspace\.scripts\sync.log"
try {
Set-Location $workspace
$env:GIT_TERMINAL_PROMPT = "0"
git stash
git pull origin main
git stash pop
"$(Get-Date) - Pull successful" | Out-File -Append $logFile
} catch {
"$(Get-Date) - Pull failed: $_" | Out-File -Append $logFile
}
# Auto-push script
$workspace = "C:\Users\$env:USERNAME\.openclaw\workspace"
try {
Set-Location $workspace
git add .
git commit -m "[$(hostname)] sync: Auto-sync"
git push origin main
} catch {
"Push failed: $_" | Out-File -Append ".scripts/sync.log"
}
Rules all agents follow when sharing the workspace:
MANDATORY. Every agent MUST pull latest changes before editing.
When possible, add new sections instead of modifying existing ones. Avoid deleting other agents' content without discussion.
[AGENT] [TYPE]: Description
Examples: [KIMI] docs: Updated family table, [MINI] fix: Resolved sync conflict
Each agent has its own IDENTITY.md that never gets synced. Add it to .gitignore:
IDENTITY.md
.env
*.local
.openclaw/workspace-state.json
read the file directly, or delete workspace-state.json and restart.
# Tell agent in chat:
read C:\Users\[Username]\.openclaw\workspace\FAMILY_PROTOCOL.md
# Or hard reset:
Remove-Item ".openclaw\workspace-state.json"
openclaw gateway restart
git stash
git pull origin main
git stash pop
git push origin main
git checkout --ours IDENTITY.md.
Default context is ~12KB per file. Increase it manually:
// In openclaw.json, add under agents.defaults:
"bootstrapMaxChars": 200000,
"bootstrapTotalMaxChars": 1000000
GitHub auto-revokes PATs detected in messages. Use:
# Windows PowerShell
$env:GITHUB_PAT="ghp_..."
# Or right-click paste directly in terminal (never in chat)
Keep the workspace clean:
~/.openclaw/workspace/
โโโ AGENTS.md # Family rules
โโโ SOUL.md # Personality guidelines
โโโ USER.md # User profile
โโโ MEMORY.md # Long-term memory
โโโ TOOLS.md # Machine specs, gear notes
โโโ FAMILY_PROTOCOL.md # Collaboration rules
โโโ SETUP_GUIDE.md # This guide
โโโ memory/ # Daily conversation logs
โ โโโ 2026-04-24.md
โ โโโ ...
โโโ .gitignore # Exclude local files
Never rely on one copy. Your setup should have:
# Check status
openclaw status
# Restart gateway
openclaw gateway restart
# Config edit
openclaw config edit
# Git sync (always pull first!)
git stash && git pull origin main && git stash pop
# View logs
Get-Content .scripts/sync.log -Tail 20 # Windows
tail -f .scripts/sync.log # Linux/Mac
When you need more: