AI Coding

Claude Code Cheat Sheet (2026): Commands, Slash Commands and Shortcuts

This Claude Code cheat sheet lists the commands you type every day: the slash commands grouped by task, the keyboard shortcuts, and the claude CLI commands and flags. Every entry was checked against Anthropic's Claude Code docs on November 18, 2026, and the last table lists what has been removed or renamed, because most cheat sheets online still show commands that no longer exist.

Gurram Poorna Prudhvi

Lead AI Engineer

Beginner
Nov 18, 2026
9 min read
CLAUDE CODE CHEAT SHEETthe commands, shortcuts and CLI flags you use every daySLASH COMMANDS/initcreate a starter CLAUDE.md/planplan before any edits/modelswitch model/contextsee what fills the window/compactsummarize to free context/clearnew conversation/resumereopen an earlier session/rewindroll back code and chat/diffreview what changed/code-reviewcheck the diff for bugs/permissionsallow, ask and deny rules/mcpmanage MCP serversKEYBOARD SHORTCUTSShift+Tabcycle permission modesEscinterrupt ClaudeEsc Escrewind, or clear the draftCtrl+Cinterrupt; twice to exitCtrl+Rsearch prompt historyCtrl+Bsend a task to backgroundCtrl+Oopen transcript viewerCtrl+Gedit prompt in your editorCtrl+Sstash or restore promptCtrl+Jnew line, any terminalCtrl+Vpaste an imageAlt+Pswitch model (Option+P)CLI AND PREFIXESclaude "query"start with a promptclaude -p "query"answer, then exitclaude -ccontinue last sessionclaude -r <name>resume by name or IDclaude -w <name>run in a git worktreeclaude --bg "task"run in the backgroundclaude --model opuspick the modelclaude updateupdate Claude Codeclaude doctorcheck the install/ at line startcommand or skill! at line startrun a shell command@mention a filetype / to list every command · type ? on an empty prompt for shortcutsaiengineerinsights.com · from Anthropic's Claude Code docs, checked Nov 18 2026

TL;DR — Claude Code commands in one line each: type / to list every command and ? on an empty prompt for shortcuts. Start a repo with /init. Use /plan before a big change, /context and /compact when the conversation gets long, /clear for a new task, /rewind (or Esc Esc) to undo, and /diff then /code-review before you ship. Shift+Tab cycles permission modes and Esc interrupts. From the shell, claude -c continues the last session and claude -p "query" answers and exits.

Explore this article with

1. Which Claude Code Commands Do You Use Most?

Claude Code ships more than a hundred commands. A dozen cover most days. A command only works at the start of your message, and anything after its name is passed as arguments. In the tables, [x] is optional and <x> is required.

CommandWhat it does
/initCreate a starter CLAUDE.md for the project
/plan [description]Enter plan mode: Claude researches and proposes a plan before it edits anything
/model [model]Switch model. With no argument it opens a picker
/contextShow what is filling the context window
/compact [instructions]Summarize the conversation so far to free context. You can say what the summary should keep
/clear [name]Start a new conversation with empty context. Project memory stays
/resume [session]Reopen an earlier conversation by name or ID, or pick from a list
/rewindRoll the code, the conversation, or both back to an earlier point
/diffReview the changes in your working tree, including Claude's edits
/code-reviewCheck the current diff for bugs. /review is an alias
/permissionsManage allow, ask and deny rules for tools
/mcpManage MCP server connections and sign-ins

2. Claude Code Slash Commands by Task

The official list is alphabetical. This one is grouped by when you reach for a command. Not every command shows for every user: some depend on your plan, platform or version.

Set up a project

CommandWhat it does
/initCreate a starter CLAUDE.md
/memoryEdit CLAUDE.md files and view or switch off auto memory
/permissionsManage allow, ask and deny rules for tools
/mcpManage MCP servers. /mcp reconnect all retries failed ones
/add-dir <path>Give Claude access to another directory
/cd <path>Move the session to another directory and keep the conversation
/hooksView your hook configuration
/agentsReminder of how to create and manage subagents
/skillsList available skills
/pluginOpen the plugin menu, or pass list, install, enable or disable
/ideManage IDE integrations
/terminal-setupInstall the Shift+Enter newline binding in VS Code, Cursor, Alacritty or Zed
/statuslineSet up the status line
/import [codex|gemini|cursor]Bring configuration over from Codex, Gemini CLI or Cursor

