Claude Code · September 2026

Claude Code commands

The built-in slash commands, the CLI flags people actually type, the keyboard shortcuts, and how to add your own — verified against the current reference.

Built-in slash commands.

Type / in a session to open the menu. This is the set most people reach for; a few are bundled skills rather than commands, which changes nothing about how you type them. The complete table, aliases included, is the commands reference.

CommandWhat it does
/helpShow help and available commands
/clearStart a new conversation with empty context; aliases /reset, /new
/compact [instructions]Replace the history with a summary, optionally focused on what you name
/contextShow what is consuming the context window, as a grid
/usageToken usage and cost for the session; /cost is an alias
/statusSession status: login, model, provider, which settings files loaded
/configOpen the settings interface; alias /settings
/model [model]Switch model and save it as the default for new sessions
/effort [level]Set reasoning effort, low to max, or auto
/permissionsManage allow, ask, and deny rules; alias /allowed-tools
/plan [description]Enter plan mode from the prompt
/initGenerate a starting CLAUDE.md from the repository
/memoryEdit CLAUDE.md files and toggle auto memory
/resume [name]Switch to an earlier conversation
/rename <name>Name the current session so it can be resumed by name
/branch [name]Copy the conversation so far into a new branch and continue there
/rewindRoll code and conversation back to a checkpoint
/export [filename]Save the conversation as plain text
/diffInteractive diff of uncommitted changes and per-turn edits
/add-dir <path>Grant file access to another directory for this session
/cd <path>Move the session to a new working directory, keeping the conversation
/mcpManage MCP server connections and their authentication
/hooksBrowse configured hooks; read-only
/agentsSubagents, which now live in .claude/agents/ or ~/.claude/agents/
/skillsManage custom skills and view the bundled ones
/pluginManage plugins
/login, /logoutSign in to or out of your account
/doctorA setup checkup that diagnoses problems and can fix them; alias /checkup
/vimToggle Vim keybindings
/theme, /statuslineColour theme; the status bar below the prompt
/terminal-setupConfigure terminal integration
/release-notesRecent release notes
/bug [report]Report a bug or share the conversation; alias /share
/exitLeave; alias /quit
/remote-controlContinue this local session from another device
/background [prompt]Detach the session to run as a background agent; alias /bg
/tasksList background work, including finished subagents
/fork [prompt]Copy the conversation into a new background session and keep working here
/teleportPull a web session into this terminal
/desktopContinue the session in the desktop app; alias /app
/code-reviewReview the current diff or a PR for bugs and cleanups; alias /review
/loop [interval] [prompt]Run a prompt repeatedly while the session stays open
/btw [question]Ask a side question without adding it to the conversation
/fast [on|off]Toggle fast mode
/copy [N]Copy the last response to the clipboard

CLI flags you will actually type.

InvocationWhat it does
claudeStart an interactive session in the current directory
claude "query"Start interactive with an initial prompt
claude -p "query"Print mode: answer and exit; pipe input with cat file | claude -p "…"
-c, --continueReopen the most recent conversation in this directory
-r, --resume [name or id]Resume a specific session, or open the picker
-n <name>Name the session at startup so --resume <name> finds it
--fork-sessionWhen resuming, branch into a new session ID
--from-pr <number>Open the picker filtered to sessions linked to that pull request
--model <alias or id>Model for this session: sonnet, opus, haiku, or a full name
--permission-mode <mode>Start in default, acceptEdits, plan, auto, dontAsk, or bypassPermissions
--allowedTools, --disallowedToolsAdd allow or deny rules for the run, in permission-rule syntax
--add-dir <path>Grant extra working directories for this session
--settings <file or json>Layer settings above your files for this session
--mcp-config <file>Load MCP servers from JSON; --strict-mcp-config ignores every other source
--output-format jsonStructured output in print mode: text, json, or stream-json
--max-turns <n>Cap agentic turns in print mode
--append-system-prompt "…"Append text to the default system prompt
--dangerously-skip-permissionsSkip permission prompts; the same as --permission-mode bypassPermissions
--bgStart as a background session, hosted by a supervisor that outlives your shell
--teleportPull a web session into this terminal; needs a claude.ai subscription
--debugWrite a debug log to ~/.claude/debug/
claude updateUpdate now instead of waiting for the background check
claude doctorRead-only diagnostics for the install and settings
claude mcpConfigure MCP servers from the shell
claude setup-tokenMint a one-year OAuth token for CI, used as CLAUDE_CODE_OAUTH_TOKEN

