40 files demonstrating every major OpenClaw capability using Claude Code: - 3 agents (researcher, writer, reviewer) - 3 skills (daily-briefing, slack-message, web-research) - 2 security hooks (pre-tool-use blocker, post-tool-use logger) - 10 self-contained examples with copy-paste prompts - Complete feature map (20 capabilities, 11 full match, 7 different, 2 gap) - Security docs including NemoClaw comparison - Automation, messaging, browser, memory documentation Zero dependencies. Clone and run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
58 lines
1.8 KiB
Markdown
58 lines
1.8 KiB
Markdown
# Example 05: Memory System
|
|
|
|
**Capability:** Claude Code maintains persistent memory across sessions through a
|
|
hierarchy of markdown files. What is written in one session is available in the next.
|
|
|
|
**OpenClaw equivalent:** Daily markdown logs + MEMORY.md + vector search (SQLite-vec).
|
|
|
|
---
|
|
|
|
## How the Hierarchy Works
|
|
|
|
Claude Code loads context in this order, from broadest to narrowest:
|
|
|
|
1. `~/.claude/CLAUDE.md` - global preferences, always loaded
|
|
2. `CLAUDE.md` in the project root - project-specific config, always loaded
|
|
3. `memory/MEMORY.md` - session state, loaded if referenced in CLAUDE.md
|
|
4. `.claude/` managed memory - auto-updated by Claude when `--memory` is active
|
|
|
|
The file loaded earlier provides the frame. Later files narrow it.
|
|
|
|
---
|
|
|
|
## The Prompt
|
|
|
|
```
|
|
Read this project's CLAUDE.md and summarize what you learn about the project
|
|
in three bullet points.
|
|
|
|
Then create a file at memory/project-notes.md with:
|
|
- Today's date as a header
|
|
- The three-bullet summary
|
|
- A note that says "Memory system demonstrated successfully"
|
|
|
|
Finally, explain in one paragraph how this file will be available in the
|
|
next Claude Code session without re-reading CLAUDE.md.
|
|
```
|
|
|
|
---
|
|
|
|
## What Happens
|
|
|
|
Claude Code will:
|
|
|
|
1. Use Read to load `CLAUDE.md` from the project root
|
|
2. Synthesize the project context into three bullets
|
|
3. Use Write to create `memory/project-notes.md`
|
|
4. Explain how CLAUDE.md references cause files to be auto-loaded
|
|
|
|
---
|
|
|
|
## Why This Matters
|
|
|
|
OpenClaw uses SQLite-vec for semantic memory search across sessions. Claude Code
|
|
uses structured markdown with explicit file references. Both achieve persistence.
|
|
The markdown approach is more inspectable: you can read, edit, and version control
|
|
every piece of memory Claude has about your project.
|
|
|
|
The `memory/MEMORY.md` file in this repo shows the pattern at scale.
|