SU8 Codes
< Back to blog
Official article 13 min read

Claude Code Commands and Slash Commands Cheat Sheet

A Claude Code commands cheat sheet covering launch flags, daily slash commands, keyboard shortcuts, input prefixes, CLAUDE.md and memory, plus hooks and subagents. Every entry is checked against the official documentation as of November 15, 2026, with aliases and removed commands called out.

#claude-code#commands#cheat-sheet
Claude Code Commands and Slash Commands Cheat Sheet

Claude Code has two command layers. Shell commands start or resume a session from your terminal. Slash commands run inside a session and control what happens in it. A command that seems not to work is often typed in the wrong layer.

This cheat sheet covers the commands you will actually use: launch commands and flags, the slash commands worth memorizing, keyboard shortcuts and input prefixes, plus the entry points for CLAUDE.md, hooks, and subagents. Everything was checked against the official documentation on November 15, 2026. Commands change between releases, so treat the docs as the final word.

Command layers and input prefixes

TypeWhere you type itExamplesWhat it does
Launch commandYour shellclaude, claude -c, claude -p "question"Starts a session, resumes one, or runs a one-shot task
Slash commandThe Claude Code prompt/clear, /model, /compactControls the current session: context, model, permissions, settings
Input prefixStart of a prompt!, @, /, ?Switches to shell mode, mentions a file, opens the command menu, shows shortcut help

A slash command is a command you type with a leading / inside a session. Type / to open the menu and keep typing to filter it. A command is only recognized at the start of a message; the text after it becomes its arguments. In /compact keep the API design notes, the trailing text tells the compaction what to preserve.

Launch commands and flags

Common launch commands

CommandWhat it does
claudeStart an interactive session
claude "task"Start an interactive session with an initial prompt
claude -p "question"Print mode: answer, then exit; useful in scripts
cat file | claude -p "question"Pipe file contents into a one-shot query
claude -cContinue the most recent conversation in this directory
claude -c -p "question"Continue that conversation with a one-shot query
claude -r "session" "question"Resume a session by ID or name
claude updateUpdate to the latest version
claude doctorRun read-only install and settings diagnostics without starting a session
claude auth login / logout / statusSign in, sign out, or check auth status
claude mcpConfigure MCP servers
claude setup-tokenGenerate a long-lived OAuth token for CI and scripts

Flags worth knowing

FlagWhat it does
--model <model>Set the model for this session: an alias like sonnet or opus, or a full model name
--permission-mode <mode>Start in default, acceptEdits, plan, auto, dontAsk, or bypassPermissions
--continue / -cLoad the most recent conversation in this directory
--resume / -rResume a specific session; with no value, open the session picker
--fork-sessionGive the resumed session a new ID instead of reusing the original
--worktree / -w [name]Start in an isolated git worktree
--add-dir <path>Add another working directory
--agents <JSON>Define subagents for this session only
--agent <name>Run the whole session as a named subagent
--mcp-config <file or JSON>Load MCP servers from a file or inline JSON
--settings <file or JSON>Override settings for this session
--append-system-prompt <text>Append text to the default system prompt
--allowedTools / --disallowedToolsPre-approve or deny specific tools
--tools <list>Restrict which built-in tools are available
--output-format text|json|stream-jsonSet the print-mode output format
--max-turns <n>Cap the number of agentic turns in print mode
--max-budget-usd <amount>Stop a print-mode run when the estimated spend reaches the amount
--effort <level>Set effort: low, medium, high, xhigh, max, or ultracode; available levels depend on the model
--fallback-model <list>Try the listed models in order when the primary is unavailable
--name / -n <name>Name the session so it is easier to find with /resume
--safe-modeStart with all customizations disabled to troubleshoot configuration
--bareMinimal mode: skip hooks, skills, MCP servers, CLAUDE.md, and other auto-discovery
--version / -vPrint the version

claude --help does not list every flag; the official CLI reference says so explicitly. A flag missing from --help is not necessarily unavailable.

Slash commands by task

Availability varies by platform, plan, and version. If a command is not in your / menu, that does not mean you typed it wrong.

Daily session control

CommandWhat it does
/helpShow help and available commands
/clear [name]Start a new conversation with empty context; aliases /reset, /new
/compact [instructions]Summarize the conversation to free up context
/context [all]Show context usage as a colored grid; all expands the breakdown
/usageShow session cost, plan usage limits, and activity stats; aliases /cost, /stats
/resume [session]Resume by ID or name, or open the picker; alias /continue
/rewindRoll code and/or conversation back to a checkpoint, or summarize from a message; aliases /checkpoint, /undo
/branch [name]Branch the current conversation and keep the original
/fork [prompt]Copy the conversation into a new background session and keep working here
/export [filename]Export the conversation as plain text
/recapGenerate a one-line summary of the current session
/rename [name]Rename the session; the name shows on the prompt bar
/tasksView and manage background work in this session; alias /bashes
/btw [question]Ask a side question without adding it to the conversation
/exitExit Claude Code; alias /quit

