/clear
Wipe conversation history and start fresh
/compact
Summarise history into a compact context
/resume
Return to a previous conversation
/context
Visualise current context window fill
/cost
Show session API cost breakdown
/usage
Show plan usage limits
/exit
Quit Claude Code
/clear
Clears the entire conversation history and frees up context. Equivalent to starting a brand-new session while staying in the same terminal. Aliases:reset, newArguments: none
Non-interactive: no
When to use
- The conversation has drifted off-topic and you want a clean slate.
- You’ve hit the context limit and
/compactis not sufficient. - You want to start a completely unrelated task.
Example
/compact
Compresses the current conversation into a summary and continues with that summary as the new context. This frees up a large portion of the context window while preserving the essential history. Arguments:[optional summarisation instructions]Non-interactive: yes (can be used in
--print mode)Disabled by:
DISABLE_COMPACT=1 environment variable
How it works
- Claude Code sends the current conversation to the model with an internal summarisation prompt.
- The model produces a concise summary capturing key decisions, code changes, and outstanding tasks.
- The conversation is replaced with the summary as a system message, freeing context.
- If session memory is configured, the summary is also written to the session memory file.
Custom summarisation instructions
Pass an optional argument to guide what the summary prioritises:/compact is also triggered automatically by Claude Code when the context window is approaching its limit, unless disabled by configuration.Examples
Compact with default instructions:/resume
Opens a session picker that lets you search through and resume previous Claude Code conversations. When resumed, the full conversation history is loaded back into context. Aliases:continueArguments:
[conversation id or search term]Non-interactive: no
Usage
Run without arguments to open the interactive session browser:Session browser
The browser shows sessions sorted by most recent activity. You can:- Type to filter by session content or description
- Use arrow keys to navigate
- Press Enter to load the selected session
/context
Displays the current context window utilisation as a colour-coded grid. Each cell represents a fraction of the total context window. Arguments: noneNon-interactive: yes (shows raw numbers in non-interactive mode)
Example output
/compact or starting a new session with /clear.
/cost
Shows the total API cost and time elapsed for the current session, broken down by model and token type. Arguments: noneNon-interactive: yes
Hidden for: claude.ai subscribers (cost is covered by subscription)
Example output
/cost shows the cost for the current session only. Use /insights to analyse costs across multiple historical sessions./usage
Displays your plan usage against the current billing period’s limits. Available to claude.ai subscribers only. Arguments: noneAvailability: claude.ai subscribers
Example output
/exit
Exits the Claude Code REPL immediately. Any unsaved state (conversation history, background tasks) is cleaned up gracefully. Aliases:quitArguments: none
Example
Ctrl+D (sends EOF) or Ctrl+C twice in quick succession.
Background tasks started with
run_in_background: true are terminated when you exit. If you want them to continue, detach from the session instead of exiting./export
Exports the current conversation to a file in your chosen format. Useful for sharing transcripts or archiving sessions. Arguments:[path]