OpenClaw
Integrate memories.sh with OpenClaw.
OpenClaw is an open-source personal AI assistant. Its runtime reads a workspace pack under ~/.openclaw/workspace (not just AGENTS.md), so memories.sh should preserve and sync the full workspace file set.
Why memories.sh + OpenClaw
Adding memories.sh gives you:
- Cross-tool portability — Rules and decisions you keep for OpenClaw also power Claude Code, Cursor, Windsurf, and other integrations
- Structured memory store — Keep rules, decisions, and facts in one searchable local database
- Reusable skills — Generate
.agents/skills/**/SKILL.mdonce and reuse across agent ecosystems
Recommended Setup (Workspace-First)
1) Run OpenClaw onboarding once
openclaw onboardThis creates and configures your OpenClaw workspace (default: ~/.openclaw/workspace).
2) Generate memories.sh output for OpenClaw
From your project (where your memories are scoped):
cd your-project
memories init
memories generate claude -o ~/.openclaw/workspace/AGENTS.md --force
memories generate agents
mkdir -p ~/.openclaw/workspace/skills
if [ -d .agents/skills ]; then
cp -R .agents/skills/. ~/.openclaw/workspace/skills/
fiThis writes:
AGENTS.mdinto OpenClaw's workspace for session instructionsSKILL.mdfiles into OpenClaw's workspaceskills/directory
OpenClaw Workspace Files (Synced)
memories files ingest / memories files apply now carry the OpenClaw workspace set:
~/.openclaw/workspace/AGENTS.md~/.openclaw/workspace/SOUL.md~/.openclaw/workspace/TOOLS.md~/.openclaw/workspace/IDENTITY.md~/.openclaw/workspace/USER.md~/.openclaw/workspace/HEARTBEAT.md~/.openclaw/workspace/BOOTSTRAP.md~/.openclaw/workspace/BOOT.md(when present)~/.openclaw/workspace/MEMORY.md/memory.md~/.openclaw/workspace/memory/*.md~/.openclaw/workspace/skills/**/*
To include OpenClaw runtime config (~/.openclaw/openclaw.json) in file sync too:
memories files ingest --global --include-config
memories files apply --global --include-config --forceSecret-like fields are redacted before storage; keep real credentials in Supabase Vault or environment variables.
3) Keep it in sync
Whenever memories change:
cd your-project
memories generate claude -o ~/.openclaw/workspace/AGENTS.md --force
memories generate agents
if [ -d .agents/skills ]; then
cp -R .agents/skills/. ~/.openclaw/workspace/skills/
fiOptional reminder setup:
memories reminders add "0 9 * * 1-5" "OpenClaw refresh: run generate + skills copy + files apply"4) Sync DB memory and OpenClaw file memory
# Bidirectional sync between DB rows and OpenClaw memory files
memories openclaw memory sync --direction bothDeterministic lifecycle sequence (recommended)
Use this order around session boundaries:
# 1) Read semantic + recent episodic bootstrap context
memories openclaw memory bootstrap
# 2) Flush recent meaningful session events to today's daily log
memories openclaw memory flush <session-id>
# 3) Write a raw snapshot file from session events
memories openclaw memory snapshot <session-id> --trigger reset
# 4) Keep DB rows and files aligned
memories openclaw memory sync --direction bothTrigger guidance:
- Near compaction or inactivity thresholds: run
flush - On
/new,/reset, or handoff boundaries: runsnapshot --trigger new_session|reset|manual|auto_compaction - Run
syncafter lifecycle writes when multiple devices/workspaces may read the same memory files
Important Notes
- OpenClaw docs define a full workspace contract (
AGENTS,SOUL,TOOLS,IDENTITY,USER,HEARTBEAT,BOOTSTRAP,BOOT, and memory files). - OpenClaw docs currently do not document a project-level MCP config path like
.openclaw/mcp.jsonfor this integration flow. openclaw onboardseeds default workspace templates (AGENTS,SOUL,TOOLS,IDENTITY,USER,HEARTBEAT,BOOTSTRAP).memories generate agentsonly creates.agents/skillswhen skills exist in your memory store, so copying skills should be conditional.- If you changed your workspace path in
~/.openclaw/openclaw.json(for exampleagent.workspaceoragents.defaults.workspace), replace~/.openclaw/workspacewith your configured path.
OpenClaw Agent Skill (GitHub)
The distributable OpenClaw skill lives in this repository and can be referenced directly: