Claude Code commands: every slash command, and your own
Claude Code's built-in slash commands grouped by use, how custom commands became skills, where the files go, arguments, and the claude CLI commands.
Type / at the Claude Code prompt to see every command available to you, and keep typing to filter. The ones you will use most: /clear (fresh conversation), /compact (summarise to free context), /context (what is filling the window), /resume, /model, /effort, /plan, /config, /permissions, /mcp, /usage and /help. Custom commands have been merged into skills: an old .claude/commands/deploy.md still gives you /deploy, but new ones go in .claude/skills/<name>/SKILL.md (project) or ~/.claude/skills/<name>/SKILL.md (all your projects), and $ARGUMENTS receives whatever you type after the name. Outside a session, the commands people mean are claude -p, claude -c, claude --resume, claude mcp and claude update. Checked against the docs and version 2.1.332 on November 28, 2026.
How slash commands work
A command is recognised only at the start of a message, and in the commands reference’s words, “Text that follows the command name becomes its arguments.” Send one while Claude is still answering and it queues until the turn ends, except a few such as /status, /tasks and /usage, which run straight away. The menu only shows what your platform, plan and setup allow, so a command from a blog post may simply not appear for you; typed anyway, it answers with “Unknown command” or a reason. A few commands, such as /heapdump, stay out of the menu until you type the whole name.
Some entries in the list are not coded into the CLI at all: the docs mark them as bundled skills, which “work like skills you write yourself: a prompt handed to Claude.” /code-review, /loop, /batch, /simplify and /doctor are among them. That is why they can take free text and why their behaviour depends on the model.
The built-in commands, grouped
The reference lists well over a hundred entries in alphabetical order. These are the ones that matter day to day, by what they are for. <arg> is required, [arg] optional.
The session and its history
| Command | What it does |
|---|---|
/clear [name] | New conversation with empty context; the old one stays in /resume. Aliases /reset, /new |
/resume [session] | Resume by ID or name, or open the picker. Alias /continue |
/rename [name] | Name the session (without a name, it makes one up from the conversation) |
/branch [name] | Copy the conversation at this point and switch into the copy, keeping the original |
/rewind | Roll the conversation and/or code back to a checkpoint. Aliases /checkpoint, /undo |
/export [filename] | Save the conversation as plain text |
/copy [N] | Copy the last (or Nth-latest) reply; press w in the picker to write it to a file instead, useful over SSH |
/btw [question] | A side question that does not go into the conversation |
/recap | One-line summary of the session so far |
/exit | Quit. Alias /quit |
Context and memory
| Command | What it does |
|---|---|
/context [all] | A coloured grid of what is using the context window, with suggestions |
/compact [instructions] | Summarise the conversation so far to free space; the optional text tells it what to keep |
/autocompact [auto|<tokens>] | How full the window gets before compaction starts on its own (v2.1.221+) |
/memory | Edit CLAUDE.md files and turn auto memory on or off |
/init | Write a starting CLAUDE.md for the project |
/add-dir <path>, /cd <path> | Give the session another directory, or move it to a new one |
When to compact rather than clear, and what survives a compaction, is in the Claude Code compact guide; what belongs in the file /init writes is in the CLAUDE.md guide.
Model, mode and settings
| Command | What it does |
|---|---|
/model [model] | Switch model and save it as the default for new sessions; in the picker, s switches for this session only |
/effort [level] | low to xhigh, max (this session only) or auto; status prints it |
/fast [on|off] | Toggle fast mode |
/plan [description] | Enter plan mode, optionally starting on a task |
/config [key=value ...] | Open Settings, or set a key directly, such as /config model=sonnet; /config --help lists the keys. Alias /settings |
/permissions | Allow, ask and deny rules for tools. Alias /allowed-tools |
/status | Version, model, account and connectivity |
/output-style [style] | List or switch output styles (v2.1.269+) |
/theme, /statusline, /keybindings, /terminal-setup, /tui | Colours, the status line, shortcuts, Shift+Enter for newlines, and the classic or fullscreen renderer |
Plan mode has its own guide, and so does the settings.json file that /config and /permissions write to.
Account, usage and updates
| Command | What it does |
|---|---|
/login, /logout | Sign in to or out of your Anthropic account |
/usage | Session cost, plan usage limits and activity. /cost and /stats are aliases |
/rate-limit-options | What you can do when a claude.ai limit blocks a request |
/upgrade, /usage-credits | Open the plan or usage-credit page; over SSH both print the URL instead. /usage-credits was /extra-usage |
/restart | Restart and resume the session to apply an installed update (Pro, Max or Ultra, native install on macOS or Linux, v2.1.288+). Alias /update |
/release-notes | The changelog, by version |
Tools, extensions and parallel work
| Command | What it does |
|---|---|
/mcp | MCP servers and their sign-ins; /mcp reconnect all retries every failed server |
/skills, /reload-skills | List skills; re-scan skill and command folders without restarting |
/plugin [subcommand], /reload-plugins | Install, enable and reload plugins |
/hooks | View hook configuration |
/agents | Now only a reminder to ask Claude for a subagent or edit .claude/agents/ yourself; the interactive editor is gone |
/tasks | Background work in this session. Also /bashes |
/fork [prompt], /subtask <task>, /background | Copy the conversation into a background session, hand a side task to a forked subagent, or send the whole session to the background |
/loop [interval] [prompt] | Repeat a prompt while the session is open, such as /loop 5m check if the deploy finished |
/ide, /chrome, /remote-control | IDE integration, Claude in Chrome, and control from claude.ai or the app (alias /rc) |
Review and troubleshooting
| Command | What it does |
|---|---|
/diff | What changed in the working tree |
/code-review [level] [--fix] [target] | Review the diff, a PR, a branch or a path for bugs; ultra runs it in the cloud. Alias /review |
/security-review | Security pass over your branch against origin’s default branch; needs an origin remote |
/batch <instruction> | Split a large change into 5 to 30 units, each in its own worktree |
/doctor, /debug | Setup checkup that can apply fixes (alias /checkup); debug logging for this session |
/bug, /feedback | Report a bug with session context (alias /share), or send feedback |
/help | Help and the commands available |
Commands that no longer exist
Older guides still show these. /vim was removed in v2.1.92; Vim keys are now under /config → Editor mode. /pr-comments went in v2.1.91, and the docs say to ask Claude for the comments directly. /ultraplan is removed in favour of plan mode, and /agents no longer opens an editor.
Write your own command
The skills docs now say “Custom commands have been merged into skills.” Both forms give you a /name command:
| File | You type | Scope |
|---|---|---|
.claude/skills/fix-issue/SKILL.md | /fix-issue | This repository; commit it to share it |
~/.claude/skills/fix-issue/SKILL.md | /fix-issue | All your projects on this machine |
.claude/commands/fix-issue.md | /fix-issue | The older single-file form, still loaded |
.claude/commands/frontend/component.md | /frontend:component | Subfolders become a prefix |
The docs advise a skill for new work, because a skill folder can hold supporting files beside SKILL.md. If a skill and a command file share a name, the skill wins. A minimal project command:
mkdir -p .claude/skills/fix-issue
cat > .claude/skills/fix-issue/SKILL.md <<'EOF'
---
description: Fix a GitHub issue by number. Use when asked to fix an issue.
argument-hint: "[issue-number]"
disable-model-invocation: true
---
Read GitHub issue #$ARGUMENTS with gh issue view, find the cause,
fix it, and run the tests before you stop.
EOFCopiedThen /fix-issue 123 runs it. If the skill was added mid-session, /reload-skills picks it up without a restart. The frontmatter fields that shape a command:
description: what it does and when to use it; Claude reads this to decide whether to load it on its own, and the listing cuts it (withwhen_to_use) at 1,536 characters.argument-hint: the hint shown in autocomplete, such as[issue-number].disable-model-invocation: true: only you can run it, with/name. Use it for anything with side effects, like a deploy.user-invocable: false: the opposite, hidden from the menu, for background knowledge only Claude should load.allowed-tools: tools Claude may use without asking during that turn; the grant clears with your next message.model: the model for the turn when you run it with/name.
Arguments
$ARGUMENTS is everything you typed after the name. $0, $1 and so on (short for $ARGUMENTS[N]) pick single arguments, counted from zero, with shell-style quoting: /my-skill "hello world" second makes $0 expand to hello world and $1 to second. The arguments field names them instead, for $name substitution. If the file has no placeholder at all, Claude Code appends ARGUMENTS: <your input> to the end so Claude still sees what you typed.
A line such as !`git diff HEAD` runs the shell command before the prompt is sent and puts its output in its place, so the command arrives with live data. The rest of the skill format, supporting files and running a skill in a subagent, is in the Claude Code skills guide.
MCP servers can add commands too: their prompts appear in the / menu, and from version 2.1.332 their skills show as server:skill (a beta). Connecting the servers is covered in the MCP servers guide.
The CLI commands people mean by “commands”
These run from your shell, not inside a session, and are what you reach for on a server or in a script. From the CLI reference:
claude # interactive session
claude "explain this project" # interactive, with a first prompt
claude -p "explain this function" # answer once and exit
cat logs.txt | claude -p "explain" # pipe content in
claude -c # continue the latest conversation in this directory
claude -r "auth-refactor" "Finish this PR" # resume by ID or name
claude -n "my-feature-work" # name a new session so --resume can find it
claude update # update to the latest version
claude doctor # install and settings diagnostics, no session
claude auth status # JSON; exit code 0 if signed in, 1 if not
claude -v # versionCopiedNote that claude -c skips sessions started with claude -p; claude -p --continue includes them. For scripts, -p combines with --output-format (text, json or stream-json), --max-turns and --max-budget-usd, and --bare skips loading your hooks, skills, plugins, MCP servers and CLAUDE.md so it starts faster. Running that on a timer, and the sign-in it needs, is in running Claude Code headless on a schedule.
MCP servers are managed from the shell with claude mcp:
claude mcp add --transport http notion https://mcp.notion.com/mcp
claude mcp list
claude mcp get notion
claude mcp remove notion
claude mcp login notion --no-browser # over SSH: prints the sign-in URL instead of opening a browserCopiedTwo more that matter on a headless machine. claude setup-token makes a long-lived OAuth token for CI and scripts from a Claude subscription; it prints the token to the terminal without saving it, so copy it straight into a secret store rather than a command line. And --dangerously-skip-permissions is the same as --permission-mode bypassPermissions: it turns off permission prompts and safety checks, so almost every tool call runs unasked and nothing stands between Claude and a prompt injection. The docs say to use it only in an isolated environment, such as a container or VM without internet access, where Claude Code cannot damage the host; for far fewer prompts with checks still running, they point to auto mode (--permission-mode auto). A mistyped subcommand does not start a session: claude udpate prints Did you mean claude update? and exits. If claude update itself fails, the update guide covers why.