Master Claude Code like a pro. This is the complete guide to every slash command available in Claude Code what they do, when to use them, and how they'll speed up your workflow.


🎯 What Are Slash Commands?

Slash commands are shortcuts you type directly into Claude Code to trigger specific actions instantly. Instead of typing out full requests, you hit / and the command name.

They save time. They reduce friction. They make you faster.


πŸ“‹ All Built-In Slash Commands

1. /help

What it does: Shows usage help and available commands.

When to use it: You're new to Claude Code or forgot what a command does.

Why it helps: Instant reference without leaving your terminal.


2. /clear

What it does: Clears your entire conversation history.

When to use it: Starting fresh on a new task or the context is cluttered.

Why it helps: Clean slate = cleaner thinking. Removes old context that might confuse Claude.


3. /compact [instructions]

What it does: Compresses your conversation while keeping the important parts. You can add optional instructions to focus on specific topics.

When to use it: Long session, running low on context window, but don't want to lose progress.

Why it helps: Keeps your session alive without the bloat. Like hitting "summarize" on your entire conversation.

Example: /compact focus on the authentication code


4. /config

What it does: Opens the Settings interface.

When to use it: Need to adjust Claude Code preferences, themes, or behavior.

Why it helps: Quick access to all your configuration options in one place.


5. /context

What it does: Visualizes your current context usage as a colored grid.

When to use it: Want to see how much of your context window is being used.

Why it helps: Understand what's taking up space. Helps you decide when to /compact or /clear.


6. /cost

What it does: Shows token usage statistics for your session.

When to use it: Tracking your API usage or monitoring spend.

Why it helps: Stay on top of your costs. No surprises.


7. /doctor

What it does: Checks the health of your Claude Code installation.

When to use it: Something feels off or Claude Code is acting weird.

Why it helps: Diagnoses issues automatically so you don't have to troubleshoot manually.


8. /exit

What it does: Exits the Claude Code session.

When to use it: Done working and want to close cleanly.

Why it helps: Clean exit. Better than force-quitting.


9. /export [filename]

What it does: Exports your current conversation to a file or clipboard.

When to use it: Want to save the conversation for documentation, sharing, or reference.

Why it helps: Never lose a good session. Export it for later.

Example: /export project-notes.md


10. /init

What it does: Initializes your project with a CLAUDE.md guide file.

When to use it: Starting a new project and want Claude to understand your codebase.

Why it helps: Creates project memory. Claude remembers your conventions, patterns, and preferences across sessions.


11. /mcp

What it does: Manage MCP (Model Context Protocol) server connections and OAuth authentication.

When to use it: Connecting external tools, APIs, or services to Claude Code.

Why it helps: Extends Claude's capabilities with external integrations.


12. /memory

What it does: Edit your CLAUDE.md memory files directly.

When to use it: Need to update project instructions, conventions, or context.

Why it helps: Quick access to edit what Claude "remembers" about your project.


13. /model

What it does: Select or change the AI model you're using.

When to use it: Want to switch between different Claude models.

Why it helps: Use the right model for the task. Faster models for quick tasks, smarter models for complex ones.


14. /permissions

What it does: View or update what tools and actions Claude can use.

When to use it: Want to control what Claude can access or modify.

Why it helps: Security and control. Decide exactly what Claude can and can't do.


15. /plan

What it does: Enters plan mode directly from the prompt.

When to use it: Want Claude to plan before executing. Great for complex tasks.

Why it helps: Think before acting. Claude outlines the approach before making changes.


16. /rename <name>

What it does: Renames your current session.

When to use it: Want to organize or identify sessions by project or task.

Why it helps: Find sessions easily later. "auth-refactor" is better than "Session 47."

Example: /rename api-integration


17. /resume [session]

What it does: Resume a previous conversation by ID or name, or open the session picker.

When to use it: Picking up where you left off on a previous task.

Why it helps: Never lose progress. Jump back into any session instantly.


18. /rewind

What it does: Rewind the conversation and/or code changes to a previous state.

When to use it: Claude made changes you don't want, or you want to undo recent conversation.

Why it helps: Time travel for your code. Undo without Ctrl+Z spam.