99

Concurrent visitors over the last 30 minutes. (~)

Peak concurrent visitors -
Yesterday: 0 / Today: 0

Claude Code Built-in Slash Commands Essentials

Claude Code Built-in Slash Commands Essentials

This post groups Claude Code's built-in commands, which start with /, by purpose.
For commands you operate on screen, it shows how to use them with real screenshots, and for commands with confusingly similar names, it compares the differences.
Session and context management commands, which everyone uses often, come first, and commands used mainly in development work, such as code review and conversation branching, come later.
If you're new to Claude Code, start with 'Claude Code Essentials'.

This post is based on Claude Code version 2.1.294.
Commands are added or changed between versions, and some may not appear in the list depending on your plan, login method, or operating system.

# Using commands

Type / in the input box to open the list of available commands.
As you keep typing, the list narrows by command name and alias, and pressing Enter runs the highlighted command.
Typing an alias still selects the original command, so typing /new, for example, highlights /clear (new).

The command list selects the original command even when you type an alias

If you send a command while Claude is responding, it goes into a queue and runs after the current turn ends.
However, some commands such as /status, /tasks, and /usage run right away without waiting for the response, and /model, /effort, /permissions, and /add-dir apply their changes immediately even during a response.
/fast also runs without waiting, but the response in progress finishes at the original speed, and the new speed applies from the next turn.
With fullscreen rendering, settings screens such as /theme, /help, /config, /autocompact, and /advisor also open right away during a response.

Commands come in three kinds, depending on how they work.
Most are handled directly by the CLI and leave almost nothing in the conversation, but commands built as skills add their instructions to the conversation when you run them, so they use context.
The same goes for commands that ask Claude to do work, such as /init and /statusline.

Kind How it works Examples
Built-in command Handled directly by the CLI /clear, /model, /context
Skill Runs by passing prepared instructions to Claude /code-review, /simplify, /loop
Workflow Coordinates multiple subagents in parallel in the background /deep-research

In the list below, commands that work as skills or workflows are marked next to their names, and arguments are written as <required> and [optional].
A few more things worth knowing:

  • Commands are recognized only at the very start of a message, and any text after the command name is passed as arguments. Skills are an exception: you can chain up to six at the start, as in /skill-a /skill-b your request, and the text after them is passed to each as arguments.
  • If you make a typo, nothing is highlighted. Similar commands stay in the list so you can pick one with Tab or the arrow keys, but if you press Enter as is, Unknown command appears.
  • Some commands such as /heapdump don't appear in the list, and you must type the full name to run them.
  • You can also see all commands and their descriptions in the Commands tab of /help.

# Session management

  • /clear [name], /reset, /new
    • Clears the conversation history and starts a new conversation with an empty context.
    • If you pass a name, it gives that name to the previous conversation so it's easy to find in the /resume list.
    • The previous conversation stays on disk, so you can reopen it with /resume, and until you quit Claude Code or pick up another conversation, you can also return to it through the (previous session) item at the top of the /rewind list.
    • Project instructions such as CLAUDE.md are loaded into the new conversation as usual.
    • When you start a completely new task, /clear is more token-efficient than /compact.
  • /resume [session], /continue
    • Continues a previous conversation directly by session ID or name.

    • With no arguments, it opens the session picker. Sessions in the current project are listed with the most recent first. Named sessions show their names, other sessions show an auto-generated title or their first prompt, and each one also shows the last activity time, Git branch, and file size.

      The /resume session picker

      Key Action
      Type text Search sessions
      Up/down arrow keys, Enter Pick a session and continue it
      Space Preview the session's contents
      Ctrl + R Rename the selected session
      Ctrl + A Show sessions from all projects
      Ctrl + B Show only sessions on the current Git branch
      Ctrl + W Show sessions from all worktrees of the repository (when there are multiple worktrees)
      Esc Clear the search or close the screen
    • Background sessions are marked bg in the list. If you pick a background session that is still running, your current conversation moves to the background and this terminal attaches to that session. Pressing the left arrow key while the input box is empty takes you back to the agent view, which also shows the conversation you just left.

    • When you switch to another conversation with /resume inside a session, the permission mode that conversation used is not restored, and the current session's permission mode stays as it is.

  • /rename [name], /name
    • Renames the current session and shows the name on the right side of the input box's top border.
    • With no arguments, it generates a name automatically from the conversation.
    • Once a session has a name, you can continue it directly with /resume <name> or claude --resume <name> in the terminal.
    • If another session running on this machine already uses the same name, a slightly changed version of the name is applied instead.
  • /color [color|default]
    • Changes the color of the input box border so you can tell sessions apart at a glance when you have several terminal windows open.

    • Choose from red, blue, green, yellow, purple, orange, pink, and cyan, reset it with default, or run it without arguments to apply a random color.

    • Used together with /rename, the session name shown on the border is also highlighted in the same color.

      The input box with /rename and /color applied

    • For a session connected through Remote Control, the color you choose is also applied on the claude.ai/code screen.

  • /copy [N]
    • Copies the last response to the clipboard.

    • If you pass a number, as in /copy 2, it copies the Nth most recent response instead.

    • If the response contains code blocks, a screen opens where you choose what to copy.

      The /copy screen for choosing what to copy

    • Pick the whole response (Full response) or an individual code block and press Enter to copy it.

    • Pressing w saves to a file instead of the clipboard, which is useful in SSH environments where the clipboard isn't available.

    • If you select Always copy full response, it copies the whole response without this screen from then on, and you can undo that in /config.

    • If copying doesn't work in iTerm2, allow clipboard access with /terminal-setup.

  • /export [filename]
    • Exports the current conversation to a text file.
    • If you give a filename, it saves right away; if you leave it out, you choose between copying to the clipboard and saving to a file.
  • /exit, /quit
    • Quits the CLI.
    • If background work such as subagents, background shells, or workflows is still running, it asks whether to stop it all and quit, or to move the session to the background and close only the terminal. This choice doesn't appear in environments where the agent view is turned off.
    • When you're attached to a background session, it only detaches without ending the session.
  • /cd <path>
    • Moves the current session to a different working directory while keeping the conversation.
    • The new directory's CLAUDE.md, project settings, hooks, skills, and agents apply right away, and MCP servers connect after approval as usual.
    • If it's a directory you haven't worked in before, the screen that asks whether you trust it lets you first check the allow rules and hooks that the directory's settings would turn on.
    • You can find the moved session with --resume from the new directory.
    • To keep the current directory and only add more directories you can access, use /add-dir.

# Context management

