A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.anthropic.com/en/docs/claude-code/slash-commands below:

Slash commands - Anthropic

Built-in slash commands Command Purpose /add-dir Add additional working directories /agents Manage custom AI subagents for specialized tasks /bug Report bugs (sends conversation to Anthropic) /clear Clear conversation history /compact [instructions] Compact conversation with optional focus instructions /config View/modify configuration /cost Show token usage statistics /doctor Checks the health of your Claude Code installation /help Get usage help /init Initialize project with CLAUDE.md guide /login Switch Anthropic accounts /logout Sign out from your Anthropic account /mcp Manage MCP server connections and OAuth authentication /memory Edit CLAUDE.md memory files /model Select or change the AI model /permissions View or update permissions /pr_comments View pull request comments /review Request code review /status View account and system statuses /terminal-setup Install Shift+Enter key binding for newlines (iTerm2 and VSCode only) /vim Enter vim mode for alternating insert and command modes Custom slash commands

Custom slash commands allow you to define frequently-used prompts as Markdown files that Claude Code can execute. Commands are organized by scope (project-specific or personal) and support namespacing through directory structures.

Syntax Parameters Parameter Description <command-name> Name derived from the Markdown filename (without .md extension) [arguments] Optional arguments passed to the command Command types Project commands

Commands stored in your repository and shared with your team. When listed in /help, these commands show “(project)” after their description.

Location: .claude/commands/

In the following example, we create the /optimize command:

Personal commands

Commands available across all your projects. When listed in /help, these commands show “(user)” after their description.

Location: ~/.claude/commands/

In the following example, we create the /security-review command:

Features Namespacing

Organize commands in subdirectories. The subdirectories are used for organization and appear in the command description, but they do not affect the command name itself. The description will show whether the command comes from the project directory (.claude/commands) or the user-level directory (~/.claude/commands), along with the subdirectory name.

Conflicts between user and project level commands are not supported. Otherwise, multiple commands with the same base file name can coexist.

For example, a file at .claude/commands/frontend/component.md creates the command /component with description showing “(project:frontend)”. Meanwhile, a file at ~/.claude/commands/component.md creates the command /component with description showing “(user)”.

Arguments

Pass dynamic values to commands using the $ARGUMENTS placeholder.

For example:

Bash command execution

Execute bash commands before the slash command runs using the ! prefix. The output is included in the command context. You must include allowed-tools with the Bash tool, but you can choose the specific bash commands to allow.

For example:

File references

Include file contents in commands using the @ prefix to reference files.

For example:

Thinking mode

Slash commands can trigger extended thinking by including extended thinking keywords.

Frontmatter

Command files support frontmatter, useful for specifying metadata about the command:

Frontmatter Purpose Default allowed-tools List of tools the command can use Inherits from the conversation argument-hint The arguments expected for the slash command. Example: argument-hint: add [tagId] | remove [tagId] | list. This hint is shown to the user when auto-completing the slash command. None description Brief description of the command Uses the first line from the prompt model Specific model string (see Models overview) Inherits from the conversation

For example:

MCP slash commands

MCP servers can expose prompts as slash commands that become available in Claude Code. These commands are dynamically discovered from connected MCP servers.

Command format

MCP commands follow the pattern:

Features Dynamic discovery

MCP commands are automatically available when:

Arguments

MCP prompts can accept arguments defined by the server:

Naming conventions Managing MCP connections

Use the /mcp command to:

See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4