groups/<folder>/memory/. Inside the agent container, the same directory is available at /workspace/agent/memory/.
The memory tree
NanoClaw creates this scaffold when an agent container boots:memory
index.md
system
index.md
definition.md
memory/index.mdis the top-level map. Its Core Memory section holds the few durable facts useful in nearly every conversation; the rest points to more focused files.memory/system/definition.mdexplains how the agent should store, retrieve, correct, and organize memory. The agent owns this doctrine and can improve it.
memory/system/index.md is a normal folder index. It is not loaded separately.
Everything below that scaffold is flexible. The agent chooses folders and concept types based on your world — people, projects, customers, decisions, or whatever makes related information easiest to find. Every folder that contains durable concepts gets its own concise index.md.
How memory reaches a conversation
Whenever a provider creates a fresh context window, NanoClaw injectsmemory/index.md and memory/system/definition.md:
Resume happens often — usually on each new inbound message — so injecting again would duplicate the same block throughout the conversation.
Each loaded file has a 16,000-character limit. If either file grows past that limit, the injected copy ends with a truncation notice. Keep both files lean: headlines and pointers in the indexes, detail in linked concept files. The agent can follow those links and read deeper files with ordinary filesystem tools when they become relevant.
The session-start hook renders memory inside the container. The trusted host composes stable agent instructions, but it never reads agent-controlled memory content into
CLAUDE.md or AGENTS.md.
Write portable concept files
The directory is an Open Knowledge Format (OKF) v0.1 bundle. Store one durable concept per Markdown file and begin it with YAML frontmatter whose first field istype:
type uses the vocabulary of your own domain; NanoClaw does not impose a fixed list. Optional fields include title, description, tags, and resource. Root and folder index.md files, plus log.md files, do not need a type.
The format is a convention, not a gate. A Markdown file with missing or malformed frontmatter still works as memory. The agent repairs its metadata when it next reads or edits that file instead of scanning and rewriting the whole tree.
Put each kind of state in the right place
Memory is one of three different durable surfaces:
For example, “the user’s name is Ada” belongs in memory. “Always answer in Spanish” is a standing instruction. The details of yesterday’s conversation remain in its transcript unless the agent distills something durable from them.
Keep Core Memory especially selective. It should contain only facts relevant in nearly every conversation. Put everything else in focused files and link them from the nearest index.
Understand the scope
Memory belongs to an agent group, not to one chat or session:
Conversation history follows different rules. Two sessions can have separate histories while reading and writing the same group memory. A provider switch starts a fresh continuation on the new provider, but durable memory stays in place.
If different audiences must not influence or learn from each other’s durable state, give them separate agent groups. Session isolation alone is not enough. See Isolation levels for the full decision guide.
Ask the agent to remember
The normal interface is conversational:memory/ directly without an approval card. You can inspect the result on the host:
groups/ is not a Git repository by default. Review the files directly and include the group folder in your own backup plan.
Security and trust
The agent’s group directory is mounted read-write, so an agent can change or delete its own memory. That is what makes conversational remembering work, but it also means a prompt-injected agent can poison the durable state seen by every future session in that group. Use separate agent groups for different people or trust domains. Review memory used by agents exposed to untrusted audiences, and keep sensitive host files outside their mount allowlist. The Security model explains the wider blast radius and the controls around it.Migrate older memory
Older groups may still keep durable state in.seed.md, CLAUDE.md, CLAUDE.local.md, Claude’s native auto-memory directory, or an imported provider-memory file. Run the migrate-memory skill to:
- Move standing role and behavior into
instructions.prepend.md - Distill durable facts into focused concept files
- Build indexes so every retained concept is reachable from
memory/index.md - Preserve staged source files until you approve the result
Related pages
- Customize an agent — change standing instructions, model, and capabilities
- Agent providers — provider hooks and what carries across a switch
- Agent self-modification — what the agent can edit without approval
- Isolation levels — decide which conversations may share files and memory
- Container lifecycle — see where the group workspace is mounted