
How /compact Actually Works in Claude Code
If you've ever been deep in a Claude Code session and noticed it forgetting things you said earlier, that's the context window filling up — and /compact is the command built to deal with it.
Notes
If you’ve ever been deep in a Claude Code session and noticed it forgetting things you said earlier, that’s the context window filling up — and /compact is the command built to deal with it. In this video I break down how it actually works: the two-stage process Claude Code uses to manage context, what survives compaction versus what gets condensed away, how to steer the summary with a single line of plain English, and why /compact, /clear, and starting a new session are three very different things. Most of this comes straight from Anthropic’s official documentation; where something is community-reported rather than officially documented, I say so.