Skip to content

Slash commands & prompt prefixes

Inside an interactive session, type a prefix as the first character of your input to trigger special behavior. This page covers built-in slash commands, the prompt prefixes, and where custom commands come from.

Prompt prefixes

PrefixMeaningExample
/Run a slash command or skill/clear
@Mention a file or MCP resource (adds it to context)@src/app.ts
!Shell mode — runs the command and adds its output to context!git status

NOTE

To save something to memory, use /memory or just ask Claude to remember it. The # chat prefix is not a memory shortcut.

Built-in slash commands

CommandWhat it does
/helpList commands and basic usage
/initGenerate a CLAUDE.md for the current repo
/clearClear the conversation and free context
/compactSummarize and compact the conversation
/contextShow what's currently in the context window
/modelPick the model (see models & effort)
/effortSet reasoning effort level
/permissionsView and edit allow/deny rules (see permission modes)
/configOpen settings (theme, editor/vim mode, and more)
/usageShow token and cost usage
/rewindRoll back to an earlier point in the session
/resumeResume a past session (picker if no id given)
/doctorRun install and config diagnostics
/agentsManage subagents
/mcpView and manage MCP servers
/memoryEdit memory files
/code-reviewReview the current changes
/exportExport the conversation transcript

This is not the full list — type / in a session to see everything available, including commands contributed by plugins.

Custom commands

Custom slash commands live as skills. Define a skill and it becomes invocable with / (and, where applicable, automatically by Claude). See skills for how to author them.

MCP prompts

Prompts exposed by MCP servers appear as slash commands namespaced by server:

text
/mcp__<server>__<prompt>

For example, a github server exposing a summarize_pr prompt is invoked as /mcp__github__summarize_pr. Use /mcp to inspect connected servers and the prompts they provide.

TIP

Combine prefixes with arguments freely — @ a file, then describe the change you want in the same message.

Source: Slash commands · Interactive mode

Released under the MIT License.