As a conversation grows longer, the context window fills up, and auto-compact runs before it is full.
With the commands below, you can check the current usage, summarize the parts you don't need, or go back to an earlier point.

  • /context [all]
    • Visualizes the current context usage as a colored grid.

    • It shows what is taking up the context, such as the system prompt, tools, memory, or the conversation, so it gives you a basis for deciding when to run /clear or /compact.

      The /context usage screen

    • The grid on the left divides the whole context window into cells. Cells in use are filled with each item's color, and empty cells are the remaining space (Free space). The cells marked with an X at the end of the grid are space kept free for auto-compact (Autocompact buffer).

    • On the right, it shows the model and total usage (42.7k/1m tokens (4%)), along with token counts for each item, such as the system prompt (System prompt), tools (System tools), skills (Skills), and the conversation (Messages).

    • At the bottom, it shows the point where auto-compact starts (Auto-compact window) and the tokens used by MCP tools and skills. MCP tools are loaded only when needed (loaded on-demand), so they may show 0 tokens even if you have many tools.

    • It also shows optimization suggestions for tools that use a lot of context, bloated memory files, and capacity warnings.

    • With fullscreen rendering, the details for each item are collapsed, and passing all expands them.

  • /compact [instructions]
    • Replaces the conversation so far with a summary to free up context.
    • If the next task is clear, it's a good idea to give the summary a focus as well, as in /compact keep the focus on the refactoring.
    • Because the conversation is replaced with a summary, the prompt cache is invalidated, so the cost of the next request may go up temporarily.
  • /rewind, /checkpoint, /undo
    • Rewinds the code or conversation to an earlier point (checkpoint), or summarizes only part of the conversation.

    • A checkpoint is created automatically each time you send a prompt that starts a turn, and you can use it even after reopening the session. Messages you add during a response are merged into the same turn, so they don't get their own checkpoint.

      Checkpoints track only files changed by Claude's file editing tools.
      Files changed by Bash commands (rm, mv, etc.) or an external editor, and files edited by subagents (except fork skills run in the foreground), can't be rewound, so manage any change history you want to keep long term with Git.

    • Pressing Esc twice while the input box is empty opens the same screen.

    • When you run it, it first lists the prompts you sent in this session. Pick the prompt to rewind to and press Enter, and a screen opens where you choose what to do based on the state just before that prompt was sent. It also shows how much code will be rolled back (-3 in store.js).

      Choosing how to rewind in /rewind

      Option Code Conversation
      Restore code and conversation Rewound Rewound
      Restore conversation Kept Rewound
      Restore code Rewound Kept
      Summarize from here Kept Summarized from the selected message to the end
      Summarize up to here Kept Summarized up to just before the selected message
    • The two options that rewind code appear only when there are tracked file changes after the selected point, and choosing Never mind at the end of the list goes back without changing anything.

    • If you rewind the conversation or choose Summarize from here, the prompt you picked is filled back into the input box, so you can send it again as is or edit it first.

    • The two summarize options leave files alone and replace only part of the conversation with a summary to free up context space. Unlike /compact, which summarizes the whole conversation, you choose the range to summarize yourself, and the two differ in whether they summarize before or after the selected message.

      The range summarized relative to the selected message

    • 'Summarize from here' summarizes from the selected message to the end, so it suits cases where you want to keep your original instructions and shorten only a long debugging session.

    • 'Summarize up to here' summarizes everything before the selected message and keeps the messages after it as they are.

    • Pressing a summarize option's number key summarizes right away. If you highlight the option with the arrow keys and type into the add context (optional) field, you can set the focus of the summary.

    • Even after summarizing, the original messages remain in the session history, so Claude can refer to the details when needed.

  • /btw [question]
    • Short for 'By The Way', it lets you ask a quick side question without leaving it in the conversation history.

    • It answers based on the conversation so far and the side questions you asked earlier, and it doesn't use tools such as reading files or running commands.

    • You can use it even while Claude is responding, and it doesn't interrupt the work in progress.

    • While the prompt cache is still alive, it costs little beyond the answer itself.

    • When you ask, an answer panel opens above the input box.

      The /btw answer panel

    • Scroll long answers with the up and down arrow keys, and copy the answer with c.

    • If you need to check files or continue working based on the answer, press f in the answer panel you just got to hand this question and answer to a background subagent that can use tools. This key is available only in local sessions.

    • Close it with Esc, Enter, or Space, and run /btw without arguments to reopen the last answer panel.

    • Browse earlier questions with Shift + the left/right arrow keys (or [ and ]), and clear the list with x. The list disappears when you quit Claude Code.

  • /recap
    • Shows a short summary, in a few lines, of what you did in the current session and what to do next.

      The /recap session summary

    • It's for quickly getting your bearings when you come back after stepping away, and it also appears automatically if you've been away for a while.

  • /autocompact [auto|<tokens>]
    • Sets the context size at which auto-compact starts.
    • Pass a value between 100,000 and 1,000,000 tokens, such as 500k, 1M, or 200000, or pass auto to go back to the default tuned for the model.
    • The value is saved in modelSettings in your user settings for the current model, so each model keeps its own value when you switch models, and it also applies to later sessions. To apply the same value to all models, set autoCompactWindow directly in the settings file.
    • You can save a value larger than the model's context window, but the threshold actually applied is the smaller of the setting and the model's window.
    • If the CLAUDE_CODE_AUTO_COMPACT_WINDOW environment variable is set, its value takes precedence, so you can't change it with this command.
    • With no arguments, it shows the current setting and opens a screen for choosing a value. You can also check the threshold currently in effect on the Auto-compact window line of the /context screen.

For an in-depth look at optimizing context and token usage, see 'Claude Code Token Diet: Core Optimization Strategies'.

# Model and performance

  • /model [model]
    • Changes the AI model and saves the selected model as the default for new sessions.
    • Passing an alias such as opus, sonnet, haiku, or fable switches to the latest model in that family, which on the Anthropic API is Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 respectively. The default (default) is Opus 5.5 on all plans.
    • With no arguments, it opens a picker where you can also adjust the effort level with the left and right arrow keys.
    • In the picker, Enter saves the choice as the default, and s applies it only to the current session.
    • If you change models while the prompt cache is still alive, the next request has to reread the whole conversation without the cache, so it asks you to confirm. Once you confirm, the change applies right away without waiting for the current response, and if the cache has already expired, it switches without asking.
  • /effort [level|auto|status|ultracode [on|off]]
    • Sets the effort level, which controls how deeply the model reasons.
    • Choose from low, medium, high, xhigh, and max; the levels available differ by model. The default for Opus 5.5, Sonnet 5.5, and Haiku 5.5 is medium, and starting with Haiku 5.5, Haiku models also support effort levels.
    • Higher levels improve the quality of complex work, but responses get slower and use more tokens.
    • With no arguments, it opens a slider. Enter saves the level as the default, and s applies it only to the current session.
    • Saved levels are remembered separately for each model, and max always applies only to the current session.
    • auto clears the saved level and goes back to the model's default, and status prints the current level.
    • ultracode is not an effort level but a Claude Code-only setting. When it's on, large tasks are handled as workflows that coordinate multiple subagents. Since 2.1.284 it's a toggle separate from the effort level, so turning it on keeps your current effort level as it is.
    • Turn it on for the current session with /effort ultracode (or ultracode on) and off with /effort ultracode off. In the slider, toggle Ultracode with Tab and apply it with Enter. To start every session with it on, set "ultracode": true in the settings file.
    • It's available only when dynamic workflows are turned on and the model supports xhigh. How it differs from the workflow command /deep-research is compared in Planning and repeated runs.
  • /fast [on|off]
    • Turns fast mode on or off.
    • It doesn't switch to a smaller model; it uses the same Opus model with up to 2.5x faster output, and it's supported only on Opus 5.5, Opus 5, and Opus 4.8. Since 2.1.280, turning on fast mode uses Opus 5.5 by default.
    • The per-token price is higher than regular Opus, and on subscription plans you must first turn on usage credits in /usage-credits to use it.
    • If you turn it on in the middle of a conversation, the whole conversation up to that point is reread once at the fast mode price, so if you plan to use it, it's cheaper to turn it on when you start the session.
  • /advisor [model|off]
    • Sets an advisor model so that Claude asks a stronger model for advice at important moments during its work.
    • The advisor receives the whole conversation and tool results and returns advice, and the main model continues its work with that advice.
    • The main model decides when to ask for advice, usually before settling on an approach, when the same error keeps repeating, and before declaring the work done.
    • Pass fable, opus, sonnet, or a full model ID as the argument, or run it without arguments to open a picker.
    • The selected model is saved in your user settings (advisorModel) and kept for later sessions. To set it for this session only, run claude --advisor <model>.
    • The advisor connects only if it's a valid pairing with the main model. For example, if the main model is Opus 5.5 or Opus 5, only Fable or models from Opus 5 onward can be the advisor; if it's Sonnet 5.5, you can use Fable, models from Opus 5 onward, or Sonnet 5.5 as the advisor.
    • Keeping the main model light and the advisor strong, for example leaving everyday work to Sonnet and asking Opus only about planning or failures with unclear causes, can cost less than using only the top model.
    • On subscription plans, advisor usage counts toward your plan usage, but if you set Fable as the advisor, it may be billed to usage credits depending on your plan, and it takes effect only after you agree once in /model fable.
    • It works only on the Anthropic API and isn't available with other providers such as Amazon Bedrock.