Manage context, model and cost

CommandWhat it does
/contextShow context usage as a grid, with suggestions
/compact [instructions]Summarize the conversation to free context
/clear [name]New conversation, empty context
/model [model]Switch model
/effort [level]Set reasoning effort: low to xhigh, max, or auto
/fast [on|off]Toggle fast mode
/btw [question]Ask a side question without adding it to the conversation
/usageSession cost, plan limits and activity. /cost and /stats are aliases
/output-style [style]List output styles or switch to one

/clear and /compact are easy to mix up. /clear starts a new conversation. /compact keeps the same conversation and replaces its history with a summary. Use /clear when you change task and /compact when you are mid-task and running out of room.

Plan and run work

CommandWhat it does
/plan [description]Plan mode: research and plan first, edit after you approve
/goal [condition]Keep Claude working across turns until a condition is met. /goal clear stops it
/loop [interval] [prompt]Repeat a prompt while the session is open, e.g. /loop 5m check if the deploy finished
/tasksList background work in this session, including finished subagents
/subtask <task>Start a background subagent that inherits the whole conversation
/background [prompt]Detach the session to run as a background agent. Alias: /bg
/fork [prompt]Copy the conversation into a new background session and keep working here
/batchSplit a large change into independent units and run one subagent per unit
/schedule [description]Create or manage cloud scheduled tasks

Review and ship

CommandWhat it does
/diffReview working-tree changes
/code-review [level] [--fix]Check the diff, a PR number, a branch or a path for bugs. --fix applies the findings
/security-reviewLook for security problems in the changes on your branch
/simplify [target]Review changed code for cleanup and apply the fixes
/verifyBuild and run the app to confirm a change works
/autofix-pr [prompt]Start a cloud session that watches the branch's PR and pushes fixes
/install-github-appInstall the Claude GitHub App for a repository

Move between sessions

CommandWhat it does
/resume [session]Resume by name or ID, or open the picker
/rename [name]Name the session so it is easy to find later
/branch [name]Branch the conversation here and try another direction
/rewindRoll back code, conversation or both. Aliases: /checkpoint, /undo
/export [filename]Export the conversation as plain text
/copy [N]Copy the last response, or the Nth-latest
/recapOne-line summary of the session
/teleportPull a cloud session into this terminal. Alias: /tp
/remote-controlControl this session from claude.ai. Alias: /rc
/exitExit. Alias: /quit

Fix problems and change settings

CommandWhat it does
/doctorDiagnose installation, settings and CLAUDE.md problems and propose fixes
/debug [description]Turn on debug logging and troubleshoot from the session log
/statusVersion, model, account and connectivity
/config [key=value]Open settings, or set one directly, e.g. /config theme=dark
/keybindingsOpen your keyboard shortcuts file
/release-notesRead the changelog
/feedback [report]Send feedback or report a bug. /bug opens the same dialog
/helpShow help and available commands
/login, /logoutSign in or out of your Anthropic account

Get the AI engineering newsletter

Practical, engineering-first breakdowns on AI agents, LLMs, and breaking into the field — plus the free roadmap PDF when you join. No spam.

By subscribing you agree to receive emails from AI Engineer Insights. Unsubscribe anytime. See our Privacy Policy.

3. Claude Code Keyboard Shortcuts

These are the defaults in the terminal. You can rebind them: /keybindings opens the file. On macOS, the Alt word-movement keys need Option set as Meta in your terminal.

General controls

