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 namesgives/compactits 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,/tasksand/usage, run at once. - Not all for everyone. What appears depends on your system, plan and setup.
/desktopneeds a Mac or Windows on x64 and a Claude plan;/setup-bedrockappears 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:
| When | Command | What it is for |
|---|---|---|
| New repo | /init | Writes a first CLAUDE.md from your project |
| New repo | /permissions | Sets what Claude may do without asking |
| New repo | /mcp | Connects and checks your MCP servers |
| Before a big change | /plan | Plans first, no edits |
| Mid-task | /model | Switches model, Opus for hard problems |
| Mid-task | /context | Shows what is filling the context window |
| Mid-task | /compact | Summarizes to make room, keeping what you name |
| Went wrong | /rewind | Goes back to an earlier message, code included |
| Before you commit | /diff | Shows everything that changed |
| Between tasks | /clear | Starts an empty conversation |
| Next day | /resume | Reopens an earlier conversation |
| Any time | /usage | What 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.
113 commands
/clearContextStarts 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
/compactContextReplaces 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
/contextContextShows what is filling the context window as a coloured grid, with tips for what to trim. Add all to see every item.
/context
/autocompactContextSets 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
/btwContextAsks 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?
/rewindContextGoes 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
/recapContextWrites a one-line summary of the session so far.
/recap
/exportContextSaves the conversation as plain text, to a file you name or through a dialog that copies or saves it.
/export auth-refactor.txt
/copyContextCopies 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
/resumeSessionsReopens an earlier conversation by its name or id, or opens a list to pick from. Also /continue.
/resume oauth-migration
/renameSessionsNames the current session so you can find it later. With no name, it makes one up from the conversation.
/rename oauth-migration
/branchSessionsCopies 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
/forkSessionsCopies 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
/backgroundSessionsSends the whole session to the background to keep working, and frees your terminal. Watch it with claude agents. Also /bg.
/background
/stopSessionsStops the background session you are attached to. Its conversation and any worktree are kept.
/stop
/cdSessionsMoves this session to another folder and keeps the conversation.
/cd ../api
/add-dirSessionsLets 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
/teleportSessionsBrings a session that ran on the web into this terminal, with its branch and conversation. Needs a claude.ai plan. Also /tp.
/teleport
/remote-controlSessionsLets you carry on this session from claude.ai or the Claude phone app, while it keeps running on your machine. Also /rc.
/remote-control
/desktopSessionsMoves the session into the Claude desktop app. macOS or Windows on x64, with a Claude plan. Also /app.
/desktop
/exitSessionsLeaves Claude Code. In an attached background session it detaches and the session keeps running. Also /quit.
/exit
/planModelSwitches 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
/modelModelSwitches 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
/effortModelSets how much the model reasons before it answers, from low to max, or auto. status shows the current level.
/effort high
/fastModelTurns 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
/advisorModelTurns on a second model that the main one can ask for advice at hard moments in a task, or turns it off.
/advisor opus
/goalModelSets 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-styleModelLists the output styles or switches to one, which changes how Claude writes its answers.
/output-style explanatory
/diffReviewShows the changes in your working tree, including what Claude has edited so far.
/diff
/code-reviewReviewReviews 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-reviewReviewChecks the changes on your branch against the main branch for security problems such as injection, broken access checks and leaked data.
/security-review
/simplifyReviewHas 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
/ultrareviewReviewRuns 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
/verifyReviewChecks a change really works by building and running your app and watching the result, not only by running tests.
/verify
/runReviewStarts your app and drives it so you can see a change working.
/run
/run-skill-generatorReviewWrites a skill for your project that teaches /run and /verify how to build and start your app from scratch.
/run-skill-generator
/autofix-prReviewStarts 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
/batchParallelSplits 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
/subtaskParallelHands 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
/tasksParallelLists the background work in this session, including subagents and commands, finished or not. Also /bashes.
/tasks
/loopParallelRuns 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
/scheduleParallelCreates, 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-agentsParallelLists the subagents, teammates and other sessions Claude can send messages to. Also /peers.
/list-agents
/workflowsParallelShows running and finished workflows, which spread a job across many subagents, to watch, pause, resume or save.
/workflows
/deep-researchParallelRuns 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?
/initSetupReads your project and writes a starting CLAUDE.md with its commands and conventions.
/init
/memorySetupOpens your CLAUDE.md files to edit, and turns auto memory on or off and shows what it saved.
/memory
/permissionsSetupShows and edits your allow, ask and deny rules, and the folders Claude may work in. Also /allowed-tools.
/permissions
/fewer-permission-promptsSetupLooks through your past sessions for safe read-only commands you keep approving and adds them to the project's allow list.
/fewer-permission-prompts
/sandboxSetupTurns the sandbox on or off, which limits the files and websites shell commands can reach.
/sandbox
/auto-mode-setupSetupDrafts 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
/configSetupOpens the settings screen for theme, model, output style and more, or sets a value directly. Also /settings.
/config theme=dark
/update-configSetupChanges a settings file from a plain request, such as allowing a command or adding a hook.
/update-config allow npm run lint without asking
/importSetupBrings 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
/doctorSetupChecks your install, settings, extensions and CLAUDE.md for problems and offers fixes, which it applies after you confirm. Also /checkup.
/doctor
/terminal-setupSetupSets 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
/statuslineSetupSets 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
/keybindingsSetupOpens your keyboard shortcuts file to change keys.
/keybindings
/ideSetupConnects to your code editor and shows the connection.
/ide
/install-github-appSetupInstalls 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-appSetupInstalls the Claude app in Slack, through a sign-in in your browser.
/install-slack-app
/web-setupSetupConnects your GitHub account for cloud sessions, using the login of your local gh tool.
/web-setup
/remote-envSetupPicks the default cloud environment for cloud sessions you start from the terminal.
/remote-env
/chromeSetupChanges the settings for Claude in Chrome, which lets Claude use your browser.
/chrome
/setup-bedrockSetupWalks through signing in to Amazon Bedrock and choosing a region and models. Shows once CLAUDE_CODE_USE_BEDROCK=1 is set.
/setup-bedrock
/setup-vertexSetupWalks through signing in to Google Cloud and choosing a project, region and models. Shows once CLAUDE_CODE_USE_VERTEX=1 is set.
/setup-vertex
/mcpExtendLists 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
/skillsExtendLists 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-skillsExtendPicks up skills you added or changed on disk during the session, without restarting.
/reload-skills
/skill-doctorExtendShows what each skill costs in context and how often it is used, to find ones to turn off.
/skill-doctor
/agentsExtendReminds you how to create subagents - ask Claude, or edit the files in .claude/agents/ yourself.
/agents
/hooksExtendShows the hooks you have set up and where each comes from.
/hooks
/pluginExtendOpens the plugin menu, or lists, installs, enables or disables a plugin directly.
/plugin install code-review@claude-plugins-official
/reload-pluginsExtendReloads your plugins so changes apply without a restart.
/reload-plugins
/claude-apiExtendLoads 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-chromeExtendHas 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
/artifactsArtifactsLists your artifacts, the web pages Claude publishes on claude.ai, to attach one to the session, open it or copy its link.
/artifacts
/artifact-capabilitiesArtifactsLoads the reference for what a published artifact page can do, such as offering a file to download.
/artifact-capabilities
/artifact-diagrammingArtifactsLoads guidance for drawing clear diagrams in artifacts that work in light and dark themes.
/artifact-diagramming
/designArtifactsDrafts 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-syncArtifactsUploads your repo's React design system to Claude Design, so its designs use your real components.
/design-sync
/design-loginArtifactsSigns in with your claude.ai account so /design-sync can upload your design system.
/design-login
/slidesArtifactsMakes a slide deck from your brief as an artifact.
/slides a quarterly review of the platform team
/datavizArtifactsLoads guidance for charts and dashboards - the right chart for the data, colours that work for colour-blind readers, and accessible labels.
/dataviz
/usageAccountShows what the session has cost, how much of your plan's limits you have used, and activity stats. Also /cost and /stats.
/usage
/statusAccountShows the version, model, account and connection, including which login or API key is in use. Works while Claude is answering.
/status
/loginAccountSigns in to your Anthropic account, or switches account.
/login
/logoutAccountSigns out of your Anthropic account.
/logout
/rate-limit-optionsAccountShows your choices when a usage limit stops you - wait and carry on when it resets, add usage credits, or upgrade.
/rate-limit-options
/usage-creditsAccountSets up usage credits to keep working past your plan's limits, or asks your admin for them.
/usage-credits
/upgradeAccountOpens the page to move to a higher plan.
/upgrade
/privacy-settingsAccountShows and changes your privacy settings. Pro and Max only.
/privacy-settings
/passesAccountShares a free week of Claude Code with friends, if your account can.
/passes
/insightsAccountWrites a report on your recent sessions on this machine - the projects, how you work, where things go wrong, and features to try.
/insights
/team-onboardingAccountWrites 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
/helpHelpShows help and the commands you can use.
/help
/powerupHelpTeaches Claude Code's features through short interactive lessons.
/powerup
/release-notesHelpShows what changed in each version.
/release-notes
/debugHelpTurns 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
/bugHelpReports a bug, with as much of the session as you choose to include, after a consent screen. Also /share.
/bug
/feedbackHelpSends feedback about Claude Code, through the same dialog as /bug.
/feedback
/heapdumpHelpSaves 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
/themeInterfaceChanges the colour theme, including auto, colour-blind friendly themes and your own.
/theme
/colorInterfaceSets the colour of the prompt bar for this session, which helps tell sessions apart.
/color green
/tuiInterfaceSwitches between the default and the full-screen display, keeping the conversation.
/tui fullscreen
/focusInterfaceIn the full-screen display, shows only your last message, a one-line summary of the tools used and the final answer.
/focus
/scroll-speedInterfaceChanges how fast the mouse wheel scrolls in the full-screen display.
/scroll-speed
/voiceInterfaceTurns voice dictation on or off, holding a key to talk or tapping to start and stop.
/voice hold
/mobileInterfaceShows a QR code to download the Claude phone app. Also /ios and /android.
/mobile
/radioInterfaceOpens Claude FM, a lo-fi radio stream, in your browser.
/radio
/stickersInterfaceOrders 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