# Information

  • /help
    • Shows help and the available commands in the General, Commands, and Custom commands tabs.

    • The General tab, which opens first, lists frequently used input methods and shortcuts, such as shell mode (!), file path input (@), side questions (/btw), and switching permission modes (Shift + Tab).

      The General tab of /help

    • Switch tabs with the left and right arrow keys. In the Commands tab, browse built-in commands and their descriptions with the up and down arrow keys, and in the Custom commands tab, see commands you made yourself or installed through plugins.

  • /powerup
    • Introduces Claude Code's features through short interactive lessons with animated demos.
    • It's a good way to learn the main features one by one when you first start using Claude Code.
  • /usage, /cost, /stats
    • Shows the current session cost, plan usage limits, and activity stats on one screen, and /stats opens the stats tab directly.

    • The session cost is a reference value calculated from token counts, so it matters to API users. Subscription plan users should check the plan usage bars instead.

    • On paid plans, it also shows factors that made up 10% or more of recent usage, such as long context or cache misses, along with ways to reduce them.

    • You can also check the run count and token usage of each /loop task, as well as the session's prompt cache hit rate.

    • Running it opens the Usage tab of the settings window. Session at the top shows the current session's token count and the cost calculated from it at per-token prices, and the bars below show how much of your subscription plan's usage limits you've used and when they reset.

      The /usage screen

    • Current session is the session limit that resets on a short cycle, and Current week (all models) is the weekly limit. If there is a per-model weekly limit, it's shown separately, as in Current week (Fable).

    • /status, /config, /usage, and /stats all open this settings window and differ only in which tab is selected, so you can move between the Status, Config, Usage, and Stats tabs with the left and right arrow keys.

    • The Stats tab shows a calendar marking the days you used it, along with stats such as total tokens, session count, and longest session. Press r to change the period (all time, last 7 days, last 30 days).

  • /status
    • Opens the Status tab of the settings screen to check the version, model, account, and connection status.

    • You can use it right away without waiting, even during a response.

      The /status screen

    • The top shows the version, session name and ID, working directory (cwd), login method, organization, and email, and the bottom shows the model in use, MCP server connection status, and the settings files in effect (Setting sources).

    • It's a good first screen to check when an MCP server isn't working or a setting doesn't seem to apply.

    • It shows your account email and working directory path as they are, so be careful when sharing or capturing the screen. The working directory path is hidden in the screenshot above as well.

  • /release-notes
    • Lets you pick a version and view its changelog.
    • The changelog is shown only on screen and doesn't enter the conversation that Claude sees.
  • /doctor [prompt-audit [path]], /checkup (skill)
    • Diagnoses your installation and settings and even suggests fixes.
    • It checks everything from installation status, such as duplicate installs, PATH problems, unreadable settings files, and whether a new version is available, to the context cost of unused skills, MCP servers, and plugins, slow hooks, and cleaning up a bloated CLAUDE.md.
    • It also suggests pre-approving read-only commands that are often denied, or setting auto mode as the default.
    • It reports its findings first and makes changes only after you confirm. To check only the installation status without a session, run claude doctor in the terminal.
    • Passing prompt-audit checks your instruction files instead of the installation. In CLAUDE.md, CLAUDE.local.md, AGENTS.md, and the rules, skills, commands, subagents, and output styles in the .claude/ folder, it looks for instructions written for older models, content that points to files or commands that don't exist, and instructions that conflict with each other, then reports suggested fixes.
    • If you pass a path, as in /doctor prompt-audit .claude/skills/deploy, it checks only that file or folder, and the suggested fixes aren't applied to the files until you ask for them.
  • /insights
    • Analyzes recent sessions on this machine and generates an HTML report with the projects you mainly work on, usage patterns, common sticking points, and features to try.
    • The report is saved to ~/.claude/usage-data/report.html, and the tokens used for the analysis count toward your plan or API usage.
  • /debug [description] (skill)
    • Turns on debug logging for the current session and reads the logs to diagnose problems that occurred while running.
    • Logging starts when you run the command, and describing the problem along with it helps narrow the focus of the analysis.
  • /heapdump
    • Saves a heap snapshot and a memory analysis file to your desktop (~/Desktop, or the home directory on Linux without a desktop folder) so you can diagnose memory problems.
    • It doesn't appear in the menu, so you must type the full name.
    • When reporting a problem, attach only the -diagnostics.json file, and don't share the .heapsnapshot file, which contains the whole conversation and your credentials.