ShortcutWhat it does
Shift+TabCycle permission modes
EscInterrupt Claude mid-turn; it keeps the work done so far
Esc EscWith text in the prompt: clear the draft. With an empty prompt: open the rewind menu
Ctrl+CInterrupt. If nothing is running, first press clears the input and a second press exits
Ctrl+DExit (press twice)
Ctrl+RSearch your prompt history
Ctrl+BSend a running Bash command or agent to the background (twice in tmux)
Ctrl+OToggle the transcript viewer, which shows tool calls in detail
Ctrl+TShow or hide Claude's task checklist
Ctrl+GEdit the prompt in your default text editor
Ctrl+SStash the prompt; press again on an empty prompt to restore it
Ctrl+LRedraw the screen
Ctrl+VPaste an image from the clipboard (Cmd+V in iTerm2, Alt+V on Windows and WSL)
Option+P / Alt+PSwitch model without clearing the prompt
Option+O / Alt+OToggle fast mode
Up / DownMove through prompt history
TabAccept an autocomplete suggestion
?On an empty prompt: toggle the shortcut help panel

New line without sending

KeysWhere it works
\ then EnterWorks in every terminal
Ctrl+JWorks in every terminal, no setup
Shift+EnterNative in iTerm2, WezTerm, Ghostty, Kitty, Warp and Windows Terminal 1.25+. Elsewhere run /terminal-setup
Option+EntermacOS, after enabling Option as Meta

Editing the prompt

ShortcutWhat it does
Ctrl+A / Ctrl+EStart / end of line
Alt+B / Alt+FBack / forward one word
Ctrl+KDelete to end of line
Ctrl+UDelete from cursor to line start
Ctrl+WDelete back to the previous whitespace
Ctrl+YPaste the text you last deleted
Ctrl+_Undo the last input edit

Prefixes

TypeWhat it does
/At the start of a message: run a command or skill
!At the start of a message: shell mode. Runs the command and adds its output to the session
@Mention a file, with path autocomplete

4. Claude Code CLI Commands and Flags

These run from your shell, not inside a session. claude -p (print mode) is the one to learn for scripts and CI: it takes a prompt, prints the answer and exits.

CLI commands

CommandWhat it does
claudeStart an interactive session
claude "query"Start an interactive session with a first prompt
claude -p "query"Print mode: answer, then exit. Use it in scripts and CI
cat logs.txt | claude -p "explain"Pipe content in
claude -cContinue the most recent conversation in this directory
claude -r "<session>" "query"Resume a session by ID or name
claude updateUpdate to the latest version
claude doctorPrint installation and settings diagnostics without starting a session
claude mcpConfigure MCP servers
claude pluginManage plugins
claude agentsOpen agent view to watch and dispatch background sessions
claude auth loginSign in. Also: auth logout, auth status

Useful flags

FlagWhat it does
--model <name>Set the model for this session: sonnet, opus, haiku, fable, or a full model name
--permission-mode <mode>Start in a mode: default, acceptEdits, plan, auto, dontAsk or bypassPermissions
--add-dir <path>Add another working directory
--worktree, -w <name>Start in an isolated git worktree under .claude/worktrees/
--bgStart as a background agent and return at once, e.g. claude --bg "investigate the flaky test"
--name, -n <name>Name the session; resume it later with claude --resume <name>
--effort <level>Set the effort level for this session
--append-system-prompt <text>Add text to the end of the default system prompt
--allowedTools, --disallowedToolsTools that run without a prompt, and tools that are denied
--output-format <format>Print mode output: text, json or stream-json
--max-turns <n>Limit agentic turns (print mode only)
--mcp-config <file>Load MCP servers from JSON files or strings
--bareMinimal mode: skip hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md so scripted calls start faster
--safe-modeStart with all customizations disabled, to troubleshoot a broken setup
--verboseFull turn-by-turn output
--dangerously-skip-permissionsSkip permission prompts. Same as --permission-mode bypassPermissions

Three combinations worth saving:

# Review a diff in CI and get JSON back
git diff main | claude -p "review this diff for bugs" --output-format json

# Start in plan mode on a named session, in its own worktree
claude -w auth-refactor -n auth-refactor --permission-mode plan

# Pick up where you left off
claude -c

5. Permission Modes (Shift+Tab)

Shift+Tab cycles through the permission modes. Which ones appear depends on your plan and settings. Start a session in a mode with --permission-mode.

