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.
| Command | What it does |
|---|---|
/help | Show help and available commands |
/clear | Start a new conversation with empty context; aliases /reset, /new |
/compact [instructions] | Replace the history with a summary, optionally focused on what you name |
/context | Show what is consuming the context window, as a grid |
/usage | Token usage and cost for the session; /cost is an alias |
/status | Session status: login, model, provider, which settings files loaded |
/config | Open 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 |
/permissions | Manage allow, ask, and deny rules; alias /allowed-tools |
/plan [description] | Enter plan mode from the prompt |
/init | Generate a starting CLAUDE.md from the repository |
/memory | Edit 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 |
/rewind | Roll code and conversation back to a checkpoint |
/export [filename] | Save the conversation as plain text |
/diff | Interactive 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 |
/mcp | Manage MCP server connections and their authentication |
/hooks | Browse configured hooks; read-only |
/agents | Subagents, which now live in .claude/agents/ or ~/.claude/agents/ |
/skills | Manage custom skills and view the bundled ones |
/plugin | Manage plugins |
/login, /logout | Sign in to or out of your account |
/doctor | A setup checkup that diagnoses problems and can fix them; alias /checkup |
/vim | Toggle Vim keybindings |
/theme, /statusline | Colour theme; the status bar below the prompt |
/terminal-setup | Configure terminal integration |
/release-notes | Recent release notes |
/bug [report] | Report a bug or share the conversation; alias /share |
/exit | Leave; alias /quit |
/remote-control | Continue this local session from another device |
/background [prompt] | Detach the session to run as a background agent; alias /bg |
/tasks | List background work, including finished subagents |
/fork [prompt] | Copy the conversation into a new background session and keep working here |
/teleport | Pull a web session into this terminal |
/desktop | Continue the session in the desktop app; alias /app |
/code-review | Review 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.
| Invocation | What it does |
|---|---|
claude | Start 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, --continue | Reopen 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-session | When 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, --disallowedTools | Add 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 json | Structured 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-permissions | Skip permission prompts; the same as --permission-mode bypassPermissions |
--bg | Start as a background session, hosted by a supervisor that outlives your shell |
--teleport | Pull a web session into this terminal; needs a claude.ai subscription |
--debug | Write a debug log to ~/.claude/debug/ |
claude update | Update now instead of waiting for the background check |
claude doctor | Read-only diagnostics for the install and settings |
claude mcp | Configure MCP servers from the shell |
claude setup-token | Mint a one-year OAuth token for CI, used as CLAUDE_CODE_OAUTH_TOKEN |
Every flag, with examples: the CLI reference.
Keyboard shortcuts.
| Keys | Effect |
|---|---|
Ctrl+C | Interrupt; with nothing running, the first press clears the prompt and the second exits |
Ctrl+D | Exit, on a second press within 800 ms |
Esc | Stop the current response or tool call; work so far is kept |
Esc Esc | Clear the draft, or, with an empty prompt, open the rewind menu |
Shift+Tab | Cycle permission modes |
Ctrl+R | Reverse-search prompt history |
Ctrl+O | Toggle the transcript viewer with tool detail |
Ctrl+B | Background a running command or agent; tmux users press twice |
Ctrl+G | Edit the prompt in your default editor |
Ctrl+S | Stash the prompt; press again on an empty prompt to restore it |
Ctrl+L | Redraw the screen |
Ctrl+T | Toggle Claude’s task checklist |
Ctrl+Z | Suspend to the shell; fg resumes (Unix) |
Option+P / Alt+P | Switch model without clearing the prompt |
Option+T / Alt+T | Toggle extended thinking |
Up / Down | Move within a multiline prompt, then walk history |
Tab | Accept an autocomplete suggestion |
\ then Enter, Ctrl+J, or Shift+Enter | Insert a newline; Shift+Enter is native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal |
! at the start | Shell mode: run a command and add its output to the session |
@ | File path autocomplete |
? on empty input | Toggle 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.
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 | shQuestions
- 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.