# Account and settings

  • /config [key=value ...], /settings
    • Opens the settings screen for things like the theme, model, editor mode, and output style.

    • If you pass values, as in /config theme=dark or /config model=sonnet, it changes the settings right away without opening the screen.

    • You can see the setting keys you can change with /config --help. Settings that require a confirmation step in the settings screen can only be turned off this way, not on.

    • With no arguments, it opens the Config tab of the settings window, which lists the settings and their current values. The cursor starts in the search box, so you can type right away to narrow the list by setting name.

      The /config settings list

    • Enter the list with Enter or the down arrow key, choose an item with the up and down arrow keys, and change its value with Enter or Space.

    • Items that cycle through several values have arrow marks on both sides of the value, and you can move between the previous and next values with the left and right arrow keys. PgUp and PgDn move through the list one page at a time.

    • Pressing / in the list takes you back to the search box, and pressing the up arrow key in the search box moves to the tabs, where you can pick another tab with the left and right arrow keys.

    • Esc in the search box clears what you typed, and Esc in the list closes the window and shows the changed settings in the conversation, as in Disabled auto-compact.

    • A line like 25 more at the bottom of the list means there are more items you can scroll to, and frequently used items such as Output style or Language are faster to find by searching.

  • /theme
    • Changes the color theme.
    • It offers auto, which matches your terminal background, light/dark, colorblind-friendly themes, and ANSI themes that use the terminal palette, and you can also make a custom theme with the New custom theme item.
  • /output-style [name]
    • Shows the list of output styles, which decide how responses are written, or switches to a different style.
    • With no arguments, it prints the available styles and their descriptions, and passing a name, as in /output-style Concise, switches to that style.
    • Besides the default style (Default), the built-in styles are Concise, which answers briefly with the result first, Proactive, which makes assumptions on minor decisions and acts right away, Explanatory, which adds explanations while working, and Learning, which has you write some of the code yourself.
    • You can also change it in the Output style item of /config.
  • /statusline
    • Sets up the status line below the input box.
    • Describe the setup you want, as in /statusline show the branch and model, and Claude builds it. With no arguments, it sets one up automatically based on your shell prompt.
  • /tui [default|fullscreen]
    • Chooses the terminal UI renderer and restarts while keeping the conversation.
    • fullscreen is a full-screen renderer with no screen flicker, mouse support, and steady memory use even in long conversations.
    • Some features, such as /focus, /scroll-speed, and the diff panel, are available only with fullscreen rendering. With no arguments, it shows the current renderer.
  • /focus
    • Turns focus view on or off, which keeps only the last prompt, a summary of tool use, and the final response.
    • It's available only with fullscreen rendering, and the setting carries over to later sessions.
    • On a device connected through Remote Control, /focus on and /focus off apply only to the current session and leave the saved setting as it is.
  • /scroll-speed
    • Adjusts the mouse wheel scroll speed with a preview.

    • Set how many lines one notch of the wheel moves with the left and right arrow keys, and while the window is open, roll the wheel to check the new speed right away.

      The /scroll-speed adjustment screen

    • Save with Enter, or press r to go back to the automatic value (auto) set for your terminal. The screen also shows the detected terminal type and the automatic value.

    • It's available only with fullscreen rendering and isn't offered in the terminals of JetBrains IDEs.

  • /keybindings
    • Opens the keybindings settings file.
  • /terminal-setup
    • Installs the Shift + Enter newline keybinding in terminals such as VS Code, Cursor, Devin Desktop, and Zed. Alacritty works without setup from version 0.16, so you need it only on earlier versions.
    • In the default macOS Terminal, it turns on Option + Enter for newlines and turns off the bell, and in iTerm2, it allows clipboard access so that /copy works.
  • /login, /logout
    • Logs in to or out of your Anthropic account.
  • /usage-credits
    • Opens a page in your browser for setting up usage credits so you can keep working when you hit your usage limit.
    • Team and Enterprise members without billing permissions should ask an admin for credits.
    • You must turn this on first to use /fast mode.
  • /rate-limit-options
    • Opens a screen where you choose how to keep working when requests stop because you hit your claude.ai usage limit.
    • You can choose to wait until the limit resets and continue automatically, add usage credits, or upgrade your plan, and you can also cancel so that it doesn't continue automatically.
    • Claude Code may open this screen itself when you hit the limit in the terminal, and it's available only when you're logged in with a claude.ai subscription.
  • /upgrade
    • Opens a page in your browser for upgrading to a higher plan.
  • /passes
    • Shares a pass that lets a friend use Claude Code free for one week.
    • It appears in the list only when your account is eligible, and depending on the conditions, you may also receive usage credits.
  • /privacy-settings
    • Lets you view and change privacy settings, such as whether your conversations are used to improve Anthropic's models. It's available only on the Pro and Max plans.

# Project settings

  • /init
    • Analyzes the codebase and generates CLAUDE.md, a guide to the project.
    • If you have OpenAI Codex or Gemini CLI settings, it asks whether to bring them in with /import.
    • If you set the CLAUDE_CODE_NEW_INIT=1 environment variable, it also sets up skills, hooks, and a personal memory file interactively.
  • /memory
    • Lets you pick a memory file such as CLAUDE.md or CLAUDE.local.md at the user or project scope and opens it in your editor. If you select a file that doesn't exist yet, it creates one.
    • You can turn auto memory on or off or open the auto memory folder, and you can also toggle the on/off item with the left and right arrow keys.
    • Auto memory is a feature where Claude writes information it learns while working, such as build commands or your preferences, directly to ~/.claude/projects/<project>/memory/.
    • In projects without a CLAUDE.md, it reads AGENTS.md, which other AI coding tools use, instead, and you can change this behavior in the Project instructions item of /config.
  • /permissions, /allowed-tools
    • Manages tool permission rules (allow, ask, deny).

    • You can open it even during a response, and changed rules apply from Claude's next tool call.

    • Running it opens a permissions screen divided into tabs. Switch tabs with the left and right arrow keys, and enter the list with the down arrow key to select a rule. In the Allow, Ask, and Deny tabs, you can add a new rule with the Add a new rule item in the list.

      The /permissions screen

      Tab Contents
      Recently denied Requests recently denied in auto mode
      Allow Rules that run without asking
      Ask Rules that ask for confirmation every time
      Deny Rules that block execution
      Workspace List of working directories
    • If a command keeps asking for permission, register it here as an Allow rule.

    • Depending on your environment, an Auto mode tab for checking and editing auto mode's classification rules also appears.

  • /fewer-permission-prompts (skill)
    • Finds read-only Bash commands and MCP tool calls you used often in past session history, and adds a prioritized allowlist to the project's .claude/settings.json.
    • Instead of registering rules one by one in /permissions, it reduces the number of approval prompts based on your actual usage history.
  • /sandbox
    • Turns on or off sandbox mode, which limits Bash command execution to an isolated environment.

    • It enforces at the operating system level that files can be written only to allowed paths such as the working directory, and that the network can reach only domains you've approved.

    • Inside this boundary, commands don't need approval one by one, so it raises autonomy while keeping things safe.

    • On macOS, it works right away with the built-in Seatbelt, while Linux and WSL2 need the bubblewrap and socat packages.

    • Native Windows isn't supported, so on Windows you need to run Claude Code inside WSL2. It doesn't work on WSL1.

    • Running it opens the sandbox settings window. Switch tabs with the left and right arrow keys, pick a mode in the Mode tab with the up and down arrow keys, and apply it with Enter. The screen shows it as something like Sandbox BashTool, with auto-allow, and the modes differ as follows.

      The /sandbox mode selection screen

      Mode Behavior
      auto-allow Commands that run inside the sandbox go through without approval, and only commands that need to run outside are approved as usual
      regular permissions Runs inside the sandbox, but every command goes through permission rules and approval as usual
      No Sandbox Doesn't use the sandbox (default)
    • Auto-allow mode works independently of permission modes other than plan mode, so even in the default permission mode, Bash commands inside the sandbox run without asking.

    • However, explicit deny rules still block commands, and ask rules such as Bash(git push *) and rm commands that delete important paths still ask for confirmation in auto-allow mode.

    • Claude may try to rerun a command that failed inside the sandbox outside of it, and in that case it asks for approval as usual. To block these retries themselves, use the Overrides tab, and check the sandbox settings in effect in the Config tab.

  • /add-dir <path>
    • Adds a working directory where the current session can read and edit files.
    • When you run it, you choose the scope.
      • Yes, for this session: Adds it for this session only. Use this when you briefly connect a directory for reference.
      • Yes, and remember this directory: Saves it to permissions.additionalDirectories in the project's .claude/settings.local.json so it carries over to later sessions. Use this for directories you'll keep working with, such as other packages in a monorepo.
    • For a directory added with the command, Claude Code not only allows file access but also loads the .claude/skills, .claude/commands, and .claude/agents inside it. On the other hand, it doesn't load hooks, reads only plugin-related keys from settings, and loads CLAUDE.md only when you set the CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 environment variable.
    • Directories saved in the settings file get only file access from the next session on, and setup such as skills isn't loaded.
    • You can see added directories in the Workspace tab of /permissions, and to move the session itself to another directory, use /cd.
  • /hooks
    • Shows your hook settings.
    • Hooks are shell commands you define to run automatically at specific points in the Claude Code lifecycle, such as before and after a tool runs.
    • Use them to automate rules that must run every time, such as blocking dangerous commands or running a formatter after a file is edited.
    • Running it opens a single list of configured hooks grouped by event, and each hook shows where it came from, such as user settings, project settings, or a plugin.
    • Picking a hook shows the full command it runs and where it's defined. This screen is read-only, so you make changes in the corresponding settings file.
  • /update-config (skill)
    • Changes settings.json settings such as permissions, environment variables, and hooks through conversation.
    • You don't need to know the setting key names; just describe the behavior you want. Behavior that must run automatically every time, such as 'run the formatter whenever a file is edited', is set up as a hook.
  • /import [codex|gemini|cursor] [--dry-run] [--yes]
    • Brings settings from OpenAI Codex, Gemini CLI, and Cursor on this machine into Claude Code.
    • It covers instruction files, MCP servers, commands, subagents, and skills, and passing --dry-run previews what would be imported without writing any files.
    • Passing --yes imports right away without the selection screen. In non-interactive environments such as -p, you must also pass the value the preview gave you, in the form --yes=<digest>.
    • When you move over from another AI coding tool, you don't have to recreate your settings one by one.

