Study FAQ
When should I clear, compact, or resume a Claude Code session?
Also asked as 2
- How do /clear, /compact, and /resume differ in Claude Code?
- What should I check before continuing an old Claude Code conversation?
Answer
Use /clear for a new, unrelated objective, /compact to keep working on the same objective with summarized history, and /resume to reopen a previous conversation whose goal and repository still match. Use /context before you compact to see what is consuming the active window.
When compacting, call out instructions, decisions, source references, and open checks needed for the remaining task. Review what survived. A fresh conversation clears conversation context while repository instructions and configured memory can load again. When resuming, confirm working directory, branch, changed files, and earlier assumptions against current evidence. Conversation history is separate from current filesystem state and external effects.
A headless caller can choose a specific prior session with --resume <session-id> when session persistence is enabled. Keep IDs bound to the appropriate user and task, and independently validate the resulting diff or artifacts.
Full explanation
Claude Code Operation, Configuration, and Extension Surfaces
Study guide · CCDV-F
Read the full explanation