Manage the conversation
These commands control the conversation and its context: start again, summarize, go back, or keep a copy.
Context
| Command |
Aliases |
Description |
/clear [name] |
/reset, /new |
Start a new conversation with an empty context. The name labels the old conversation in /resume |
/compact [instructions] |
|
Summarize the conversation to free context. The instructions set the focus of the summary |
/btw [question] |
|
Ask a side question. The question and the answer do not go into the conversation |
Plan and goals
| Command |
Description |
/plan [description] |
Enter plan mode. With a description, start the task at once, for example /plan fix the auth bug |
/goal [condition\|clear] |
Set a goal. Claude continues across turns until the condition is true. clear removes the goal |
Sessions
| Command |
Aliases |
Description |
/resume [session] |
/continue |
Resume a conversation by ID or name, or open the session picker |
/rename [name] |
|
Rename the session. With no name, Claude Code generates one |
/branch [name] |
|
Create a branch of the conversation and move into it. The original stays available in /resume |
/fork [prompt] |
|
Copy the conversation into a new background session and continue here |
/exit |
/quit |
Exit the CLI. In an attached background session, it detaches and the session continues |
Go back in time
| Command |
Aliases |
Description |
/rewind |
/checkpoint, /undo |
Go back to a previous point in the conversation, the code or both. You can also summarize from a selected message |
Get the output
| Command |
Description |
/copy [N] |
Copy the last response to the clipboard. N copies the Nth latest response. In the picker, w writes to a file |
/export [filename] |
Export the conversation as plain text, to a file or to the clipboard |
To start Claude Code from the shell, use these flags.
claude --continue # continue the last conversation
claude --resume # open the session picker
claude --resume <session> # resume a specific session