# Planning and repeated runs

These commands plan work, or keep work going without you sending a prompt each time.
Among them, /goal, /loop, and /schedule differ in when the next run starts and where it runs.

Command Next run When it stops Where it runs
/goal Right after the previous turn ends When the condition is met, when it's judged impossible, or when you clear it Current session
/loop When the set interval has passed When you stop it, when Claude decides it's done, or 7 days after it was registered Current session
/schedule When the scheduled time arrives When you turn off or delete the routine Cloud
  • /plan [description]
    • Switches to plan mode, where Claude analyzes the code without editing files and proposes a work plan first.

    • If you also pass a description, it switches to plan mode and starts on that task right away. Example: /plan fix the authentication bug

    • When the plan is ready, a screen opens with the full plan and choices for how to proceed.

      Reviewing the plan and choosing how to proceed

      Option How it proceeds
      Yes, auto-accept edits Proceeds with the plan and applies file edits without approval
      Yes, manually approve edits Proceeds with the plan but asks for approval on each edit
      Tell Claude what to change Type what to change and have the plan rewritten
    • In sessions where auto mode is available, the first option appears as Yes, and use auto mode, and choosing it switches to auto mode and proceeds with the plan.

    • In the third option, if you type what to change and press Shift + Tab, it applies your changes and proceeds right away.

    • Plans are saved as Markdown files in the ~/.claude/plans/ folder, and you can open one in your editor with Ctrl + G to edit it yourself.

  • /goal [condition|clear]
    • Once you set a completion condition, Claude keeps taking turns and working without waiting for your next prompt until the condition is met.

    • At the end of every turn, a separate small, fast model looks at the results shown in the conversation and judges whether the condition is met.

    • The judging model doesn't run commands or read files itself, so you should write a condition that can be confirmed from Claude's output, such as 'all tests pass'.

    • Setting a condition starts the work right away, and while it's in progress, a /goal active indicator and the elapsed time appear above the input box.

      Working after setting /goal

    • When the condition is met, Goal achieved appears along with the time taken, the number of turns, and the tokens used, and the goal is cleared automatically.

    • The permission mode doesn't change, so to keep going without approval prompts, use it in auto mode.

    • With no arguments, it shows the current goal or the last goal achieved, and passing clear (or stop, cancel, etc.) clears the goal.

    • Example: /goal all tests in test/auth pass and there are no lint errors

  • /loop [interval] [prompt], /proactive (skill)
    • Runs a prompt repeatedly while the session is open, and it behaves differently depending on what you type.
    • If you give both an interval and a prompt, it runs at that fixed interval. Example: /loop 5m check whether the deployment has finished
    • If you give only a prompt, Claude looks at the result each time and decides the next interval, between 1 minute and 1 hour. Example: /loop check whether CI passes and address the review comments
    • If you leave out the prompt, it runs a built-in maintenance prompt, even when you give only an interval as in /loop 15m. You can replace this default prompt with a .claude/loop.md or ~/.claude/loop.md file.
    • Write intervals like 30s, 5m, 2h, or 1d. They are converted to cron expressions, so seconds are rounded up to minutes, and values that don't divide evenly, such as 7m or 90m, are adjusted to a nearby value.
    • You can also pass a skill in place of the prompt to repeat it, as in /loop 20m /review-pr 1234. However, skills that Claude can't invoke on its own aren't run and are passed as plain text.
    • A loop where Claude decides the interval can be stopped with Esc while it's waiting for the next run.
    • Every recurring task runs one last time 7 days after it was registered and is then deleted automatically, so to run something longer or independently of the session, use /schedule.
    • You can check the tokens used by each loop in the Loops item of /usage.
  • /schedule [description], /routines
    • Creates, edits, lists, or immediately runs routines that run in the cloud.
    • They run on schedule even when your computer is off, and the setup process guides you interactively.
    • You can also ask about a routine's recent run results.
    • MCP servers configured in Claude Code aren't connected to cloud routines as is, so you need to register them as connectors on claude.ai or commit them to the repository as .mcp.json.
  • /deep-research <question> (workflow)
    • Splits the question into multiple web searches, researches them in parallel, cross-checks the sources, and writes a report with citations.

    • It's a workflow built into Claude Code, with five predefined stages: scope, search, fetch, verify, and synthesize.

      • Scope: Splits the question into five search angles.
      • Search: One agent per angle searches the web in parallel.
      • Fetch: Fetches up to 15 top sources after removing duplicates, and pulls out claims that can be fact-checked.
      • Verify: Three agents try to refute each claim, and claims refuted by two or more of them are dropped.
      • Synthesize: Organizes the remaining claims by confidence and writes a report with sources attached.
    • When you run it, it first shows the list of stages and a usage warning and asks whether to proceed. Once you approve, it runs in the background so you can do other work in the meantime. You can check progress in /workflows, and when it finishes, the report arrives in the conversation.

    • Even a single simple question can run close to 100 subagents, so usage grows quickly. Also, in the default permission mode, it asks for confirmation every time it uses a tool that needs approval, such as web search or fetching a page.

    • It works only when you run it yourself; Claude doesn't start it on its own.

    • It's easy to confuse with /effort ultracode. /deep-research is a command that handles one job, web research, in fixed stages, while ultracode is a toggle setting of /effort that has Claude write the workflow each task needs on its own.

      The difference between /deep-research and ultracode

      Aspect /deep-research ultracode
      Kind Built-in workflow command /effort setting
      Target Web research questions Any task, including coding work
      Workflow Five predefined stages Written by Claude for each task
      Scope The one question you ran The whole current session
    • When ultracode is on, large tasks are split into multiple workflows such as understanding, changing, and verifying, while simple questions can be answered directly without a workflow. It doesn't change the effort level, so you can turn it on at medium or high too.

    • To handle just one task as a workflow rather than the whole session, include the ultracode keyword in your prompt.

  • /workflows
    • Opens the workflow progress screen.

    • Workflows are a feature that coordinates many subagents in parallel through a script Claude writes. When you ask for large-scale work, such as auditing an entire codebase or a large migration, Claude writes a script suited to that work, and the runtime runs it in the background.

    • It's available on paid plans, and on the Pro plan you need to turn on the Dynamic workflows item in /config.

    • When you pick a running workflow, the left side shows the list of stages (Phases) with progress counts for each, and the right side shows the agents in the selected stage. Each agent also shows the model it used, its token count, and its run time, and agents waiting their turn are shown as queued.

      The /workflows screen showing the verify stage of /deep-research

      Key Action
      Up/down arrow keys Select a stage
      x Stop the workflow
      p Pause and resume
      s Save the workflow
      Esc Go back to the previous screen
    • A saved workflow becomes a command you run by name, like /deep-research, and appears in the / list as well.

  • /batch <instruction> (skill)
    • Breaks a large change into independent units and handles them in parallel.
    • It researches the codebase and first presents a plan that splits the work into 5-30 independent units. Once you approve, a subagent for each unit implements, tests, and even creates a PR in an isolated worktree.
    • It suits work that applies the same pattern to dozens of files, such as /batch migrate the src/ folder from JavaScript to TypeScript, and it needs a Git repository. Even without a Git repository, it can run in environments where a WorktreeCreate hook creates the workspace.