/clear, /compact, and /rewind are easy to mix up. /clear starts a fresh conversation and you can still resume the old one. /compact stays in the same conversation and summarizes it. /rewind goes back to an earlier point, optionally including code.

Model and interface

CommandWhat it does
/model [model]Switch models and save the choice as the default for new sessions; no argument opens the picker
/effort [level|auto|status]Set the effort level; status prints the current one
/fast [on|off]Toggle fast mode
/config [key=value ...]Open settings, or set a value directly, e.g. /config theme=dark; alias /settings
/statusOpen the Settings interface on the Status tab: version, model, account, connectivity
/output-style [style]List or switch output styles
/statuslineConfigure the status line
/themeChange the color theme
/keybindingsOpen your keyboard shortcut file
/terminal-setupInstall a Shift+Enter newline binding in VS Code, Cursor, and similar terminals
/doctorCheck installation, settings, extensions, and CLAUDE.md, and propose fixes; alias /checkup

Project, memory, and extensions

CommandWhat it does
/initGenerate a starter CLAUDE.md; if one exists, it suggests improvements instead of overwriting
/memoryEdit CLAUDE.md files, toggle auto memory, and view auto-memory entries
/add-dir <path>Add a working directory to this session
/cd <path>Move the session to another working directory and keep the conversation
/agentsIn the current version, print a reminder to ask Claude to create or manage subagents, or edit .claude/agents/ yourself (v2.1.197 and earlier opened an interactive interface)
/hooksBrowse configured hooks read-only, labeled by source
/mcp [reconnect|enable|disable ...]Manage MCP connections and OAuth
/plugin [subcommand]Manage plugins: install, enable, disable, list
/skillsList available skills; filter by name, description, or source
/reload-skillsRe-scan skill and command directories without restarting

Permissions and review

