Claude Code: Agent Memory Frontmatter
Persistent memory for subagents — enabling agents to learn, remember, and build knowledge across sessions.
| ← Back to Claude Code Best Practice |
Overview
Introduced in Claude Code v2.1.33 (February 2026), the memory frontmatter field gives each subagent its own persistent markdown-based knowledge store. Before this, every agent invocation started from scratch.
yaml
---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Write, Edit, Bash
model: sonnet
memory: user
---
You are a code reviewer. As you review code, update your agent memory with
patterns, conventions, and recurring issues you discover.Memory Scopes
| Scope | Storage Location | Version Controlled | Shared | Best For |
|---|