YouTip LogoYouTip

Claude Code Slash Commands

Claude Code Slash / Commands

\n\n

Slash / commands are the quick control entry points for Claude Code’s interactive sessions. By entering commands starting with /, you can quickly invoke features, manage sessions, and customize workflows.

\n\n

Image 1

\n\n

To view all available commands:

\n\n
/help\n
\n\n

/help lists all built-in commands, current project’s custom commands (Skills / Commands), and commands exposed by connected MCP servers.

\n\n

Command Types:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeTrigger MethodSourceStorage LocationUse Cases
Built-in Commands/commandInstalled with Claude CodeInternal implementationSystem operations: session management, configuration, integration, etc.
Built-in Skills/skill-nameBundled with Claude CodeInternal implementationPredefined AI workflows: code review, debugging, batch processing, etc.
Project Custom Skills (Recommended)/skill-nameUser-created directory + SKILL.md.claude/skills/<name>/SKILL.mdReusable team-shared workflows,Add to git; supports Claude auto-triggering
Project Custom Commands (Legacy format)/commandUser-created .md file.claude/commands/Repeated team-shared workflows,Add to git
Personal Custom Skills/skill-nameUser-created directory + SKILL.md~/.claude/skills/<name>/SKILL.mdPersonal workflows reusable across projects
Personal Custom Commands/commandUser-created .md file~/.claude/commands/Personal workflows reusable across projects (legacy format)
MCP Commands/mcp__server__commandAutomatically exposed by MCP serversProvided by MCP serversInvoke external tools: GitHub, Slack, databases, etc.
! Shell Commands!bash-commandDirect executionβ€”Bypass AI processing; directly run terminal commands
\n\n

Command Priority (when names conflict): Enterprise-level > Personal-level > Project-level > Built-in

\n\n

Skills vs Commands: Both are triggered with /, but Skills (under .claude/skills/) are the new-generation format, supporting multi-file organization, Claude auto-triggering, and richer frontmatter control. Commands (under .claude/commands/) are the legacy format, still fully compatible; new projects are recommended to use Skills directly.

\n\n
\n\n

1. Common Built-in Slash Commands

\n\n

Built-in commands are core features bundled with Claude Codeβ€”just type them to use. Beginners should prioritize mastering these high-frequency categories:

\n\n

Basic Operation Commands

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandPurposeBeginner Example
/helpView all available commands and descriptions (including MCP commands)Enter /help to quickly check the command list
/exitExit the current interactive sessionWhen you don’t want to continue chatting, type /exit to leave directly
/clearClear current conversation historySession too messy? Use /clear to wipe everything in one go
\n\n

For example, using the /help command to view help information: Tab key toggles menus, Esc exits:

\n\n

Image 2

\n\n

Session Management Commands

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/clear/clearClear all conversation history and start a fresh session/clearIrreversible; recommend running /export first
/compact/compact Intelligently compresses conversation history, preserving semantics while reducing token usage/compact Keep the database design sectionDiffers from /clear: retains semantic summary instead of full deletion
/resume/resume Resume a past session; without arguments, lists all resumable sessions/resume task-hub-backendWorks best with /rename
/rewind/rewindUndo recent operations (including file edits and conversation content), reverting to the last checkpoint; new version adds "Revert Code Only" option to preserve conversation historyPress Esc twice to open the rewind menuUseful when dissatisfied with Agent execution results
/rename/rename <name>Name the current session for easier retrieval via /resume later/rename auth-module-refactorRecommended naming convention: feature-operation
/export/export Export conversation to a file; without filename, copy to clipboard/export debug-session.mdSupports Markdown format
/copy NEW/copyCopy Claude’s most recent reply to clipboard; if multiple code blocks exist, an interactive selector appears/copyMuch faster than manually selecting text
/btw NEW/btw <question>Quickly ask a temporary question without affecting the main task context; answer does not pollute the main conversation flow/btw Redis What is the default port for ?Useful for quick reference without disrupting current tasks
/exit/exitSafely exit Claude Code REPL/exitβ€”
\n\n

Context & Memory

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/context/contextVisualize context window usage, showing proportions of history/files/system prompt/Skills/contextRun /compact or /clear when approaching the limit
/memory/memoryOpen editor to modify CLAUDE.md (project-level and global), enabling persistent project conventions across sessions/memoryChanges apply to all subsequent sessions
/add-dir/add-dir <path>Add extra directories to the working scope, ideal for monorepos or cross-directory operations/add-dir ../packages/sharedCan be called multiple times to add multiple directories
/todos/todosList TODO items recorded by Claude in the current session/todosβ€”
/diff NEW/diffView a diff summary of all file changes made during this session, helping review what Claude modified/diffUse with /rewind: first /diff to confirm changes, then decide whether to roll back
\n\n

Project & Configuration

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/init/initAnalyze project structure and auto-generate CLAUDE.md with tech stack, build commands, and code conventions/initEssential first step for new projects
/config/configManage Claude Code global configuration via interactive UI/configβ€”
/status/statusOpen settings status page to view current configuration overview/statusβ€”
/hooks/hooksInteractively configure lifecycle hooks (e.g., pre-commit lint, post-save formatting)/hooksSupports PreToolUse / PostToolUse / Notification / Stop
/permissions/permissionsView or update tool permissions (read/write files, execute commands, etc.)/permissionsRestricting permissions enhances operational security
/sandbox/sandboxEnable isolated sandbox environment for Bash commands to avoid affecting the host system/sandboxUseful for testing uncertain scripts
/doctor/doctorDiagnose installation status: check dependencies, configuration, and network connectivity/doctorRun first when encountering anomalies
\n\n