# Tools and integrations

  • /mcp [reconnect (<server>|all)|enable|disable [<server>|all]]
    • Manages MCP server connections and OAuth authentication.
    • You can turn each server on or off, so you can save context by turning off servers you don't use.
    • Change connection status without opening the screen with /mcp enable and /mcp disable, and reconnect a dropped server with /mcp reconnect server-name.
    • /mcp reconnect all reconnects all servers that failed to connect or need authentication at once.
  • /plugin [subcommand], /plugins, /marketplace
    • Manages plugins and marketplaces.
    • With no arguments, it opens the management menu, and you can also pass subcommands such as list, install, enable, and disable directly.
    • Plugins you install or turn on and off in the menu are reloaded and applied by Claude Code for you when you close the menu. If doing so would invalidate the prompt cache, it holds off on applying them and tells you, and only then do you need /reload-plugins --force.
    • Since 2.1.287, plugins can also contain Mods. A Mod is a JavaScript or TypeScript function that reacts to events such as tool calls, prompt submissions, and screen drawing. It runs inside Claude Code and changes how Claude Code itself behaves, for example by adding panels to the screen or blocking and changing tool calls.
    • Some Claude Code features, such as the /diff panel, are also built as built-in Mods, so you can see them in the Built-in item of the Installed tab and turn them off. A Mod is code that runs with your permissions, so install only Mods from sources you trust.
  • /reload-plugins [--force]
    • Reloads active plugins without restarting and shows the number of components reloaded and any load errors.
    • If the loaded MCP tools would change and invalidate the prompt cache, it warns you and skips the reload, and passing --force forces the reload.
  • /skills
    • Shows the list of available skills.
    • Filter by name, description, or source, sort by token count with t, change a skill's visibility (whether to show it to Claude and in the / menu) with Space or Enter, then save and close with Esc.
  • /skill-doctor
    • Shows how much context each skill takes up and how often it's used, to help you find skills you can turn off.
  • /reload-skills
    • Reloads skills added or changed on disk during the session.
    • You don't need to restart the session while testing a skill you're editing.
  • /chrome
    • Sets up the integration with the Claude in Chrome extension and checks the connection status.

    • The top of the screen shows the integration status (Status) and whether the extension was detected (Extension), and from the list below you choose to install the extension, manage site permissions, reconnect, or enable it by default.

      The /chrome settings screen

    • Turning on Enabled by default connects automatically in every session. To turn it on or off for a single session, run claude --chrome or claude --no-chrome.

    • Which sites Claude can browse, click, and type into follows the extension's site permission settings.

  • /claude-in-chrome (skill)
    • Loads browser automation instructions so that Claude operates the connected Chrome browser directly.
    • It clicks, types, takes screenshots, and checks console logs in a new tab of your existing browser session, so you can use sites you're already logged in to as they are.
    • If the extension isn't installed, it shows installation guidance when Claude needs the browser and connects on the spot, so you don't need to run /chrome in advance.
  • /artifacts
    • Artifacts are a feature that uploads web pages Claude made to claude.ai so you can share them by link.
    • It lists artifacts you published or that were shared with you, and lets you attach the selected artifact to the session, open it in the browser, or copy its link.
    • The list is divided into All, Mine, and Shared tabs, and artifacts published in this session appear at the top. When you publish an artifact in a session, its name appears below the input box, and selecting it opens the same list.
  • /design [brief] (skill)
    • Draws design drafts such as screen mockups, screen flows, landing pages, and posters as multiple artboards on one canvas and publishes them as an artifact.
    • You can edit the published canvas directly in a desktop browser, your edits are saved automatically, and you can export each artboard as PNG or PDF.
    • Example: /design the settings screen of a mobile banking app
  • /slides [brief] (skill)
    • Makes a new presentation from what you give it and publishes it as a Claude Slides artifact.
    • It appears in the list only when Slides templates are available on your account.
    • Example: /slides quarterly review for the platform team
  • /design-sync [name] (skill), /design-login
    • Converts the repository's React design system (components) and uploads it to Claude Design (claude.ai/design), a design generation tool.
    • Once uploaded, the designs Claude Design makes use the project's real components rather than arbitrary UI.
    • Authenticate your claude.ai account first with /design-login. The first sync can take several hours on large repositories.
  • /ide
    • Manages and checks the integration with the Claude Code extension for editors such as VS Code.
    • Once connected, code you select in the editor is automatically included in the context, and you can review Claude's suggested changes in the editor's diff view.
  • /install-github-app
    • Installs the Claude GitHub App in the repository and, if needed, also sets up a GitHub Actions workflow and secrets.
    • It supports only github.com repositories.
  • /web-setup
    • Connects the GitHub account for Claude Code on the web using your GitHub CLI (gh) login, so cloud sessions can clone and push to GitHub repositories.
    • If you don't have gh, you can connect by approving the GitHub App during web (claude.ai/code) onboarding.
  • /install-slack-app
    • Installs the Slack app, opening the browser to complete OAuth authentication.
  • /claude-api [subcommand] (skill)
    • When you build an app with the Claude API, it loads API and Managed Agents material for your project's language to help Claude write code that follows the latest spec.
    • It also activates automatically when your code imports anthropic or @anthropic-ai/sdk.
    • Its subcommands are migrate (update code for a new model), upgrade (bump the SDK major version), managed-agents-onboard (guide to creating a Managed Agent), prompt-audit (check prompts written for older models), cost-optimize (apply ways to cut API costs), and build-eval and hillclimb (write an eval set and improve iteratively).
  • /dataviz, /artifact-capabilities, /artifact-diagramming, /workflow-authoring, /plugin-authoring (skill)
    • Load reference material needed for specific tasks, such as chart design, artifact capabilities, diagramming, writing workflow scripts, and writing Mods.
    • Claude usually loads them on its own when needed, so you'll rarely run them yourself. For example, if you ask for a Mod, Claude can load /plugin-authoring, write the Mod, and even install it.

