Install
openclaw skills install @clarezoe/skill-genie-shared-memoryRead and write shared state for ANY AI agent with a dual-layer model: durable cross-agent knowledge (.agents/memory + optional private local layer) and real-time cross-worktree runtime memory (.trellis/shared symlinked to <git-common-dir>/trellis-shared). Use for project memory, handoffs, and multi-worktree coordination.
openclaw skills install @clarezoe/skill-genie-shared-memoryUse one skill for two different concerns:
Keep these concerns separate in storage and mutation rules.
~/.shared-memory/global/MEMORY.md index<repo>/.agents/memory/MEMORY.md index~/.shared-memory/<project-slug>/<repo>/.trellis/shared (symlink)<git-common-dir>/trellis-shared/handoffs/ (cross-worktree handoff files)knowledge/ (append-only runtime discoveries)agents/ (one append-only log per agent)events/ (timestamped event stream)REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
SLUG="$(basename "$REPO_ROOT" | tr '[:upper:]' '[:lower:]')"
# Durable layers
K0="$HOME/.shared-memory/global"
K1="$REPO_ROOT/.agents/memory"
K2="$HOME/.shared-memory/$SLUG"
[ -f "$K0/MEMORY.md" ] && cat "$K0/MEMORY.md"
[ -f "$K1/MEMORY.md" ] && cat "$K1/MEMORY.md"
[ -f "$K2/MEMORY.md" ] && cat "$K2/MEMORY.md"
# Runtime layer pointer
[ -L "$REPO_ROOT/.trellis/shared" ] && ls -1 "$REPO_ROOT/.trellis/shared/handoffs" 2>/dev/null || true
Read indexes first, then load specific files on demand.
Classify each write as:
global -> K0 (~/.shared-memory/global) for machine-wide private lessonsshared -> K1 (.agents/memory) and enters gitprivate -> K2 (~/.shared-memory/<slug>) and stays localRequired frontmatter:
---
name: some-memory
description: one-line retrieval hook
metadata:
type: user | feedback | project | reference | engineering
scope: shared | private
created: 2026-07-23
updated: 2026-07-23
---
Update MEMORY.md after every new memory file.
Run:
bash skills/shared-memory/templates/link_shared_memory.sh
Script contract:
trellis-shared/{handoffs,knowledge,agents,events}.trellis/shared symlink if missingrm -rf user content implicitlyAlso ensure .gitignore has:
.trellis/shared
Install the Skill Genie session-start rules so every new agent session runs the idempotent linker before it reads handoffs. Merely installing this skill does not make a client invoke it automatically.
.trellis/shared/handoffs/YYYY-MM-DD-<stream>-<agent>.md.trellis/shared/agents/<agent>.jsonl.trellis/shared/events/YYYY/MM/DD.jsonl.trellis/shared/knowledge/Use this checklist before every write:
Never mix layers in one file.
.trellis/handoffs/ when runtime layer existssession-handoff: structured handoff generationhandoff-receiver: strict handoff continuationskills/shared-memory/references/worktree-shared-framework.md