Model & Output

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/model/model Switch underlying AI model; without arguments, shows interactive selection menu/model claude-haiku-4-5-20251001See model reference table below
/plan/plan Enter planning mode: Claude outputs an execution plan for confirmation before proceeding/plan Refactor the authentication module and add testsRecommended for complex, multi-step tasks to avoid deviation
/output-style/output-styleSet response format (code-first, explanation-first, concise mode, etc.)/output-styleβ€”
/theme/themeSwitch terminal color scheme/themeβ€”
/statusline/statuslineCustomize terminal bottom status bar content/statuslineβ€”
/vim/vimEnable Vim keybindings/vimRecommended for Vim users
/terminal-setup/terminal-setupInstall Shift+Enter line-break binding for multi-line prompt input/terminal-setupRecommended configuration on first use
\n\n

Available Models (2026):

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Model IdentifierPositioningUse Cases
claude-sonnet-4-6Balanced (default)General development tasks; preferred for Pro/Max5 users
claude-haiku-4-5-20251001Fast & lightweightSimple queries, saving tokens in custom commands
claude-opus-4-6High-capability flagshipComplex architecture planning, challenging code reasoning; default for Max20 users
\n\n

Code & Tools

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/review/reviewPerform structured Code Review on recently modified code, outputting improvement suggestions by priority/reviewβ€”
/security-review/security-reviewConduct security-focused review of current changes (SQL injection, XSS, sensitive data leaks, etc.)/security-reviewEssential before deployment
/pr-comments/pr-commentsPull review comments for the current branch’s associated PR and handle them directly in the terminal/pr-commentsRequires GitHub integration setup
/install-github-app/install-github-appConfigure GitHub Actions integration for automatic Claude PR reviews/install-github-appGenerates .github/workflows/claude-code-review.yml
/agents/agentsView, create, and manage specialized sub-agents (e.g., DB expert, security expert, QA expert)/agentsβ€”
/bashes/bashesView currently running background Bash processes; interrupt or inspect output/bashesβ€”
/skills NEW/skillsList all available Skills (built-in + project-level + personal-level), including descriptions and trigger methods/skillsSome Skills may be excluded if context budget is insufficient; use this command to verify load status
\n\n

Integration & Extensions

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/mcp/mcpManage MCP server connections (connect/disconnect/view available tools)/mcpSee Section 7 for detailed MCP command explanation
/ide/ideConfigure integration with IDEs (e.g., VSCode, JetBrains)/ideβ€”
/plugin/plugin Manage Claude Code plugins: install, uninstall, update, browse marketplace/plugin install typescript-lspOfficial plugin marketplace includes 36 curated plugins
/teleport/teleportMigrate a session started on claude.ai to local terminal (cloud β†’ local direction)/teleportRequires GitHub App installation; supports only GitHub-hosted repositories
\n\n

/plugin Subcommands:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
SubcommandFunction
/plugin install <name>Install specified plugin
/plugin listList all installed plugins
/plugin updateUpdate all installed plugins
/plugin marketplaceBrowse official plugin marketplace
/plugin uninstall <name>Uninstall specified plugin
\n\n

Statistics & Account

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandSyntaxFunction DescriptionUsage ExampleNotes
/cost/costDisplay current session’s token consumption and estimated cost/costVisible to API billing users; subscription users have tokens included in plan
/usage/usageView current plan usage, remaining quota, and rate limit status/usageβ€”
/stats/statsDisplay historical usage data (daily tokens / session count) in charts/statsβ€”
/release-notes/release-notesView Claude Code’s latest version changelog/release-notesβ€”
/bug/bugPack current session context and submit a bug report to Anthropic/bugβ€”
/login/loginLogin or switch Anthropic account/loginUseful for developers with multiple accounts
/logout/logoutLogout current account/logoutβ€”
/privacy-settings/privacy-settingsManage data usage preferences (e.g., whether to allow conversations for model training)/privacy-settingsβ€”
/remote-env/remote-envConfigure environment variables for remote sessions/remote-envβ€”
\n\n
\n\n

2. Built-in Skills NEW

\n\n

Built-in Skills are pre-configured AI workflows bundled with Claude Code. Unlike built-in commands, they load detailed prompts and rely on Claude’s reasoning to produce richer analysis and operational resultsβ€”also triggered with /.

\n\n

Distinction: Built-in Commands vs Built-in Skills

\n\n
    \n
  • Built-in commands (e.g., /clear, /compact) execute fixed logic without AI reasoning and are extremely fast.
  • \n
  • Built-in Skills (e.g., /debug, /simplify) load prompts and rely on Claude’s reasoning to produce richer, more detailed outputsβ€”ideal for complex analysis tasks.
  • \n
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CommandFunction DescriptionUse Cases
/simplifySimplify specified code or text to improve readability and eliminate unnecessary complexityRefactoring overly verbose functions, simplifying over-engineered code
/debugSystematically analyze error messages or anomalous behavior to identify root causes and propose fixesLocating elusive bugs that are hard to reproduce
/batchExecute the same task across multiple files or targets in parallel (e.g., bulk rename, add type annotations)Large-scale repetitive code modifications
/loopRepeatedly execute an operation in a loop until an exit condition is met (e.g., retry tests until passing)Automating CI fix loops
/claude-apiQuickly generate example code for calling the Anthropic API, supporting specified models and task typesBuilding Claude API integration prototypes
\n\n
\n\n

3. Command Prefix Syntax

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PrefixSyntaxFunction DescriptionExampleComparison
//commandTrigger built-in commands, built-in Skills, or custom Skills/Commands/reviewβ€”
!!<bash-command>Directly execute shell commands, bypassing AI processing to save tokens!ls -laβ€”
← Claude Code Plugin RefClaude Code Cli Ref β†’