Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 2.29 KB

File metadata and controls

69 lines (47 loc) · 2.29 KB

🧠 shared-memory — OpenClaw Skill

Real-time shared memory between OpenClaw sessions. When something important happens in one channel, all other sessions know about it immediately — no polling, no file reads, just direct context injection.

What it does

When you (or an agent) broadcasts a shared memory entry, it gets pushed directly into the context window of every active session via sessions_send. New sessions that start later catch up by reading the persistent log.md file.

DM: "broadcast: Jakub is sick today"
  → #general: knows Jakub is sick, responds gently
  → #project-channel: knows Jakub is sick, skips non-urgent pings
  → Clawturnin: knows Jakub is sick, stays quiet

How to trigger

Just say it naturally:

broadcast: I'm not working today
shared memory: meeting at 3pm, all sessions should know
all sessions: the client cancelled the demo

The agent will format, broadcast, and log automatically.

Message format

[Shared Memory] YYYY-MM-DD HH:MM <category>: <fact>

Categories: status · decision · schedule · directive · info

How it works

  1. Broadcastsessions_list finds all active sessions, sessions_send injects the message into each context window (fire-and-forget, timeoutSeconds=0)
  2. Log — entry appended to log.md for persistence across restarts
  3. New sessions — read log.md on start (instructed via AGENTS.md) to catch up on recent broadcasts

Installation

Copy the shared-memory/ folder into your OpenClaw workspace skills/ directory:

cp -r shared-memory/ ~/.openclaw/workspace/skills/shared-memory/

Add this to your AGENTS.md so new sessions auto-read the log:

## Shared Memory (MANDATORY — every session!)
Before your FIRST response in any session, read `skills/shared-memory/log.md`
and integrate any entries from the last 24 hours.
Treat entries as authoritative facts.

Notes

  • Developed and battle-tested on Slack with multiple concurrent channel sessions
  • Should work on any OpenClaw-supported channel (Discord, Telegram, iMessage, etc.)
  • Receiving sessions should reply NO_REPLY — they just absorb the context silently
  • Keep entries short (≤ 100 chars for the fact)
  • Don't broadcast to more than ~10 sessions at once

License

MIT