Workspace Sync
Synchronize agent workspaces across multiple machines using zero-token bash scripts. Supports Git-based and rsync-based workflows with selective file exclusion.
Architecture
Agents:
- Ada - Primary agent (ada-gateway)
- Spock - Research agent (spock workspace)
- Scotty - Operations agent (scotty workspace)
Sync Targets:
- Local machines (ada-gateway, spock, scotty)
- Pi (Raspberry Pi)
- Mac (macOS machine)
Shared Repository: henrino3/clawd (Git-based sync backbone)
What Gets Synced
skills/- Custom skills and scriptsmemory/- Daily memory filesmemory.md- Long-term memoryAGENTS.md,SOUL.md,IDENTITY.md- Agent configurationTOOLS.md- Tool notes
What Gets Excluded
See config/sync-exclude.txt for the full list:
- Secrets and credentials (
.env,*.key,*.pem) - Large files (
*.mp4,*.zip,*.tar.gz) - System files (
.DS_Store,node_modules/) - Local runtime files (
logs/,*.pid)
Usage
Sync to Pi
Push current workspace to Pi:
./scripts/sync-to-pi.sh
Options:
-n, --dry-run- Preview changes without applying-h, --host HOSTNAME- Override Pi hostname (default: pi@raspberrypi.local)
Sync from Pi
Pull workspace from Pi to local:
./scripts/sync-from-pi.sh
Options:
-n, --dry-run- Preview changes without applying-h, --host HOSTNAME- Override Pi hostname
Sync All
Synchronize across all configured machines:
./scripts/sync-all.sh
This script:
- Commits local changes to Git
- Pushes to henrino3/clawd
- Syncs to Pi via rsync
- Optionally syncs to Mac (if configured)
Git Workflow
The shared repository provides version control and conflict resolution:
# On any machine:
cd ~/clawd
git pull # Get latest changes
# Make modifications
git add .
git commit -m "Update"
git push # Share with other machines
Rsync vs Git
Use Git for:
- Tracked changes with history
- Conflict resolution
- Collaboration across multiple agents
Use rsync for:
- Fast one-way sync to Pi
- Selective sync with exclusions
- Backup without version control
Conflict Resolution
When conflicts occur:
- Git conflicts - Resolve manually in affected files, commit
- Rsync conflicts - Newer files overwrite older (use
--dry-runfirst)
Setup Requirements
Pi SSH Access
Ensure SSH key authentication is configured:
ssh-copy-id pi@raspberrypi.local
Git Configuration
Clone the shared repository on each machine:
git clone https://github.com/henrino3/clawd.git ~/clawd
cd ~/clawd
git config user.name "Your Name"
git config user.email "your@email.com"
Environment Variables
Optional overrides in ~/.bashrc or ~/.zshrc:
export CLAWD_PI_HOST="pi@192.168.1.100" # Override Pi hostname
export CLAWD_MAC_HOST="mac@macmini.local" # Mac sync target
Automation
Cron Jobs
Sync automatically every hour:
0 * * * * cd ~/clawd/skills/workspace-sync && ./scripts/sync-all.sh >> ~/clawd/logs/sync.log 2>&1
Pre-commit Hook
Auto-sync on workspace changes:
# ~/clawd/.git/hooks/pre-commit
#!/bin/bash
cd ~/clawd/skills/workspace-sync
./scripts/sync-all.sh
Troubleshooting
Permission Denied
chmod 600 ~/.ssh/id_rsa
Rsync Connection Failure
Check Pi is reachable:
ping raspberrypi.local
ssh pi@raspberrypi.local
Git Push Rejected
Pull and merge first:
git pull --rebase
git push
Safety
- Always test with
--dry-runfirst - Secrets are excluded by default (see
config/sync-exclude.txt) - Backups are not automatic - Consider external backup strategy
- Conflicts require manual resolution - Review carefully before pushing