# Remote and other

/remote-control, /desktop, and /teleport all let you continue your current work somewhere else, but they differ in which direction the session moves and where it actually runs.
/teleport brings a cloud session into the terminal, /desktop moves a terminal session to the desktop app, and /remote-control leaves the session in the terminal and only lets you operate it from another device.

Three commands for continuing a session somewhere else

  • /remote-control, /rc
    • Connects the current local session so you can keep operating it from claude.ai/code or the Claude mobile app.

    • The session keeps running on your local machine, so it uses your local environment as is, including files, tools, and MCP servers, and the web and mobile screens act as windows for operating that session remotely.

    • You can start work at your desk and pick it up on your phone, sending messages from the terminal, the web, or your phone in turn.

    • The first time you run it, a screen asks whether to connect, and choosing Enable Remote Control shows the session URL.

    • Running it again while connected opens a screen where you choose to disconnect (Disconnect this session), show a QR code to scan with your phone (Show QR code), or continue (Continue).

      Running Remote Control again while connected

    • You must be logged in with a claude.ai subscription to use it.

  • /desktop, /app
    • Moves the current session to the Claude desktop app and continues it there.
    • It saves the session, opens it in the desktop app's Code tab, and then quits the CLI, so you're simply switching from the terminal to the app on the same computer.
    • Conversely, running /resume in the desktop app's input box lets you pick a session started in the CLI and continue it in the app.
    • It's available only on macOS or x64 Windows when you're logged in with a Claude subscription.
    • Before starting a session, you can also run claude --desktop in the terminal to open the current directory directly in the desktop app, and passing --continue or --resume <session ID> along with it opens that session.
  • /teleport, /tp
    • Brings a cloud session you were working on at claude.ai/code into the current terminal so you can continue working.
    • Running it opens a session picker, and it brings in the selected session's working branch and conversation together.
    • It switches the working branch, so if you have uncommitted changes, it first asks whether to stash them.
    • The session you bring in is a copy, so work you continue in the terminal isn't reflected in the original cloud session. There is also no feature for sending a terminal session to the cloud.
    • You must run it in a directory where the same repository is checked out, and you need a claude.ai subscription. To bring a session in directly from the terminal, run claude --teleport <session ID>.
  • /remote-env
    • Chooses the default environment used by sessions that run in the cloud.
    • An environment is the container configuration a cloud session runs in, including environment variables, a setup script, and the level of network access.
    • This command only chooses the default; you create and edit environments on the web (claude.ai/code).
  • /mobile, /ios, /android
    • Shows a QR code for downloading the Claude mobile app.
  • /voice [hold|tap|off]
    • Turns voice input on or off, and it requires a claude.ai account.

    • When it's on, the recording method and dictation language are shown, and a hold space to speak hint appears below the input box. While recording, an indicator that it's listening appears above the input box, and the dictated text fills the input box right away.

      Voice input turned on with /voice

    • hold records while you hold down Space, and tap starts recording with one press and stops with another. If the dictated text is three words or more, it's sent as is; if it's shorter, it only fills the input box.

    • The dictation language follows the language setting, the same one used for the response language, so to dictate in another language, set that language in /config.

    • You can change the recording key with the voice:pushToTalk item in the keybindings settings.

  • /bug [report], /share
    • Reports a bug or shares the conversation.
    • You choose how much of the session history to include, and it's sent only after you confirm on the consent screen.
    • If you're logged in with an Anthropic account, it's sent to Anthropic. In third-party provider environments such as Bedrock, it's saved as a file in ~/.claude/feedback-bundles/ so you can deliver it yourself.
  • /feedback [report]
    • Sends product feedback about Claude Code, using the same screen and consent process as /bug.
    • If Claude drafted feedback during the session, running it without arguments opens the list of drafts so you can review and send or delete them.
  • /team-onboarding
    • Analyzes the last 30 days of session, command, and MCP server usage stored on this machine and generates an onboarding guide that a teammate can paste as their first message to follow the same setup.
    • The result is a Markdown document, so you can review its contents yourself before sharing it, and on paid claude.ai plans it also creates a share link your teammate can open right away.
  • /radio, /stickers
    • /radio plays a lo-fi radio station (Claude FM) in the browser, and /stickers opens the page for ordering Claude Code stickers.

# Code review and verification

Choose the command for checking and reviewing changes based on your goal.

