Skip to the page

Claude Code slash commands: every command explained

Slash commands control Claude Code from inside a session. Type / at the start of a message to see them, then a few letters to filter. The ones to learn first are /clear, /compact, /context, /model, /plan, /rewind, /resume, /diff, /init, /permissions, /mcp and /usage.

Daily use

Take this page into your AI

Open in ChatGPT (new tab)Open in Claude (new tab)

A slash command is an instruction to Claude Code itself, not to the model. /clear empties the conversation, /model changes the model, /rewind undoes. Type / at the start of a message and a menu opens; keep typing to filter it, and press Enter to run the highlighted one.

How commands work

  • Only at the start. A command is recognized only as the first thing in your message. Anything after its name is passed to it: /compact keep the test names gives /compact its instructions.
  • Arguments. Some commands take a value: /model opus, /effort high, /resume oauth-migration. With no value, most open a list to choose from.
  • While it works. Send a command while Claude is answering and it waits for the turn to end. A few, such as /status, /tasks and /usage, run at once.
  • Not all for everyone. What appears depends on your system, plan and setup. /desktop needs a Mac or Windows on x64 and a Claude plan; /setup-bedrock appears only once Bedrock is switched on.

Some entries are bundled skills rather than built-in commands. /simplify, /batch, /debug and /verify, for example, hand a prepared prompt to Claude, the same way your own skills do. They cost tokens like any other request.

The 12 to learn first

You do not need most of the list. These cover a normal day:

WhenCommandWhat it is for
New repo/initWrites a first CLAUDE.md from your project
New repo/permissionsSets what Claude may do without asking
New repo/mcpConnects and checks your MCP servers
Before a big change/planPlans first, no edits
Mid-task/modelSwitches model, Opus for hard problems
Mid-task/contextShows what is filling the context window
Mid-task/compactSummarizes to make room, keeping what you name
Went wrong/rewindGoes back to an earlier message, code included
Before you commit/diffShows everything that changed
Between tasks/clearStarts an empty conversation
Next day/resumeReopens an earlier conversation
Any time/usageWhat the session cost and how much of your plan is left

Add /code-review before you open a pull request, and /rewind becomes your undo button once you trust it.

Aliases

Many commands have a second name. /reset and /new are /clear; /cost and /stats open /usage; /review is /code-review; /undo and /checkpoint are /rewind; /continue is /resume. The finder below matches both, since aliases are listed under each command.

Your own commands

Every skill you write becomes a command. A folder in .claude/skills/ with a SKILL.md inside is run with a slash and the folder's name, so .claude/skills/release-notes/SKILL.md is /release-notes. Older custom commands in .claude/commands/ still work. Commands can also come from plugins, and an MCP server can offer its prompts as commands.

Every command

Search by name or by what you want to do, such as "undo" or "cost", and narrow by group. Each row has an example to copy.

Show

