Skip to content
Artwork for Master Claude Chat, Cowork, Code
Master Claude Chat, Cowork, Code · Sunday · 45 min

14. Memory, Compaction and Checkpoints (Managing Context in Long Sessions)

In Episode 14 of Beyond Prompting, author Sho Shimoda breaks down how to manage context budgets and session state when conversations run long. We examine the three core mechanisms that control what Claude retains, what gets summarized, and how to recover when an exploration strays off track: Auto Memory Across Sessions: How Claude Code automatically records durable preferences and project facts under ~/.claude/projects/<project>/memory/, loading the top of MEMORY.md while keeping topic-specific files available on demand. Reading the Context Budget: Using the /context command to visualize exact token usage across system prompts, tool definitions, rules, memory, skills, and conversation history. What Compaction Keeps (and Drops): Understanding what survives automatic or manual compaction—system prompts, CLAUDE.md, unscoped rules, plan mode plans, and auto memory are re-injected from disk—and how to direct summaries using /compact focus on <topic>. Going Backwards with Checkpoints: Using /rewind or pressing Esc Esc twice to restore code, conversation, or both across the 100 most recent prompt snapshots, alongside the four structural limits where Git commits remain essential. (Note for listeners: This episode covers Chapter 14 of Sho Shimoda's book RUNNING CLAUDE: The Operator’s Guide to Chat, Cowork and Claude Code, available on Amazon as the successor book to Master Claude: Chat, Cowork and Code).

0:00-45:24

transcript

No transcript — this publisher did not publish one.

show notes

In Episode 14 of Beyond Prompting, author Sho Shimoda breaks down how to manage context budgets and session state when conversations run long. We examine the three core mechanisms that control what Claude retains, what gets summarized, and how to recover when an exploration strays off track:

    • Auto Memory Across Sessions: How Claude Code automatically records durable preferences and project facts under ~/.claude/projects/<project>/memory/, loading the top of MEMORY.md while keeping topic-specific files available on demand.
    • Reading the Context Budget: Using the /context command to visualize exact token usage across system prompts, tool definitions, rules, memory, skills, and conversation history.
    • What Compaction Keeps (and Drops): Understanding what survives automatic or manual compaction—system prompts, CLAUDE.md, unscoped rules, plan mode plans, and auto memory are re-injected from disk—and how to direct summaries using /compact focus on <topic>.
    • Going Backwards with Checkpoints: Using /rewind or pressing Esc Esc twice to restore code, conversation, or both across the 100 most recent prompt snapshots, alongside the four structural limits where Git commits remain essential.

(Note for listeners: This episode covers Chapter 14 of Sho Shimoda's book RUNNING CLAUDE: The Operator’s Guide to Chat, Cowork and Claude Code, available on Amazon as the successor book to Master Claude: Chat, Cowork and Code).

links1