You opened Claude Code and typed / — and a list of commands appeared. Now you’re wondering what half of them actually do, when you’d use them, and whether you’re missing something useful.
This is that reference. Every built-in slash command, explained in plain English, with real examples of when each one matters.
📋 TL;DR
– Claude Code ships with built-in slash commands you can use immediately — no setup required
– They handle core tasks: clearing context, getting help, managing memory, and controlling how Claude responds
– Some commands are session-level (affect the current conversation); others are persistent (affect future sessions)
– Knowing these commands saves you time and helps you manage Claude Code’s context window effectively
– Custom commands you build yourself work differently — this article covers only the built-in ones
This is part of our complete Claude Code Slash Commands & Skills — Full Guide. If you’re not sure what slash commands are yet, read What Are Slash Commands in Claude Code? first.
What “Built-in” Means
Built-in slash commands are commands that Anthropic ships with Claude Code. They’re available the moment you install Claude Code — no files to create, no folders to set up.
They’re different from custom commands, which you write yourself and store in .claude/commands/. Built-in commands are baked into the Claude Code application itself.
Think of built-in commands as the factory settings on your phone. They work out of the box, and you use them to control how the device behaves — not to add new features.
The Complete Built-in Slash Command Reference
/help
What it does: Displays a list of available commands and a brief description of each one.
When to use it: Anytime you forget a command name or want to see what’s available. It’s your in-app cheat sheet.
# How to call the help command
/help
/help also shows any custom commands you’ve created, so it becomes more useful the more you build out your workflow.
/clear
What it does: Clears the entire conversation history from Claude’s context. Claude starts fresh, as if you just opened a new session.
When to use it: When you’re switching tasks and don’t want Claude to confuse context from the previous task. Also useful when the conversation has gotten long and you want a clean slate.
# How to clear the conversation context
/clear
⚠️ Warning:
/clearis permanent within that session. Claude will not remember anything from before the clear. If you need to preserve something, copy it out first.
This command becomes important once you understand how Claude Code reads and processes context. The How Claude Code Reads Your Codebase article covers how context works in more depth.
/compact
What it does: Summarizes the current conversation and replaces the full history with a compressed version. Claude keeps the key information but uses far fewer tokens to store it.
When to use it: When you’ve been working in a session for a while and notice Claude’s responses getting slower or less precise. Long conversations eat into the context window — the maximum amount of text Claude can hold in memory at once. /compact buys you more room.
# How to compress a long conversation to save context space
/compact
You can also give /compact a custom summary instruction:
# How to compact with a specific focus — only keep the relevant parts
/compact Focus only on the authentication module discussion
💡 Pro Tip: Use
/compactproactively on long sessions rather than waiting until things break down. Once Claude starts losing track of earlier context, compacting helps — but compacting before that point keeps the session sharp.
The difference between /clear and /compact:
/clear— wipes everything, truly fresh start/compact— summarizes and compresses, keeps the gist
/memory
What it does: Opens Claude’s memory file so you can view and edit what Claude “remembers” about your project across sessions.
When to use it: When you want to check what Claude has saved about your project, update a preference, or remove something that’s no longer accurate.
# How to open and edit Claude's memory file
/memory
What is Claude’s memory? Claude Code can store persistent notes about your project in a special file called CLAUDE.md. These notes carry over between sessions, so Claude doesn’t start from zero every time. /memory is the shortcut to view and edit that file directly.
If you haven’t set up a CLAUDE.md file yet, What is CLAUDE.md? (And Why You Need One) is the place to start.
/config
What it does: Opens the Claude Code configuration settings, where you can adjust behavior like how Claude formats responses, which model it uses, and other preferences.
When to use it: When you want to change Claude Code’s default behavior — for example, switching models or toggling certain output options.
# How to open Claude Code's configuration settings
/config
Configuration changes made here persist across sessions. This is different from one-off instructions you give Claude during a conversation.
/cost
What it does: Shows how many tokens the current session has used and the estimated cost.
When to use it: When you’re managing API usage, tracking costs on a project, or just curious how much a long session consumed.
# How to check token usage and cost for the current session
/cost
If you’re on a plan with usage limits, checking /cost periodically helps you avoid surprises. If you’re using the API directly, it’s how you track spend.
/status
What it does: Shows the current status of Claude Code — things like which model is active, current context usage, and whether any tools are enabled.
When to use it: When something feels off and you want to quickly check what state Claude Code is in. Think of it as a dashboard for your current session.
# How to check the current Claude Code session status
/status
/review
What it does: Triggers a code review of the current file or selection.
When to use it: When you want Claude to look at your code critically and flag issues. This is a fast way to get a second pair of eyes without writing a custom prompt.
# How to trigger a built-in code review
/review
💡 Pro Tip: The built-in
/reviewis a solid starting point, but many developers end up creating a custom/reviewcommand tailored to their specific standards and team conventions. Creating a Code Review Slash Command (Tutorial) shows you exactly how to do that.
/pr_comments
What it does: Fetches and displays comments from a pull request, so Claude can use them as context for making changes.
When to use it: When you’re working through PR feedback and want Claude to understand what reviewers asked for before you start making edits.
# How to pull in PR comments as context for Claude
/pr_comments
This command requires that Claude Code has access to your git environment and the relevant repository.
/init
What it does: Initializes Claude Code in a project — creates the .claude/ directory structure and a starter CLAUDE.md file if one doesn’t exist.
When to use it: When you’re setting up Claude Code in a new project for the first time.
# How to initialize Claude Code in a new project
/init
Running /init is usually the first thing you do in a brand new project. It sets up the folder structure that slash commands and skills depend on.
⚠️ Warning: If you run
/initin a project that already has a.claude/folder, it won’t overwrite your existing files — but double-check before running it in a mature project just to be safe.
/vim
What it does: Switches Claude Code’s input mode to Vim keybindings, so you can navigate and edit prompts using Vim-style keyboard shortcuts.
When to use it: If you’re a Vim user and find yourself fighting the default input behavior, /vim makes the prompt feel natural.
# How to enable Vim input mode in Claude Code
/vim
This is purely a personal preference setting. If you’ve never used Vim, skip this one entirely.
Quick Reference Table
| Command | What It Does | Affects |
|---|---|---|
| `/help` | Lists all available commands | Current session |
| `/clear` | Wipes conversation history | Current session |
| `/compact` | Compresses conversation to save context | Current session |
| `/memory` | View/edit Claude’s persistent memory | Across sessions |
| `/config` | Open Claude Code settings | Across sessions |
| `/cost` | Show token usage and estimated cost | Current session |
| `/status` | Show current session status | Current session |
| `/review` | Trigger a code review | Current task |
| `/pr_comments` | Pull in PR review comments as context | Current task |
| `/init` | Initialize Claude Code in a new project | Project setup |
| `/vim` | Enable Vim keybindings for input | Current session |
The Commands You’ll Use Most
In practice, most Claude Code users rely heavily on four commands:
/clear — between distinct tasks
/compact — on long sessions before context degrades
/memory — when your project setup changes
/help — when you forget something
The others are situational. You’ll reach for /cost if you’re tracking spend, /init when setting up a new project, and /vim only if you’re a Vim devotee.
Common Mistakes
Using /clear when you meant /compact
/clear wipes everything. /compact summarizes and keeps the key context. If you still need Claude to remember the work you’ve done in this session, use /compact — not /clear.
Forgetting /init in new projects
If your custom slash commands aren’t working in a new project, the most common reason is a missing .claude/ folder. Run /init and the structure gets created for you.
Expecting /memory to be automatic
Claude doesn’t update CLAUDE.md on its own unless you ask it to. Use /memory to check what’s actually stored there — don’t assume it has the right information just because you mentioned something earlier.
Ignoring /compact until it’s too late
Long sessions gradually degrade. Claude starts losing track of things said earlier, gives incomplete answers, or forgets project conventions. Running /compact early prevents this. Waiting until things break means you may have lost important context.
Treating built-in commands as unchangeable
You can create a custom /review command that overrides the built-in behavior with your own instructions. Custom commands take precedence when there’s a name collision. This is actually a feature — use it.
Key Takeaways
- Claude Code’s built-in slash commands work immediately with no setup — they’re baked into the application
/clearand/compactboth manage conversation history, but/compactkeeps a summary while/clearwipes everything/memoryis your window intoCLAUDE.md— Claude’s persistent project memory/initsets up the.claude/folder structure every new project needs- The commands you’ll use daily are
/clear,/compact,/memory, and/help
Next Steps
- Build your own commands:** How to Create Your First Custom Slash Command
- See real examples:** Slash Command Examples You Can Use Today
- Understand where to store them:** Where to Store Slash Commands (Project vs Global)
Return to Claude Code Slash Commands & Skills — Full Guide for the full picture.