Lightweight file-based coordination for multi-agent OpenClaw setups.
Agents run independently — Reddit doesn't know what Moltbook found, News doesn't know what's trending on HN. Each agent is an island.
Shared JSON files that agents write to and read from. No config changes needed — just files on disk.
bash
# Create shared directory in workspace
mkdir -p ~/.openclaw/workspace/shared
# Script location
~/.openclaw/workspace/scripts/shared-context.py
bash
# Reddit agent logs trending topic
python3 scripts/shared-context.py add-trend \
--source reddit --topic "self-hosting mini PCs" --score 1500
# News agent logs highlight
python3 scripts/shared-context.py add-highlight \
--source news --title "Unsloth Studio launched" \
--summary "Open-source LLM training UI, 2x faster"
bash
# Moltbook agent checks what's trending before posting
python3 scripts/shared-context.py get-trends --limit 5
# Any agent checks recent highlights
python3 scripts/shared-context.py get-highlights --limit 5
bash
# Remove entries older than 48 hours
python3 scripts/shared-context.py cleanup --hours 48
Add to any agent's cron prompt:
text
Before posting/engaging, check shared context:
exec('python3 /path/to/scripts/shared-context.py get-trends --limit 3')
→ If a trend is relevant to this platform, create content about it.
After finishing, log what you found:
exec('python3 /path/to/scripts/shared-context.py add-trend --source <agent> --topic "<finding>" --score <relevance>')
FilePurposeshared/trends.jsonTopics trending across platformsshared/highlights.jsonBest content found by any agentscripts/shared-context.pyCLI to read/write shared context
text
Reddit ──write──→ shared/trends.json ←──read── Moltbook
News ──write──→ shared/highlights.json ←──read── Clawstr
↑
brain-maintenance (cleanup)
No database. No message queue. Just JSON files on disk. Works because all agents run on the same machine.