ModeWhat Claude may do
defaultShown as Manual in the mode indicator. Claude asks before it edits files or runs commands
acceptEditsFile edits go through without a prompt
planClaude researches and proposes a plan; it does not edit until you approve
autoWhere available. A classifier decides which actions need your approval
bypassPermissionsWhere available. Skips permission prompts; only for sandboxes you can throw away

6. How Do You Create a Custom Slash Command?

Custom commands are now skills. Make a folder, put a SKILL.md in it, and the folder name becomes the command. A project skill lives in .claude/skills/<name>/ and is shared through git; a personal one lives in ~/.claude/skills/<name>/ and works in all your projects.

# .claude/skills/fix-issue/SKILL.md   ->   /fix-issue 123
---
description: Fix a GitHub issue by number. Use when asked to fix an issue.
argument-hint: [issue-number]
disable-model-invocation: true
---

Read issue #$ARGUMENTS with the gh CLI, find the cause, fix it,
add a test, and summarize the change.
  • • $ARGUMENTS is everything typed after the command. $0, $1 pick one argument.
  • • description tells Claude when to use the skill on its own.
  • • disable-model-invocation: true means only you can run it, by typing the command.
  • • Older .claude/commands/*.md files still work. If a skill and a command file share a name, the skill wins.

For the full walk-through, including community skills and how skills differ from MCP servers, see Claude Skills: how to add, use and create them.

7. Removed and Renamed Commands

Claude Code changes weekly, so older cheat sheets go stale fast. If a command from another list does nothing, check here first.

Command or flagStatus
/vimRemoved in v2.1.92. Use /config and change Editor mode
/pr-commentsRemoved in v2.1.91. Ask Claude to read the PR comments instead
/ultraplanRemoved. Use plan mode
/cost, /statsNow aliases for /usage
/reviewNow an alias for /code-review
/ultrareviewStill runs; the preferred form is /code-review ultra
/agentsNo longer opens a manager (v2.1.197 and earlier did). It prints a reminder; ask Claude to create subagents
--enable-auto-modeRemoved in v2.1.111. Use --permission-mode auto
--remoteDeprecated alias for --cloud
.claude/commands/*.mdStill works, but custom commands are now skills

Know the commands and want the setup around them? Read Claude Code best practices. Choosing a tool, not learning one? See Claude Code vs Cursor and the wider comparison of the best AI coding agents.

8. FAQ

How do I see all Claude Code commands?

Type / at the prompt to list every command available to you, then keep typing to filter. /help shows help and available commands, and typing ? on an empty prompt opens the keyboard shortcut panel. The list differs by plan, platform and version, so yours may not match a published one exactly.

What is the difference between /clear and /compact in Claude Code?

/clear starts a new conversation with empty context and keeps project memory such as CLAUDE.md. /compact stays in the same conversation and replaces its history with a summary to free space. Use /clear when you switch tasks and /compact when you are in the middle of one.

How do I undo a change in Claude Code?

Run /rewind, or press Esc twice on an empty prompt. Both open the rewind menu, where you can restore the code, the conversation, or both to an earlier point. /checkpoint and /undo are aliases for /rewind.

What is the shortcut for plan mode in Claude Code?

Press Shift+Tab to cycle permission modes until the indicator shows plan mode, or type /plan, optionally followed by the task. To start a session in plan mode, run claude --permission-mode plan.

How do I create a custom slash command in Claude Code?

Create a folder at .claude/skills/your-command/ with a SKILL.md file inside. The folder name becomes the command, so the skill in .claude/skills/deploy/ runs as /deploy. Use $ARGUMENTS in the file for whatever you type after the command. Older .claude/commands/ files still work.

Is there a Claude Code cheat sheet PDF?

Yes. The one-page printable PDF of this cheat sheet is free with the newsletter sign-up on this page. It has the same commands, shortcuts and CLI flags, laid out for A4.

9. Sources

Checked against Anthropic's Claude Code docs on November 18, 2026. Descriptions are shortened in our own words. Claude Code ships updates weekly, so run /help or /release-notes if something here does not match your version.

Found this useful? Share it.

Share:

Related Articles