# 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.

- Page: https://tecyfy.com/coding-agents/claude-code/commands
- Guide: Claude Code (https://tecyfy.com/coding-agents/claude-code), from Anthropic's documentation (https://code.claude.com/docs/en/overview)

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](/coding-agents/claude-code/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](/coding-agents/claude-code/plugins), and an [MCP server](/coding-agents/claude-code/mcp) 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.

| Command | Group | What it does |
| --- | --- | --- |
| `/clear` | Context | 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. Example: `/clear` |
| `/compact` | Context | Replaces the conversation so far with a summary to free room in the context window. Add instructions to say what the summary must keep. Example: `/compact keep the list of files changed and the test commands` |
| `/context` | Context | Shows what is filling the context window as a coloured grid, with tips for what to trim. Add all to see every item. Example: `/context` |
| `/autocompact` | Context | 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. Example: `/autocompact 400k` |
| `/btw` | Context | Asks a side question about the session without adding it to the conversation, so it costs no room in later turns. Example: `/btw which file had the retry setting again?` |
| `/rewind` | Context | 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. Example: `/rewind` |
| `/recap` | Context | Writes a one-line summary of the session so far. Example: `/recap` |
| `/export` | Context | Saves the conversation as plain text, to a file you name or through a dialog that copies or saves it. Example: `/export auth-refactor.txt` |
| `/copy` | Context | 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. Example: `/copy 2` |
| `/resume` | Sessions | Reopens an earlier conversation by its name or id, or opens a list to pick from. Also /continue. Example: `/resume oauth-migration` |
| `/rename` | Sessions | Names the current session so you can find it later. With no name, it makes one up from the conversation. Example: `/rename oauth-migration` |
| `/branch` | Sessions | 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. Example: `/branch try-redis-cache` |
| `/fork` | Sessions | Copies the conversation into a new background session that works on its own, while you carry on here. Example: `/fork write the migration for the new column` |
| `/background` | Sessions | Sends the whole session to the background to keep working, and frees your terminal. Watch it with claude agents. Also /bg. Example: `/background` |
| `/stop` | Sessions | Stops the background session you are attached to. Its conversation and any worktree are kept. Example: `/stop` |
| `/cd` | Sessions | Moves this session to another folder and keeps the conversation. Example: `/cd ../api` |
| `/add-dir` | Sessions | 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. Example: `/add-dir ../shared-lib` |
| `/teleport` | Sessions | Brings a session that ran on the web into this terminal, with its branch and conversation. Needs a claude.ai plan. Also /tp. Example: `/teleport` |
| `/remote-control` | Sessions | Lets you carry on this session from claude.ai or the Claude phone app, while it keeps running on your machine. Also /rc. Example: `/remote-control` |
| `/desktop` | Sessions | Moves the session into the Claude desktop app. macOS or Windows on x64, with a Claude plan. Also /app. Example: `/desktop` |
| `/exit` | Sessions | Leaves Claude Code. In an attached background session it detaches and the session keeps running. Also /quit. Example: `/exit` |
| `/plan` | Model | Switches to plan mode, where Claude reads and proposes a plan without editing your files. Add a task to start on it at once. Example: `/plan add rate limiting to the public API` |
| `/model` | Model | 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. Example: `/model opus` |
| `/effort` | Model | Sets how much the model reasons before it answers, from low to max, or auto. status shows the current level. Example: `/effort high` |
| `/fast` | Model | 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. Example: `/fast on` |
| `/advisor` | Model | Turns on a second model that the main one can ask for advice at hard moments in a task, or turns it off. Example: `/advisor opus` |
| `/goal` | Model | Sets a condition Claude keeps working towards across turns, such as all tests passing. A separate check runs after each turn. clear removes it. Example: `/goal npm test passes with no failures` |
| `/output-style` | Model | Lists the output styles or switches to one, which changes how Claude writes its answers. Example: `/output-style explanatory` |
| `/diff` | Review | Shows the changes in your working tree, including what Claude has edited so far. Example: `/diff` |
| `/code-review` | Review | 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. Example: `/code-review high --fix` |
| `/security-review` | Review | Checks the changes on your branch against the main branch for security problems such as injection, broken access checks and leaked data. Example: `/security-review` |
| `/simplify` | Review | 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. Example: `/simplify` |
| `/ultrareview` | Review | 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. Example: `/ultrareview 1234` |
| `/verify` | Review | Checks a change really works by building and running your app and watching the result, not only by running tests. Example: `/verify` |
| `/run` | Review | Starts your app and drives it so you can see a change working. Example: `/run` |
| `/run-skill-generator` | Review | Writes a skill for your project that teaches /run and /verify how to build and start your app from scratch. Example: `/run-skill-generator` |
| `/autofix-pr` | Review | 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. Example: `/autofix-pr only fix lint and type errors` |
| `/batch` | Parallel | Splits a large change into 5 to 30 independent parts and, once you approve the plan, runs each in its own subagent and worktree. Example: `/batch migrate src/ from JavaScript to TypeScript` |
| `/subtask` | Parallel | Hands a side task to a subagent that starts with a copy of the conversation and reports back here when done. Example: `/subtask find every caller of parseDate` |
| `/tasks` | Parallel | Lists the background work in this session, including subagents and commands, finished or not. Also /bashes. Example: `/tasks` |
| `/loop` | Parallel | Runs a prompt again and again while the session is open, at an interval you set or one Claude chooses. Also /proactive. Example: `/loop 5m check whether the deploy finished` |
| `/schedule` | Parallel | Creates, changes, lists or runs routines, prompts that run on a schedule in the cloud. Also /routines. Example: `/schedule every weekday at 9 summarize new issues` |
| `/list-agents` | Parallel | Lists the subagents, teammates and other sessions Claude can send messages to. Also /peers. Example: `/list-agents` |
| `/workflows` | Parallel | Shows running and finished workflows, which spread a job across many subagents, to watch, pause, resume or save. Example: `/workflows` |
| `/deep-research` | Parallel | Runs many web searches on a question, reads and cross-checks the sources, and writes a report with citations. Example: `/deep-research how do other CLIs store login tokens?` |
| `/init` | Setup | Reads your project and writes a starting CLAUDE.md with its commands and conventions. Example: `/init` |
| `/memory` | Setup | Opens your CLAUDE.md files to edit, and turns auto memory on or off and shows what it saved. Example: `/memory` |
| `/permissions` | Setup | Shows and edits your allow, ask and deny rules, and the folders Claude may work in. Also /allowed-tools. Example: `/permissions` |
| `/fewer-permission-prompts` | Setup | Looks through your past sessions for safe read-only commands you keep approving and adds them to the project's allow list. Example: `/fewer-permission-prompts` |
| `/sandbox` | Setup | Turns the sandbox on or off, which limits the files and websites shell commands can reach. Example: `/sandbox` |
| `/auto-mode-setup` | Setup | Drafts a description of your environment for auto mode's safety check from your project and recent sessions, for you to review and save. Example: `/auto-mode-setup` |
| `/config` | Setup | Opens the settings screen for theme, model, output style and more, or sets a value directly. Also /settings. Example: `/config theme=dark` |
| `/update-config` | Setup | Changes a settings file from a plain request, such as allowing a command or adding a hook. Example: `/update-config allow npm run lint without asking` |
| `/import` | Setup | Brings instruction files, MCP servers, commands and skills over from OpenAI Codex, Gemini CLI or Cursor on your machine. --dry-run previews. Example: `/import codex --dry-run` |
| `/doctor` | Setup | Checks your install, settings, extensions and CLAUDE.md for problems and offers fixes, which it applies after you confirm. Also /checkup. Example: `/doctor` |
| `/terminal-setup` | Setup | Sets up Shift+Enter for new lines in VS Code, Cursor, Alacritty or Zed, and fixes the equivalent settings in Apple Terminal and iTerm2. Example: `/terminal-setup` |
| `/statusline` | Setup | Sets up the status line under the prompt. Describe what you want shown, or run it bare to copy your shell prompt. Example: `/statusline show the branch and context used` |
| `/keybindings` | Setup | Opens your keyboard shortcuts file to change keys. Example: `/keybindings` |
| `/ide` | Setup | Connects to your code editor and shows the connection. Example: `/ide` |
| `/install-github-app` | Setup | Installs the Claude GitHub app on a repository and can set up the GitHub Actions workflow and its secret. github.com only. Example: `/install-github-app` |
| `/install-slack-app` | Setup | Installs the Claude app in Slack, through a sign-in in your browser. Example: `/install-slack-app` |
| `/web-setup` | Setup | Connects your GitHub account for cloud sessions, using the login of your local gh tool. Example: `/web-setup` |
| `/remote-env` | Setup | Picks the default cloud environment for cloud sessions you start from the terminal. Example: `/remote-env` |
| `/chrome` | Setup | Changes the settings for Claude in Chrome, which lets Claude use your browser. Example: `/chrome` |
| `/setup-bedrock` | Setup | Walks through signing in to Amazon Bedrock and choosing a region and models. Shows once CLAUDE_CODE_USE_BEDROCK=1 is set. Example: `/setup-bedrock` |
| `/setup-vertex` | Setup | Walks through signing in to Google Cloud and choosing a project, region and models. Shows once CLAUDE_CODE_USE_VERTEX=1 is set. Example: `/setup-vertex` |
| `/mcp` | Extend | Lists your MCP servers and their status, signs in to the ones that need it, and reconnects, turns on or turns off a server. Example: `/mcp reconnect github` |
| `/skills` | Extend | 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. Example: `/skills` |
| `/reload-skills` | Extend | Picks up skills you added or changed on disk during the session, without restarting. Example: `/reload-skills` |
| `/skill-doctor` | Extend | Shows what each skill costs in context and how often it is used, to find ones to turn off. Example: `/skill-doctor` |
| `/agents` | Extend | Reminds you how to create subagents - ask Claude, or edit the files in .claude/agents/ yourself. Example: `/agents` |
| `/hooks` | Extend | Shows the hooks you have set up and where each comes from. Example: `/hooks` |
| `/plugin` | Extend | Opens the plugin menu, or lists, installs, enables or disables a plugin directly. Example: `/plugin install code-review@claude-plugins-official` |
| `/reload-plugins` | Extend | Reloads your plugins so changes apply without a restart. Example: `/reload-plugins` |
| `/plugin-authoring` | Extend | Loads the reference Claude follows to write a plugin for you. Example: `/plugin-authoring` |
| `/workflow-authoring` | Extend | Loads the reference for writing workflow scripts that spread a job across many subagents. Example: `/workflow-authoring` |
| `/claude-api` | Extend | Loads reference material for building on the Claude API in your project's language, with tasks such as migrate, cost-optimize and build-eval. Example: `/claude-api cost-optimize` |
| `/claude-in-chrome` | Extend | Has Claude do a task in your browser, such as testing a page or reading its console, through Claude in Chrome. Example: `/claude-in-chrome check the signup form on localhost:3000` |
| `/artifacts` | Artifacts | Lists your artifacts, the web pages Claude publishes on claude.ai, to attach one to the session, open it or copy its link. Example: `/artifacts` |
| `/artifact-capabilities` | Artifacts | Loads the reference for what a published artifact page can do, such as offering a file to download. Example: `/artifact-capabilities` |
| `/artifact-diagramming` | Artifacts | Loads guidance for drawing clear diagrams in artifacts that work in light and dark themes. Example: `/artifact-diagramming` |
| `/design` | Artifacts | Drafts screens, flows, landing pages or posters as artboards on a canvas you can edit in the browser and export. Example: `/design a settings screen for a banking app` |
| `/design-sync` | Artifacts | Uploads your repo's React design system to Claude Design, so its designs use your real components. Example: `/design-sync` |
| `/design-login` | Artifacts | Signs in with your claude.ai account so /design-sync can upload your design system. Example: `/design-login` |
| `/slides` | Artifacts | Makes a slide deck from your brief as an artifact. Example: `/slides a quarterly review of the platform team` |
| `/dataviz` | Artifacts | Loads guidance for charts and dashboards - the right chart for the data, colours that work for colour-blind readers, and accessible labels. Example: `/dataviz` |
| `/usage` | Account | Shows what the session has cost, how much of your plan's limits you have used, and activity stats. Also /cost and /stats. Example: `/usage` |
| `/status` | Account | Shows the version, model, account and connection, including which login or API key is in use. Works while Claude is answering. Example: `/status` |
| `/login` | Account | Signs in to your Anthropic account, or switches account. Example: `/login` |
| `/logout` | Account | Signs out of your Anthropic account. Example: `/logout` |
| `/rate-limit-options` | Account | Shows your choices when a usage limit stops you - wait and carry on when it resets, add usage credits, or upgrade. Example: `/rate-limit-options` |
| `/usage-credits` | Account | Sets up usage credits to keep working past your plan's limits, or asks your admin for them. Example: `/usage-credits` |
| `/upgrade` | Account | Opens the page to move to a higher plan. Example: `/upgrade` |
| `/privacy-settings` | Account | Shows and changes your privacy settings. Pro and Max only. Example: `/privacy-settings` |
| `/passes` | Account | Shares a free week of Claude Code with friends, if your account can. Example: `/passes` |
| `/insights` | Account | Writes a report on your recent sessions on this machine - the projects, how you work, where things go wrong, and features to try. Example: `/insights` |
| `/team-onboarding` | Account | Writes a guide for a teammate from how you have used Claude Code in the last 30 days, to paste as their first message. Example: `/team-onboarding` |
| `/help` | Help | Shows help and the commands you can use. Example: `/help` |
| `/powerup` | Help | Teaches Claude Code's features through short interactive lessons. Example: `/powerup` |
| `/release-notes` | Help | Shows what changed in each version. Example: `/release-notes` |
| `/debug` | Help | Turns on debug logging for the session and reads the log to find a problem. Describe the problem to focus it. Example: `/debug MCP server keeps disconnecting` |
| `/bug` | Help | Reports a bug, with as much of the session as you choose to include, after a consent screen. Also /share. Example: `/bug` |
| `/feedback` | Help | Sends feedback about Claude Code, through the same dialog as /bug. Example: `/feedback` |
| `/heapdump` | Help | 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. Example: `/heapdump` |
| `/theme` | Interface | Changes the colour theme, including auto, colour-blind friendly themes and your own. Example: `/theme` |
| `/color` | Interface | Sets the colour of the prompt bar for this session, which helps tell sessions apart. Example: `/color green` |
| `/tui` | Interface | Switches between the default and the full-screen display, keeping the conversation. Example: `/tui fullscreen` |
| `/focus` | Interface | In the full-screen display, shows only your last message, a one-line summary of the tools used and the final answer. Example: `/focus` |
| `/scroll-speed` | Interface | Changes how fast the mouse wheel scrolls in the full-screen display. Example: `/scroll-speed` |
| `/voice` | Interface | Turns voice dictation on or off, holding a key to talk or tapping to start and stop. Example: `/voice hold` |
| `/mobile` | Interface | Shows a QR code to download the Claude phone app. Also /ios and /android. Example: `/mobile` |
| `/radio` | Interface | Opens Claude FM, a lo-fi radio stream, in your browser. Example: `/radio` |
| `/stickers` | Interface | Orders Claude Code stickers. Example: `/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

- [Commands](https://code.claude.com/docs/en/commands)
- [Extend Claude with skills](https://code.claude.com/docs/en/skills)