Goal Command
Check what changed yourself /diff
Find bugs and things to clean up /code-review
Clean up code only, without bug hunting /simplify
Check for security vulnerabilities /security-review
Run the app and check that it works /verify, /run
  • /diff
    • Shows uncommitted changes in the working tree, including edits Claude made.

    • With fullscreen rendering, a diff panel opens next to the conversation and updates automatically whenever Claude edits a file or runs a shell command. You can watch changes pile up as you keep working.

      The diff panel open next to the conversation

    • The panel opens in a Git repository when the terminal is at least 110 columns wide, and if it's too narrow, a message asks you to widen it.

    • Clicking a row in the file list jumps to that file, and selecting lines of code with the mouse attaches them to your next prompt so you can ask about specific code.

    • By default, the panel shows only changes made in this session. Files you edited before the session started are collapsed at the bottom of the list as something like +1 file edited before this session (show), and if nothing has been edited yet, No changes this session appears.

    • Each time you press Ctrl + X followed by B, the comparison base changes, and the current base is shown below the file count.

      The diff panel's comparison bases, cycled with Ctrl+X then B

    • uncommitted (vs HEAD) shows all uncommitted changes, including those made before the session started, and branch vs main adds the commits made since the branch split off from the default branch. The second name follows the repository's default branch, so it may also appear as branch vs master.

    • Use branch vs main when you want to check all the work on the current branch at once, and leave it on the default base when you only want to see what Claude just changed.

    • To close it, run /diff again or click the close button at the top right of the panel.

    • If the terminal is at least 144 columns wide, it opens automatically when Claude starts editing files. After you open it yourself once, it also opens automatically at 110 columns or more, and if you close it, it stays closed in later sessions as well.

    • Since 2.1.287, this panel is drawn by a built-in Mod (cc-plugin-diff). If you turn off this Mod in /plugin, the /diff command remains, and the version built into Claude Code runs instead.

    • With the default renderer, a diff viewer opens in place of the input box. Switch between all uncommitted changes (Current) and per-prompt changes with the left and right arrow keys, pick a file with the up and down arrow keys, and press Enter to see its contents.

  • /code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [--max-findings n|all|default] [target], /review (skill)
    • Runs a code review that looks for bugs in the branch's commits ahead of upstream and in uncommitted changes, and depending on the model and level, it also looks for improvements in reuse, simplification, and efficiency.
    • If you pass a PR number, branch, or path as the target, it reviews that target instead of your local changes. Example: /code-review high 1234
    • low reports only high-confidence issues, so it has few false positives, while medium through max widen the scope but may also include lower-confidence items. With Opus 5.5 or Sonnet 5.5, from medium on it also reports code cleanup and CLAUDE.md rule violations.
    • If you leave out the level, it reuses the level between low and max that you last typed.
    • The number of findings it reports is capped, but you can set the number, as in --max-findings 20, or have it report all of them with --max-findings all. The value you set carries over to later reviews until you pass --max-findings default.
    • --fix applies the findings directly to the working tree, and --comment leaves them as inline comments on the GitHub PR. On a GitLab MR, it leaves a single note with the glab CLI, and if glab isn't installed, it prints the results in the terminal.
    • ultra runs Ultrareview, a deep review by multiple agents in the cloud. It works only when your account can use Ultrareview; otherwise it falls back to a local review in the current session. On accounts that can use it, /ultrareview is an alias for the same command.
    • The Pro and Max plans include 3 free runs per account as a one-time offer, and after you use them up, you need usage credits.
    • When reviewing a github.com PR with ultra, passing --post as well starts with the option to post the finished results to the PR already selected.
    • /review used to be a separate command for a quick read-only PR review, but it's now an alias for /code-review.
    • Fixes applied with --fix by a background review aren't recorded in checkpoints, so you can't undo them with /rewind; revert them with Git if needed.
  • /simplify [target] (skill)
    • Runs review agents in parallel on the code you just changed, from four angles (reusing existing helpers, simplification, efficiency, and level of abstraction), and applies the fixes too.
    • It's a cleanup-only review that doesn't look for bugs, so use it to polish your code after finishing a feature and before committing.
    • You can pass a path or PR to review a specific target only, and if your goal is finding bugs, use /code-review.
  • /security-review
    • Analyzes the changes between the current branch and the remote default branch for security vulnerabilities such as injection, authentication problems, and data exposure.
    • It needs an origin remote repository as the comparison base.
  • /verify (skill)
    • Builds and runs the app itself to check that the current changes actually work.
    • Rather than relying on test or type check results, it directly operates the points where the change shows up (CLI, API, screens, etc.), observes the results, and gives a verdict.
    • Unlike /code-review, which reads code to find bugs, it observes the results of running the app, and it works only when you run it yourself.
  • /run (skill)
    • Runs the project's app and operates it directly to show the changes working.
    • Unlike /verify, whose goal is a verdict, its goal is to let you see the results with your own eyes, for example by starting the development server and showing the changed screen.
  • /run-skill-generator (skill)
    • Figures out how /run and /verify can build and run this project's app in a clean environment (install commands, environment variables, run scripts) and records it as a project-specific skill.
    • If you run it once in a project where the run method is hard to infer because it needs a database or env files, /run and /verify follow the recorded method from then on.
  • /autofix-pr [prompt]
    • Creates a Claude Code on the web session that watches the current branch's PR and pushes fixes when CI fails or review comments come in.
    • The watching session runs in the cloud, so it keeps working even after you quit Claude Code locally.
    • You can set the scope of its response with a prompt, as in /autofix-pr fix only lint and type errors.
    • It needs the gh CLI and access to Claude Code on the web.

# Conversation branching and background

These commands let you try a different direction while keeping the current conversation, or split off work and hand it off.
All four commands inherit the conversation context so far, but they differ in which conversation you stay in after running the command and where the results come back.

Four commands for splitting a conversation

  • /branch [name]
    • Creates a branch of the conversation at the current point and switches to it.
    • The original conversation stays as a separate session, and you can go back by running /resume with the original session ID shown in the confirmation message.
    • Unlike Git branches, there is no concept of merging; you end up with two independent sessions that split from the same point.
    • It's useful for trying a different approach without losing the original, and in the terminal you can get the same effect with claude --continue --fork-session.
  • /fork [prompt]
    • Creates a new background session that copies the current conversation, while you keep working in the original conversation.
    • If you pass a prompt, the copy starts on that task right away; if you leave it out, it waits for its first instruction.
    • The copy inherits the model, permission mode, effort level, added directories, and granted permissions. Inside a Git repository, it's also told to create its own worktree before editing code, so it works without mixing files with the original work.
    • The copy appears as a row in the agent view, which you open with the claude agents command in the terminal. Select the row and send it instructions with Space, or attach to it with Enter to talk to it.
    • Example: /fork create a draft PR from the work so far
  • /subtask <task>
    • Hands a subtask to a subagent that inherits the current conversation as is, while you keep working.
    • The subagent works in the background, and when it's done, only the result comes back to the current conversation.
    • The details of the subtask don't pile up in the main conversation, so you save context.
    • Example: /subtask draft unit tests for the parser code changed so far
  • /background [prompt], /bg
    • Hands the entire current session to a background agent and clears the terminal.
    • If Claude was in the middle of responding, that response continues in the background, and if you pass a prompt, it sends that instruction last before handing the session off.
    • You can find the handed-off session in the agent view, opened with the claude agents command, and attach to it again.
    • Pressing the left arrow key while the input box is empty moves the session to the background and opens the agent view right away.
  • /stop
    • Available only while attached to a background session, it stops that session.
    • Stopping keeps the conversation history and worktree.
    • To detach without stopping, run /exit or press the left arrow key.
  • /tasks, /bashes
    • Shows and manages subagents and shell commands running in the background in the current session, including subagents that have already finished.

    • Running it shows background shells (Shells), running subagents (Local agents), and finished work (Completed) separately, and each subagent also shows the model it ran on. For models that let you set an effort level, the level is shown as well.

      The /tasks background work screen

    • Pick a task with the up and down arrow keys and press Enter to see its status, run time, command, and output, and stop it with x.

    • Background work that Claude Code runs on its own is collapsed into a single System tasks row, which expands when you press Enter on it.

    • While background work is running, an indicator such as 1 shell appears below the input box, and pressing the down arrow key while the input box is empty also opens this screen.

  • /list-agents, /peers
    • Lists the subagents, agent team members, other Claude Code sessions on the same machine, and your cloud sessions that Claude can send messages to, along with the name to use for each.
    • It's available only in sessions with cross-session messaging turned on.
  • /agents
    • It used to open a screen for creating and managing subagents, but now it only prints a notice.
    • Manage subagents by asking Claude to create them, or by editing the files in the .claude/agents/ and ~/.claude/agents/ folders yourself.