Command reference Β· Claude Code
/clear
Starts a new conversation with an empty context; the previous one remains available via /resume.
/clear starts a completely new conversation with an empty context - all previous messages, read files, and tool results drop out of the active context window. The previous conversation isn't lost, though: it can be reopened via /resume, or, within the same running Claude Code process, directly through an additional entry at the top of the rewind menu (/rewind, since version 2.1.191).
An optional name labels the old conversation in the /resume picker so it stays recognizable later, e.g. /clear bugfix-session.
/clear differs from /compact in that /compact only summarizes and continues the running conversation, while /clear actually starts over from zero - useful for a topic change, not for continuing the same task with less context. File changes in the working directory are unaffected by the command: it only resets the conversation context, not the code already written. Aliases: /reset, /new.
π THE SAME TASK (βCLEAR CONTEXT/HISTORYβ) ON OTHER PLATFORMS
β WHEN TO USE IT?
Start a new conversation on a completely different topic
/clear
Set the old conversation aside with a name to find it easily later
/clear bugfix-session
β WHEN NOT TO?
Just freeing up context while work is ongoing
/clear starts a completely new conversation with an empty context - according to the docs, /compact is intended for simply freeing up context during ongoing work
Better: use /compact
Wanting to restore a cleared conversation after the Claude Code process has already ended
according to the docs, the additional rewind entry for the previous session is only available until Claude Code is closed or another session is opened
Better: use /resume and select the previous session from the list directly, as long as the process is still running
SOURCES
- Claude Code docs (official) β code.claude.com
MORE COMMANDS Β· Claude Code