Skip to content

Reference

Command reference

Every Claude Code command in one place, each with the date it was last checked against the documentation. Removed ones stay, with the version they disappeared in, because you still meet them in other people's guides and in your own scripts.

182 items · 2 removed · The whole reference was checked on August 22, 2026.

Session and conversation

  • /add-dir<path>

    Adds another working directory so Claude can read and edit files outside the one you started in.

  • /background[prompt]

    Detaches the session so it keeps working as a background agent.

  • /branch[name]

    Creates a branch of the conversation so you can try a different direction without losing this one.

  • /cd<path>

    Moves the session to a different working directory.

  • /clear[name]

    Starts a new conversation with empty context.

  • /exit

    Exits the CLI.

  • /fork[prompt]

    Copies the current conversation into a new background session.

  • /remote-control

    Continues the local session from another device.

  • /resume

    Returns to an earlier conversation.

  • /rewind

    Rolls both the code and the conversation back to an earlier checkpoint.

  • /teleport

    Pulls a web session down into the terminal.

  • claude[query]

    Starts an interactive session in the current directory, with an optional first prompt.

  • claude project purge[path]

    Deletes all local Claude Code state for a project: transcripts, task lists, debug logs, file-edit history, prompt history, and the project's entry in ~/.claude.json.

  • claude remote-control

    Starts a Remote Control server so you can drive Claude Code from claude.ai or the Claude app, with no local interactive session.

  • --bg

    Starts the session as a background agent and returns to the shell right away, printing the session ID.

  • --cloud<task|session>

    Creates a new web session on claude.ai from a task description, or targets an existing one when you pass its ID or URL.

  • --continue

    Loads the most recent conversation in the current directory, without asking which one.

  • --environment<environment-id>

    Creates a cloud session that runs on a self-hosted environment, named by an ID that starts with ccpool_.

  • --exec<command>

    Runs a shell command as a PTY-backed background job instead of starting a Claude session.

  • --fork-session

    When resuming, gives the conversation a new session ID instead of writing back into the original.

  • --from-pr<pr>

    Opens the session picker filtered to sessions linked to one pull request.

  • --name<name>

    Gives the session a display name, shown in /resume and in the terminal title.

  • --no-session-persistence

    Keeps the session off disk, so nothing is saved and nothing can be resumed. Print mode only.

  • --ref<branch>

    With --environment, bases the new session's checkout on a named ref instead of your local HEAD.

  • --remote

    Deprecated alias for --cloud, including its existing-session form.

  • --remote-control[name]

    Starts an interactive session with Remote Control on, so the same session can also be driven from claude.ai or the Claude app.

  • --remote-control-session-name-prefix<prefix>

    Sets the prefix for automatically generated Remote Control session names.

  • --resume[session]

    Resumes a session by ID or name, or opens a picker when you give neither.

  • --session-id<uuid>

    Uses a session ID you choose for the conversation, which must be a valid UUID.

  • --teleport

    Resumes a web session in your local terminal.

  • --tmux

    Creates a tmux session for the worktree.

  • --worktree[name|#pr]

    Starts the session in an isolated git worktree at <repo>/.claude/worktrees/<name>.

Model and configuration

  • /advisor[model|off]

    Turns the server-side advisor tool on for this session, or off.

  • /autocompact[auto|<tokens>]

    Sets the window at which the conversation compacts itself.

  • /color[color|default]

    Sets the colour of the prompt bar.

  • /config[key=value ...]

    Opens the settings interface, or sets a key straight from the command line.

  • /effort[level|auto|status]

    Sets the effort level, from low to xhigh, plus max, ultracode and auto.

  • /fast[on|off]

    Toggles fast mode.

  • /keybindings

    Opens the keyboard shortcuts file for editing.

  • /model[model]

    Switches the model for this session.

  • /theme

    Configures the colour theme.

  • --advisor<model>

    Turns on the server-side advisor tool for this session, with a model alias or a full model ID.

  • --autocompact<auto|tokens>

    Sets the auto-compact window for this session without touching your saved settings.

  • --betas<headers>

    Adds beta headers to the API requests this session makes.

  • --effort<level>

    Sets the effort level for the session: low, medium, high, xhigh, max, or ultracode.

  • --fallback-model<models>

    Names the model, or the comma-separated chain of models, to fall back to when the primary one is overloaded or gone.

  • --model<model>

    Sets the model for this session, by alias (opus, sonnet, haiku, fable) or by full model ID.

Context

  • /btw[question]

    Asks a side question without adding it to the conversation.

  • /compact[instructions]

    Summarizes the conversation to free up context.

  • /context[all]

    Shows what is currently filling the context window.

  • /copy[N]

    Copies the last assistant response, or the Nth from the end.

  • /export[filename]

    Exports the conversation as plain text.

  • /init

    Creates a CLAUDE.md guide for the project.

  • /memory

    Edits CLAUDE.md files and turns automatic memory on or off.

  • --add-dir<paths...>

    Adds working directories so Claude can read and edit files outside the one you started in.

  • --append-subagent-system-prompt<text>

    Appends text to every subagent's system prompt, nested subagents included.

  • --append-system-prompt<text>

    Appends your text to the end of the default system prompt.

  • --append-system-prompt-file<path>

    Appends the contents of a file to the default system prompt.

  • --exclude-dynamic-system-prompt-sections

    Moves per-machine sections out of the system prompt and into the first user message.

  • --system-prompt<text>

    Replaces the entire default system prompt with text you give.

  • --system-prompt-file<path>

    Replaces the default system prompt with the contents of a file.

Code review

  • /code-review[low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]

    Reviews the current diff, a pull request, a branch or a path.

  • /diff

    Opens an interactive viewer for uncommitted changes.

  • /pr-comments[PR]Removed in 2.1.91

    Pulled the comments from a pull request into the session.

  • /security-review

    Checks the pending changes for security problems.

  • /simplify

    Reviews the changed code for reuse and simplification, then applies the fixes.

  • claude ultrareview[target]

    Runs ultrareview without an interactive session, prints the findings to standard output, and exits 1 when the review fails.

Work and tasks

  • /autofix-pr[prompt]

    Starts a session that watches a pull request and pushes fixes.

  • /batch<instruction>

    Decomposes a large change and runs the parts in parallel.

  • /deep-research<question>

    Fans out web searches and synthesizes a report.

  • /goal[condition|clear]

    Sets a condition for Claude to work toward.

  • /loop[interval] [prompt]

    Runs a prompt or a command repeatedly on a schedule.

  • /plan[description]

    Enters plan mode for a task.

  • /tasks

    Lists the background work of the current session.

  • /verify

    Verifies work that has been done.

  • --forward-subagent-text

    Emits subagent text and thinking in the output stream, so each subagent's transcript can be reconstructed.

  • --include-hook-events

    Includes hook lifecycle events in the output stream.

  • --include-partial-messages

    Includes partial streaming events in the output.

  • --init

    Runs Setup hooks with the init matcher before the session starts. Print mode only.

  • --init-only

    Runs Setup and SessionStart hooks and then exits, without starting a conversation.

  • --input-format<text|stream-json>

    Chooses the input format in print mode: text or stream-json.

  • --json-schema<schema>

    Requires the print-mode answer to be JSON that validates against a schema you supply.

  • --maintenance

    Runs Setup hooks with the maintenance matcher before the session starts. Print mode only.

  • --max-budget-usd<amount>

    Caps how many dollars a print-mode run may spend on API calls before it stops.

  • --max-turns<n>

    Limits how many agentic turns a print-mode run may take, and errors out when the limit is reached.

  • --output-format<text|json|stream-json>

    Chooses the output format in print mode: text, json, or stream-json.

  • --print

    Prints the answer and exits, without the interactive session.

  • --prompt-suggestions

    Emits a predicted next user prompt after each turn that produces one.

  • --replay-user-messages

    Re-emits user messages that came in on standard input back on standard output, as acknowledgment.

Diagnosis

  • /bug[report]

    Reports a bug or shares the conversation.

  • /debug[description]

    Turns on debug logging and helps track a problem down.

  • /doctor

    Runs a setup checkup and fixes what it can.

  • /feedback[report]

    Sends product feedback.

  • /heapdump

    Writes a heap snapshot for diagnosing memory use.

  • /insights

    Builds an HTML report about recent sessions.

  • /recap

    Writes a one-line summary of the current session.

  • /release-notes

    Opens the changelog in the version picker.

  • /status

    Shows the current status.

  • /usage

    Shows token usage for the session.

  • claude doctor

    Prints read-only installation and settings diagnostics without starting a session.

  • --ax-screen-reader

    Renders flat, screen-reader friendly output, without decorative borders or animations.

  • --bare

    Skips auto-discovery of hooks, skills, commands, subagents, plugins, MCP servers, auto memory, and CLAUDE.md so a scripted call starts faster.

  • --debug[categories]

    Turns on debug output, optionally narrowed to categories such as mcp or startup.

  • --debug-file<path>

    Writes debug logs to a file path you choose, and turns on debug mode along the way.

  • --safe-mode

    Starts with every customization disabled, to find out whether your own configuration is the problem.

  • --verbose

    Shows the full turn-by-turn output instead of the condensed view.

  • --version

    Prints the version number and exits.

Agents

  • /agents

    Manages subagent configurations.

  • /list-agents

    Lists subagents, team members and sessions.

  • /subtask

    Hands a side task to a subagent.

  • claude agents

    Opens agent view, where you watch and dispatch parallel background sessions.

  • claude attach<id>

    Attaches this terminal to a background session so you can follow it and steer it.

  • claude daemon status

    Prints the background-session supervisor's state, version, socket directory, and worker count.

  • claude daemon stop--any [--keep-workers]

    Stops the background-session supervisor and the sessions it hosts.

  • claude logs<id>

    Prints recent output from a background session without attaching to it.

  • claude respawn<id>

    Restarts a background session, running or stopped, with its conversation intact.

  • claude rm<id>

    Removes a background session from the list.

  • claude stop<id>

    Stops a background session.

  • --agent<name>

    Runs the session as a named agent, overriding the agent setting.

  • --agents<json>

    Defines subagents inline, as JSON, for this session only.

  • --teammate-mode<mode>

    Chooses how agent team teammates are displayed: in-process, auto, tmux, or iterm2.

Permissions and security

  • /fewer-permission-prompts

    Scans your transcripts and builds an allowlist of the read-only calls you keep approving.

  • /permissions

    Manages the allow, ask and deny rules for tool permissions.

  • /privacy-settings

    Shows and updates privacy settings.

  • claude auto-mode defaults

    Prints the built-in auto mode classifier rules as JSON.

  • claude auto-mode reset

    Restores the default auto mode configuration by removing the autoMode section from your user settings.

  • --allow-dangerously-skip-permissions

    Adds bypassPermissions to the Shift+Tab cycle without starting the session in it.

  • --allowedTools<rules...>

    Lists the tools and call patterns that run without asking for permission.

  • --dangerously-skip-permissions

    Skips permission prompts, which is the same as starting in bypassPermissions.

  • --disallowedTools<rules...>

    Lists deny rules, which either remove a tool outright or refuse only the calls that match.

  • --enable-auto-modeRemoved in 2.1.111

    Turned on auto mode for the session, before auto mode became part of the standard permission cycle.

  • --permission-mode<mode>

    Starts the session in a permission mode: default, acceptEdits, plan, auto, dontAsk, bypassPermissions, or manual.

  • --permission-prompt-tool<tool>

    Names an MCP tool that answers permission prompts when nobody is at the terminal.

  • --tools<names>

    Restricts which built-in tools exist for the session: an empty value for none, default for all, or a list of names such as Bash,Edit,Read.

Integrations and environment

  • /chrome

    Configures Claude in Chrome.

  • /design-login

    Authorizes access to the design system.

  • /design-sync[hint]

    Converts a React design system into Claude Design.

  • /hooks

    Shows the hook configuration.

  • /ide

    Manages IDE integrations.

  • /import[codex|gemini] [--dry-run] [--yes]

    Imports configuration from another coding agent.

  • /install-github-app

    Installs the Claude GitHub App.

  • /install-slack-app

    Installs the Claude Slack app.

  • /mcp[reconnect <server>|enable|disable [<server>|all]]

    Manages Model Context Protocol server connections.

  • /plugin[subcommand]

    Manages plugins.

  • claude gateway

    Starts the self-hosted Claude apps gateway, which puts SSO and policy in front of Claude Code on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry.

  • claude import[codex|gemini]

    Starts a session that runs /import to bring configuration from another coding agent into Claude Code.

  • claude mcp

    Configures Model Context Protocol (MCP) servers from the terminal: add them, list them, remove them.

  • claude mcp login<name>

    Runs a configured MCP server's OAuth flow without opening the interactive /mcp panel.

  • claude mcp logout<name>

    Clears the stored OAuth credentials for an MCP server.

  • claude plugin

    Manages plugins from the terminal: installs them, removes them, and lists what is enabled.

  • claude self-hosted-runner

    Registers this machine or container with a self-hosted environment and hosts Claude Code cloud sessions on your own infrastructure.

  • --channels<plugin:name@marketplace ...>

    Names the MCP servers whose channel notifications the session should listen for. Research preview.

  • --chrome

    Turns on the Chrome integration for web automation and testing.

  • --dangerously-load-development-channels

    Enables channels that are not on the approved allowlist, for local development.

  • --ide

    Connects to your IDE at startup when exactly one valid IDE is available.

  • --mcp-config<paths|json>

    Loads MCP servers from JSON files or inline strings, space-separated.

  • --no-chrome

    Turns the Chrome integration off for this session.

  • --plugin-dir<path>

    Loads a plugin from a directory or a .zip archive, for this session only.

  • --plugin-url<url>

    Fetches a plugin .zip archive from a URL, for this session only.

  • --setting-sources<user,project,local>

    Chooses which setting sources load: user, project, local, comma-separated.

  • --settings<path|json>

    Loads settings from a JSON file or an inline JSON string for this session.

  • --strict-mcp-config

    Uses only the MCP servers from --mcp-config and ignores every other MCP configuration.

Account and apps

  • /desktop

    Continues the session in the Claude Code desktop app.

  • /login

    Signs in to your Anthropic account.

  • /logout

    Signs out.

  • /mobile

    Shows a QR code for the Claude mobile app.

  • /passes

    Shares a free week with a friend, if you are eligible.

  • /upgrade

    Upgrades the plan, for users outside Enterprise.

  • claude auth login

    Signs you in to your Anthropic account from the terminal.

  • claude auth logout

    Signs you out of your Anthropic account.

  • claude auth status

    Prints authentication status as JSON, exiting 0 when you are signed in and 1 when you are not.

  • claude install[version]

    Installs or reinstalls the native binary, at a named version if you give one.

  • claude setup-token

    Generates a long-lived OAuth token for CI and scripts, and prints it once.

  • claude update

    Updates the installed Claude Code to the latest version.

Other

  • /artifacts

    Lists and manages artifacts.

  • /claude-api[migrate|managed-agents-onboard|prompt-audit]

    Loads reference material for the Claude API.

  • /dataviz[request]

    Gives design guidance for charts and dashboards.

  • /focus

    Toggles focus view, in fullscreen only.

  • /help

    Shows help and the available commands.

  • /powerup

    Teaches features through short interactive lessons.

  • /radio

    Opens the Claude FM lo-fi radio.

  • --disable-slash-commands

    Turns off all skills and commands for the session.