CommandWhat it does
/permissionsManage allow, ask, and deny rules; alias /allowed-tools
/plan [description]Enter plan mode, optionally with a task
/sandboxToggle sandbox mode (supported platforms)
/diffReview working-tree changes, including edits Claude has made
/code-review [level] [--fix] [pr#|branch|path]Review the current diff or a target for correctness bugs; --fix applies findings; alias /review
/security-reviewCheck the current branch's changes for security risks

Other useful commands

CommandWhat it does
/bug [report]Report a bug or share the conversation, with a consent screen; alias /share
/feedback [report]Send product feedback
/login / /logoutSign in or out of your Anthropic account
/release-notesBrowse the changelog in a version picker
/mobileShow a QR code for the Claude mobile app

Keyboard shortcuts and input

Shortcuts

ShortcutWhat it does
EscInterrupt the current response or tool call; close a dialog; decline a permission prompt
Esc EscClear the input draft; on an empty prompt, open the rewind menu
Ctrl+CInterrupt a running operation; when nothing is running, clear the input, then exit on the next press
Ctrl+DExit; the first press shows a confirmation hint, the second press within 800 ms exits
Ctrl+LRedraw the screen
Ctrl+OToggle the transcript viewer, including tool calls and the model used
Ctrl+RReverse-search command history
Ctrl+BBackground running tasks; tmux users press it twice
Ctrl+TShow or hide Claude's task checklist
Ctrl+SStash the current prompt; press again on an empty prompt to restore it
Ctrl+GEdit the prompt in your default text editor
Ctrl+VPaste an image from the clipboard (Cmd+V in iTerm2, Alt+V on Windows and WSL)
Shift+TabCycle permission modes
Option+P (macOS) / Alt+PSwitch models without clearing your prompt
Option+T / Alt+TToggle extended thinking
Option+O / Alt+OToggle fast mode
TabAccept an autocomplete suggestion
Up / Down or Ctrl+P / Ctrl+NNavigate command history

The Shift+Tab cycle runs default (labeled Manual in the UI) → acceptEdits → plan. Optional modes slot in after plan: bypassPermissions first, then auto, if enabled. dontAsk is not in the cycle; start with --permission-mode dontAsk instead.

What the modes mean in practice: default asks before actions; acceptEdits auto-approves file edits; plan is read-only research that produces a plan first; auto lets a classifier decide which actions can proceed; dontAsk allows only pre-approved tools and denies the rest; bypassPermissions skips permission checks and belongs in an isolated container or VM.

Input prefixes and multiline

Type thisWhat it does
/Open the command and skill menu
!Shell mode: run a command and bring its output into the session
@File path autocomplete
? on an empty promptToggle the keyboard shortcut help panel
\ + EnterNewline; works in all terminals
Ctrl+JNewline; works in any terminal
Shift+EnterNewline; native in iTerm2, WezTerm, Ghostty, Kitty, Warp, and Windows Terminal
Option+EnterNewline; on macOS, configure Option as Meta first

CLAUDE.md and memory

CLAUDE.md holds persistent project instructions that load at the start of every session. Two commands are the entry points:

  • /init reads the project and generates a starter CLAUDE.md. If the file already exists, it suggests improvements rather than overwriting it.
  • /memory lists user, project, and local memory files and opens them for editing. It also toggles auto memory, which is Claude's own notes, separate from the CLAUDE.md files you write.

There are four scopes:

ScopeLocationPurpose
Managed policymacOS: /Library/Application Support/ClaudeCode/CLAUDE.md; Linux/WSL: /etc/claude-code/CLAUDE.md; Windows: C:\Program Files\ClaudeCode\CLAUDE.mdOrganization-wide rules managed by IT
User~/.claude/CLAUDE.mdPersonal preferences for all your projects
Project./CLAUDE.md or ./.claude/CLAUDE.mdTeam-shared instructions, committed to the repo
Local./CLAUDE.local.mdPersonal project preferences; add it to .gitignore

You can import other files with @path/to/file, up to four levels deep. An @ inside a code block does not trigger an import. To confirm what actually loaded, run /context all and check the Memory files list.

Hooks and subagents

Hooks: browse with /hooks, edit in settings

/hooks opens a read-only browser of the hooks that are active, labeled by source: user settings, project settings, local settings, a plugin, or the current session. To change or remove one, edit the settings file:

  • ~/.claude/settings.json for all your projects
  • .claude/settings.json for one project, shareable through the repo
  • .claude/settings.local.json for one project, local only

Hook events cover session start, prompt submission, before and after tool calls, the end of a response, subagent start and stop, and context compaction. Common ones are SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SubagentStart, and PreCompact. The full event table and JSON schema are in the hooks reference.

Subagents: /agents is a pointer, files are the config

In the current version, /agents does not open a management UI. It prints a reminder to ask Claude to create or manage subagents, or to edit .claude/agents/ or ~/.claude/agents/ yourself. Only v2.1.197 and earlier opened the interactive interface, so older tutorials are out of date.

Subagent definitions live in:

  • .claude/agents/ for the project, committed for the team
  • ~/.claude/agents/ for all your projects
  • --agents '<JSON>' for the current session only, useful for quick tests
  • a plugin's agents/ directory while the plugin is enabled

You can invoke one in natural language, use an @ mention to direct one task to it, or run the whole session as that subagent with --agent. Claude also delegates to built-in subagents such as Explore and Plan on its own.

Where custom commands went

If you followed an older guide, you may be looking for .claude/commands/. Custom slash commands have been merged into skills.

  • Existing .claude/commands/*.md files still work. The file name is the command name, so deploy.md becomes /deploy.
  • For new work, prefer a skill at .claude/skills/<name>/SKILL.md. The folder name becomes the command name, and a skill can include supporting files such as scripts and templates.
  • /skills lists available skills; /reload-skills re-scans without restarting.
  • You can stack skills in one message: /skill-a /skill-b do something, up to six.

Aliases and removed commands

Aliases

You might typeIt is the same as
/reset, /new/clear
/continue/resume
/checkpoint, /undo/rewind
/cost, /stats/usage
/settings/config
/allowed-tools/permissions
/checkup/doctor
/review/code-review
/bashes/tasks
/quit/exit
/share/bug

Removed or renamed

CommandStatus
/vimRemoved in v2.1.92; use /config → Editor mode
/pr-commentsRemoved in v2.1.91; ask Claude to view PR comments instead
/ultraplanRemoved; use plan mode (/plan or Shift+Tab)

What to memorize first

You do not need to memorize the whole table. Three tiers are enough:

  1. Every day: Esc to interrupt, Shift+Tab for permission modes, /clear for a fresh start, /compact to free context, /model to switch models, /resume to get a session back.
  2. Every week: /init and /memory for CLAUDE.md, /permissions for rules, /context to inspect the window, /rewind to go back, /usage to check spend.
  3. Look up when needed: /hooks, /agents, /mcp, /doctor, and the shell side: -p, -c, -r, and --agents.

When in doubt, type / and read the menu, or check the official docs. The menu matches the release you are running, which a static cheat sheet cannot.

Sources and version

Official documentation, fetched on November 15, 2026:

Version note: as of November 15, 2026, the latest CHANGELOG entry is 2.1.325. Command availability depends on platform, plan, and version; check the official docs, claude --help, and /help in a session for the final word.