Every flag, with examples: the CLI reference.

Keyboard shortcuts.

KeysEffect
Ctrl+CInterrupt; with nothing running, the first press clears the prompt and the second exits
Ctrl+DExit, on a second press within 800 ms
EscStop the current response or tool call; work so far is kept
Esc EscClear the draft, or, with an empty prompt, open the rewind menu
Shift+TabCycle permission modes
Ctrl+RReverse-search prompt history
Ctrl+OToggle the transcript viewer with tool detail
Ctrl+BBackground a running command or agent; tmux users press twice
Ctrl+GEdit the prompt in your default editor
Ctrl+SStash the prompt; press again on an empty prompt to restore it
Ctrl+LRedraw the screen
Ctrl+TToggle Claude’s task checklist
Ctrl+ZSuspend to the shell; fg resumes (Unix)
Option+P / Alt+PSwitch model without clearing the prompt
Option+T / Alt+TToggle extended thinking
Up / DownMove within a multiline prompt, then walk history
TabAccept an autocomplete suggestion
\ then Enter, Ctrl+J, or Shift+EnterInsert a newline; Shift+Enter is native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal
! at the startShell mode: run a command and add its output to the session
@File path autocomplete
? on empty inputToggle the shortcut help panel

Option-key shortcuts on macOS need Option configured as Meta in your terminal. /vim turns on Vim keybindings. Everything else: interactive mode.

Custom commands are skills now.

A custom slash command is a Markdown file. The older form is .claude/commands/deploy.md, which creates /deploy; it still works. The current form is a skill: .claude/skills/deploy/SKILL.md in a project, or ~/.claude/skills/deploy/SKILL.md for every project on the machine. Both create the same /deploy. A skill gets a directory for supporting files and can be loaded by Claude on its own when it is relevant, which a command file cannot. Personal skills beat project skills of the same name; a skill beats a command of the same name; plugin skills are namespaced as /plugin-name:skill-name so they never collide.

The file is YAML frontmatter followed by instructions. description tells Claude when the skill applies; argument-hint shows in autocomplete; allowed-tools grants tools for the turn that invokes it; model overrides the model for that turn; disable-model-invocation: true makes it something only you can run, which is right for anything with side effects; user-invocable: false hides it from the menu for background knowledge. Arguments arrive as $ARGUMENTS, or positionally as $0, $1, and so on. The full frontmatter is under skills.

--- description: Deploy the current branch to an environment argument-hint: [environment] disable-model-invocation: true allowed-tools: Bash(./scripts/deploy.sh *) --- Deploy the current branch to the $0 environment. Run ./scripts/deploy.sh $0, then report the URL it prints.
.claude/skills/deploy/SKILL.md

One more thing about where these run.

Every command on this page runs inside a terminal on the machine where claude was started, and the session it belongs to lives there too. /remote-control is Anthropic’s way to follow one session from another device; spawnd is the way to keep every session on every host you own reachable from one browser, with the terminal itself owned by a worker process on the host so that backgrounding stops being a discipline. The keys are the same either way — a spawnd session is the real terminal, not a chat view of it. Details at /claude-code-remote.

Start

Every command, on a host that stays on.

$curl -fsSL https://spawnd.dev/install.sh | sh
Sign up free
Install the daemon

Questions

How do I see all Claude Code commands?
Type / in a session to open the menu, or /help. A few commands are hidden from the menu until you type their full name; the docs’ commands reference lists everything, aliases included.
What is the difference between /clear and /compact?
/clear starts a new conversation with empty context and keeps the old one resumable with /resume. /compact keeps the conversation but replaces its history with a summary, optionally focused on instructions you pass.
Where do custom slash commands live?
In .claude/commands/<name>.md for the older form, or as a skill at .claude/skills/<name>/SKILL.md for a project or ~/.claude/skills/<name>/SKILL.md for yourself. Both create /<name>; a skill wins when the names collide.