113 commands

  • /clearContext

    Starts a new conversation with an empty context window. Your files, CLAUDE.md and memory stay. Pass a name to label the old conversation so you can find it in /resume. Also /reset and /new.

    /clear

  • /compactContext

    Replaces the conversation so far with a summary to free room in the context window. Add instructions to say what the summary must keep.

    /compact keep the list of files changed and the test commands

  • /contextContext

    Shows what is filling the context window as a coloured grid, with tips for what to trim. Add all to see every item.

    /context

  • /autocompactContext

    Sets how full the context window gets before Claude Code compacts on its own, as a size such as 500k, or auto for the default for your model.

    /autocompact 400k

  • /btwContext

    Asks a side question about the session without adding it to the conversation, so it costs no room in later turns.

    /btw which file had the retry setting again?

  • /rewindContext

    Goes back to one of your earlier messages and restores the code, the conversation or both, or summarizes part of the conversation. Same as pressing Esc twice on an empty prompt. Also /checkpoint and /undo.

    /rewind

  • /recapContext

    Writes a one-line summary of the session so far.

    /recap

  • /exportContext

    Saves the conversation as plain text, to a file you name or through a dialog that copies or saves it.

    /export auth-refactor.txt

  • /copyContext

    Copies the last answer to the clipboard. Add a number for an older answer. When the answer has code blocks, you can pick one, or press w to write it to a file.

    /copy 2

  • /resumeSessions

    Reopens an earlier conversation by its name or id, or opens a list to pick from. Also /continue.

    /resume oauth-migration

  • /renameSessions

    Names the current session so you can find it later. With no name, it makes one up from the conversation.

    /rename oauth-migration

  • /branchSessions

    Copies the conversation at this point into a new branch and switches you to it, so you can try another approach. The original stays, and /resume takes you back.

    /branch try-redis-cache

  • /forkSessions

    Copies the conversation into a new background session that works on its own, while you carry on here.

    /fork write the migration for the new column

  • /backgroundSessions

    Sends the whole session to the background to keep working, and frees your terminal. Watch it with claude agents. Also /bg.

    /background

  • /stopSessions

    Stops the background session you are attached to. Its conversation and any worktree are kept.

    /stop

  • /cdSessions

    Moves this session to another folder and keeps the conversation.

    /cd ../api

  • /add-dirSessions

    Lets Claude read and edit files in another folder as well, for this session. Most of that folder's .claude settings are not picked up.

    /add-dir ../shared-lib

  • /teleportSessions

    Brings a session that ran on the web into this terminal, with its branch and conversation. Needs a claude.ai plan. Also /tp.

    /teleport

  • /remote-controlSessions

    Lets you carry on this session from claude.ai or the Claude phone app, while it keeps running on your machine. Also /rc.

    /remote-control

  • /desktopSessions

    Moves the session into the Claude desktop app. macOS or Windows on x64, with a Claude plan. Also /app.

    /desktop

  • /exitSessions

    Leaves Claude Code. In an attached background session it detaches and the session keeps running. Also /quit.

    /exit

  • /planModel

    Switches to plan mode, where Claude reads and proposes a plan without editing your files. Add a task to start on it at once.

    /plan add rate limiting to the public API

  • /modelModel

    Switches the model and saves it as your default. With no name, opens a list; press s on a row to switch for this session only.

    /model opus

  • /effortModel

    Sets how much the model reasons before it answers, from low to max, or auto. status shows the current level.

    /effort high

  • /fastModel

    Turns fast mode on or off, which runs Opus faster at a higher price per token. On a Claude plan it is paid from usage credits, not your plan's limits.

    /fast on

  • /advisorModel

    Turns on a second model that the main one can ask for advice at hard moments in a task, or turns it off.

    /advisor opus

  • /goalModel

    Sets a condition Claude keeps working towards across turns, such as all tests passing. A separate check runs after each turn. clear removes it.

    /goal npm test passes with no failures

  • /output-styleModel

    Lists the output styles or switches to one, which changes how Claude writes its answers.

    /output-style explanatory

  • /diffReview

    Shows the changes in your working tree, including what Claude has edited so far.

    /diff

  • /code-reviewReview

    Reviews the current changes, or a pull request, branch or path you name, for bugs. Add a level from low to max, --fix to apply the findings, or ultra for a deeper review in the cloud. Also /review.

    /code-review high --fix

  • /security-reviewReview

    Checks the changes on your branch against the main branch for security problems such as injection, broken access checks and leaked data.

    /security-review

  • /simplifyReview

    Has 4 reviewers look at the changed code for reuse, simplicity, efficiency and the right level of abstraction, then applies the fixes. It does not look for bugs.

    /simplify

  • /ultrareviewReview

    Runs a deep code review with several agents in a cloud sandbox. The same as /code-review ultra. A few free runs on Pro and Max, then paid.

    /ultrareview 1234

  • /verifyReview

    Checks a change really works by building and running your app and watching the result, not only by running tests.

    /verify

  • /runReview

    Starts your app and drives it so you can see a change working.

    /run

  • /run-skill-generatorReview

    Writes a skill for your project that teaches /run and /verify how to build and start your app from scratch.

    /run-skill-generator

  • /autofix-prReview

    Starts a cloud session that watches your branch's pull request and pushes fixes when CI fails or a reviewer comments. Needs the gh tool.

    /autofix-pr only fix lint and type errors

  • /batchParallel

    Splits a large change into 5 to 30 independent parts and, once you approve the plan, runs each in its own subagent and worktree.

    /batch migrate src/ from JavaScript to TypeScript

  • /subtaskParallel

    Hands a side task to a subagent that starts with a copy of the conversation and reports back here when done.

    /subtask find every caller of parseDate

  • /tasksParallel

    Lists the background work in this session, including subagents and commands, finished or not. Also /bashes.

    /tasks

  • /loopParallel

    Runs a prompt again and again while the session is open, at an interval you set or one Claude chooses. Also /proactive.

    /loop 5m check whether the deploy finished

  • /scheduleParallel

    Creates, changes, lists or runs routines, prompts that run on a schedule in the cloud. Also /routines.

    /schedule every weekday at 9 summarize new issues

  • /list-agentsParallel

    Lists the subagents, teammates and other sessions Claude can send messages to. Also /peers.

    /list-agents

  • /workflowsParallel

    Shows running and finished workflows, which spread a job across many subagents, to watch, pause, resume or save.

    /workflows

  • /deep-researchParallel

    Runs many web searches on a question, reads and cross-checks the sources, and writes a report with citations.

    /deep-research how do other CLIs store login tokens?

  • /initSetup

    Reads your project and writes a starting CLAUDE.md with its commands and conventions.

    /init

  • /memorySetup

    Opens your CLAUDE.md files to edit, and turns auto memory on or off and shows what it saved.

    /memory

  • /permissionsSetup

    Shows and edits your allow, ask and deny rules, and the folders Claude may work in. Also /allowed-tools.

    /permissions

  • /fewer-permission-promptsSetup

    Looks through your past sessions for safe read-only commands you keep approving and adds them to the project's allow list.

    /fewer-permission-prompts

  • /sandboxSetup

    Turns the sandbox on or off, which limits the files and websites shell commands can reach.

    /sandbox

  • /auto-mode-setupSetup

    Drafts a description of your environment for auto mode's safety check from your project and recent sessions, for you to review and save.

    /auto-mode-setup

  • /configSetup

    Opens the settings screen for theme, model, output style and more, or sets a value directly. Also /settings.

    /config theme=dark

  • /update-configSetup

    Changes a settings file from a plain request, such as allowing a command or adding a hook.

    /update-config allow npm run lint without asking

  • /importSetup

    Brings instruction files, MCP servers, commands and skills over from OpenAI Codex, Gemini CLI or Cursor on your machine. --dry-run previews.

    /import codex --dry-run

  • /doctorSetup

    Checks your install, settings, extensions and CLAUDE.md for problems and offers fixes, which it applies after you confirm. Also /checkup.

    /doctor

  • /terminal-setupSetup

    Sets up Shift+Enter for new lines in VS Code, Cursor, Alacritty or Zed, and fixes the equivalent settings in Apple Terminal and iTerm2.

    /terminal-setup

  • /statuslineSetup

    Sets up the status line under the prompt. Describe what you want shown, or run it bare to copy your shell prompt.

    /statusline show the branch and context used

  • /keybindingsSetup

    Opens your keyboard shortcuts file to change keys.

    /keybindings

  • /ideSetup

    Connects to your code editor and shows the connection.

    /ide

  • /install-github-appSetup

    Installs the Claude GitHub app on a repository and can set up the GitHub Actions workflow and its secret. github.com only.

    /install-github-app

  • /install-slack-appSetup

    Installs the Claude app in Slack, through a sign-in in your browser.

    /install-slack-app

  • /web-setupSetup

    Connects your GitHub account for cloud sessions, using the login of your local gh tool.

    /web-setup

  • /remote-envSetup

    Picks the default cloud environment for cloud sessions you start from the terminal.

    /remote-env

  • /chromeSetup

    Changes the settings for Claude in Chrome, which lets Claude use your browser.

    /chrome

  • /setup-bedrockSetup

    Walks through signing in to Amazon Bedrock and choosing a region and models. Shows once CLAUDE_CODE_USE_BEDROCK=1 is set.

    /setup-bedrock

  • /setup-vertexSetup

    Walks through signing in to Google Cloud and choosing a project, region and models. Shows once CLAUDE_CODE_USE_VERTEX=1 is set.

    /setup-vertex

  • /mcpExtend

    Lists your MCP servers and their status, signs in to the ones that need it, and reconnects, turns on or turns off a server.

    /mcp reconnect github

  • /skillsExtend

    Lists your skills, with what each costs in context. Press t to sort by size, and Space to hide a skill from Claude or from the menu.

    /skills

  • /reload-skillsExtend

    Picks up skills you added or changed on disk during the session, without restarting.

    /reload-skills

  • /skill-doctorExtend

    Shows what each skill costs in context and how often it is used, to find ones to turn off.

    /skill-doctor

  • /agentsExtend

    Reminds you how to create subagents - ask Claude, or edit the files in .claude/agents/ yourself.

    /agents

  • /hooksExtend

    Shows the hooks you have set up and where each comes from.

    /hooks

  • /pluginExtend

    Opens the plugin menu, or lists, installs, enables or disables a plugin directly.

    /plugin install code-review@claude-plugins-official

  • /reload-pluginsExtend

    Reloads your plugins so changes apply without a restart.

    /reload-plugins

  • /plugin-authoringExtend

    Loads the reference Claude follows to write a plugin for you.

    /plugin-authoring

  • /workflow-authoringExtend

    Loads the reference for writing workflow scripts that spread a job across many subagents.

    /workflow-authoring

  • /claude-apiExtend

    Loads reference material for building on the Claude API in your project's language, with tasks such as migrate, cost-optimize and build-eval.

    /claude-api cost-optimize

  • /claude-in-chromeExtend

    Has Claude do a task in your browser, such as testing a page or reading its console, through Claude in Chrome.

    /claude-in-chrome check the signup form on localhost:3000

  • /artifactsArtifacts

    Lists your artifacts, the web pages Claude publishes on claude.ai, to attach one to the session, open it or copy its link.

    /artifacts

  • /artifact-capabilitiesArtifacts

    Loads the reference for what a published artifact page can do, such as offering a file to download.

    /artifact-capabilities

  • /artifact-diagrammingArtifacts

    Loads guidance for drawing clear diagrams in artifacts that work in light and dark themes.

    /artifact-diagramming

  • /designArtifacts

    Drafts screens, flows, landing pages or posters as artboards on a canvas you can edit in the browser and export.

    /design a settings screen for a banking app

  • /design-syncArtifacts

    Uploads your repo's React design system to Claude Design, so its designs use your real components.

    /design-sync

  • /design-loginArtifacts

    Signs in with your claude.ai account so /design-sync can upload your design system.

    /design-login

  • /slidesArtifacts

    Makes a slide deck from your brief as an artifact.

    /slides a quarterly review of the platform team

  • /datavizArtifacts

    Loads guidance for charts and dashboards - the right chart for the data, colours that work for colour-blind readers, and accessible labels.

    /dataviz

  • /usageAccount

    Shows what the session has cost, how much of your plan's limits you have used, and activity stats. Also /cost and /stats.

    /usage

  • /statusAccount

    Shows the version, model, account and connection, including which login or API key is in use. Works while Claude is answering.

    /status

  • /loginAccount

    Signs in to your Anthropic account, or switches account.

    /login

  • /logoutAccount

    Signs out of your Anthropic account.

    /logout

  • /rate-limit-optionsAccount

    Shows your choices when a usage limit stops you - wait and carry on when it resets, add usage credits, or upgrade.

    /rate-limit-options

  • /usage-creditsAccount

    Sets up usage credits to keep working past your plan's limits, or asks your admin for them.

    /usage-credits

  • /upgradeAccount

    Opens the page to move to a higher plan.

    /upgrade

  • /privacy-settingsAccount

    Shows and changes your privacy settings. Pro and Max only.

    /privacy-settings

  • /passesAccount

    Shares a free week of Claude Code with friends, if your account can.

    /passes

  • /insightsAccount

    Writes a report on your recent sessions on this machine - the projects, how you work, where things go wrong, and features to try.

    /insights

  • /team-onboardingAccount

    Writes a guide for a teammate from how you have used Claude Code in the last 30 days, to paste as their first message.

    /team-onboarding

  • /helpHelp

    Shows help and the commands you can use.

    /help

  • /powerupHelp

    Teaches Claude Code's features through short interactive lessons.

    /powerup

  • /release-notesHelp

    Shows what changed in each version.

    /release-notes

  • /debugHelp

    Turns on debug logging for the session and reads the log to find a problem. Describe the problem to focus it.

    /debug MCP server keeps disconnecting

  • /bugHelp

    Reports a bug, with as much of the session as you choose to include, after a consent screen. Also /share.

    /bug

  • /feedbackHelp

    Sends feedback about Claude Code, through the same dialog as /bug.

    /feedback

  • /heapdumpHelp

    Saves a memory snapshot to find out why Claude Code is using a lot of memory. Share only the diagnostics file, since the snapshot holds your conversation and credentials. Not shown in the menu; type it in full.

    /heapdump

  • /themeInterface

    Changes the colour theme, including auto, colour-blind friendly themes and your own.

    /theme

  • /colorInterface

    Sets the colour of the prompt bar for this session, which helps tell sessions apart.

    /color green

  • /tuiInterface

    Switches between the default and the full-screen display, keeping the conversation.

    /tui fullscreen

  • /focusInterface

    In the full-screen display, shows only your last message, a one-line summary of the tools used and the final answer.

    /focus

  • /scroll-speedInterface

    Changes how fast the mouse wheel scrolls in the full-screen display.

    /scroll-speed

  • /voiceInterface

    Turns voice dictation on or off, holding a key to talk or tapping to start and stop.

    /voice hold

  • /mobileInterface

    Shows a QR code to download the Claude phone app. Also /ios and /android.

    /mobile

  • /radioInterface

    Opens Claude FM, a lo-fi radio stream, in your browser.

    /radio

  • /stickersInterface

    Orders Claude Code stickers.

    /stickers

Questions

What is the difference between /clear and /compact?
/clear starts a new, empty conversation; the old one is saved and /resume brings it back. /compact keeps the same conversation but replaces it with a summary, so the work continues with more room. Use /clear when you change task and /compact when you are halfway through a long one.
How do I make my own slash command?
Write a skill. A folder in .claude/skills/ with a SKILL.md file becomes a command named after the folder, so .claude/skills/release-notes/SKILL.md is /release-notes. Files in the older .claude/commands/ folder still work the same way.
Why does a command from this list not show up for me?
Some commands depend on your system, plan or setup. /desktop needs macOS or x64 Windows and a Claude plan, /upgrade is not shown on Enterprise plans, and a few, such as /heapdump, are hidden until you type the full name.
Can I run a slash command while Claude is working?
Yes. Most commands wait until the current turn ends and then run. A few, such as /status, /tasks and /usage, run at once without interrupting it.

Sources

Where each fact comes from

  1. 1Commands
  2. 2Extend Claude with skills