/clear vs /compact
People often think /clear and /compact both just make room. They keep very different things. /compact squeezes the chat into a summary, so Claude still knows what you were doing. /clear starts a new chat with an empty context, so Claude knows nothing of it. Use /compact to go on with the same task. Use /clear to start a new one.
/clear Command
It starts a new chat with an empty context.
/clear starts a new conversation with an empty context, so Claude no longer sees the chat so far. CLAUDE.md and your project memory still load. The old conversation is saved, so /resume can bring it back. Pass a name to label the old one in the /resume list. It is the cleanest way to switch to a new task.
Auto-Compact
Claude Code sums up an old chat to make room.
Auto-compact is how Claude Code makes room when a session's context window is nearly full. It writes a short summary of the chat so far. Then it carries on from that summary. Your CLAUDE.md and your auto memory are loaded again after it. But a rule you only gave in the chat may get lost. You can also run /compact yourself, and say what to keep.
In one line
- /clear Command
- It starts a new chat with an empty context.
- Auto-Compact
- Claude Code sums up an old chat to make room.