Episode 14: Memory System

⏱ Est. reading time: 4 min Updated on 5/7/2026

Key Takeaway: Memory is "long-term memory" that persists across sessions, letting Claude remember your preferences and project state.


14.1 What is Memory

Memory is Claude Code's persistent memory system. It saves key information across sessions and auto-loads in new conversations.


14.2 Memory Storage Location

~/.claude/projects/-Users-eric-work-teachagent/memory/
β”œβ”€β”€ MEMORY.md              ← Index file (auto-loaded into context)
β”œβ”€β”€ user_role.md           ← User role/preferences
β”œβ”€β”€ feedback_testing.md    ← Feedback and corrections
β”œβ”€β”€ project_status.md      ← Project status
└── ...

14.3 Memory Types

Type Purpose Example
user User role, preferences "User is a data scientist, React beginner"
feedback User corrections "Don't summarize at the end of every reply"
project Project status and decisions "Auth middleware rewrite due to compliance"
reference External system pointers "Pipeline bugs in Linear INGEST project"

14.4 How Memory Works

sequenceDiagram
    participant H as Hooks
    participant M as Memory files
    participant CTX as Context
    participant API as API

    Note over H: SessionStart hook triggers
    H->>M: Read MEMORY.md index
    M->>CTX: Inject memory summary into system prompt
    CTX->>API: Sent as fixed section

    Note over H: During conversation
    H->>H: claude-mem auto-records observations

    Note over H: Session ends
    H->>M: Update memory files

14.5 Memory's Impact on Context

Memory files are injected into the system prompt at SessionStart, becoming part of the fixed section:

Fixed section = System Prompt (~3K) + CLAUDE.md (~4K) + Memory (~0.5K-3K) + Hooks (~1.5K)

More memory β†’ larger fixed section. But thanks to caching, the fixed section is only charged once.

Recommendation: Keep MEMORY.md index under 200 lines; keep individual memory files concise.


Next Episode: Episode 15 covers /compact and /clear β€” an in-depth comparison of two context management commands.