Skip to main content
Slash commands let you control Claude Code’s behavior from within the interactive REPL. Type / followed by the command name to invoke them. They are only available when running Claude Code interactively — they cannot be used in headless or non-interactive mode (with the exception of a few commands that explicitly support --print mode).
> /commit
> /compact summarize only the last 20 turns
> /model claude-opus-4-5

All commands

CommandDescriptionNotes
/commitCreate a git commit with a generated messageStages relevant files automatically
/reviewReview a pull requestAccepts an optional PR number
/diffView uncommitted changes and per-turn diffsOpens an interactive diff dialog
/pr_commentsFetch and display GitHub pull request commentsRequires gh CLI
/compactCompress conversation history into a summaryAccepts optional summarization instructions
/resumeRestore a previous conversation sessionAccepts a session ID or search term
/shareShare the current sessionFeature availability varies by account
/clearClear conversation history and free up contextAliases: /reset, /new
/exitExit the REPLAliases: /quit
/contextVisualize current context window usage as a colored grid
/costShow total token cost and duration of the current sessionHidden for claude.ai subscribers
/tasksList and manage background tasksAliases: /bashes
/configOpen the configuration panelAliases: /settings
/modelSet the AI model used for the sessionAccepts a model name or opens a picker
/themeChange the terminal color themeOpens an interactive picker
/vimToggle between Vim and normal editing modesPersisted to global config
/doctorDiagnose your Claude Code installation and settings
/loginSign in to your Anthropic account
/logoutSign out from your Anthropic account
/memoryEdit Claude memory filesOpens your $EDITOR
/mcpManage MCP server connectionsAccepts enable, disable, reconnect
/skillsManage reusable skills
/helpShow help information
/versionDisplay the current Claude Code version
/initInitialize a new project
/statusShow current status information
/envManage environment variables
/filesManage files in the current session
/feedbackSend feedback to Anthropic
/desktopHand off the session to the desktop app
/mobileHand off the session to the mobile app
Commands are only available inside the Claude Code REPL. If you launch Claude Code with --print for non-interactive (headless) use, most slash commands will not be available. A small number of commands — such as /compact and /cost — support non-interactive mode.

Dive deeper

Git workflow commands

/commit, /review, /diff, and /pr_comments in detail.

Session management

Managing context, cost, resuming sessions, and more.

Configuration commands

Changing models, themes, auth, memory, and MCP servers.

Build docs developers (and LLMs) love