Skip to content

Claude Code Commands Cheat Sheet: Shortcuts, Flags, Settings

Claude Code commands on one page: slash commands, keyboard shortcuts, CLI flags and where every settings file lives, all checked against the official docs.

By Yotam DahanUpdated 12 min readClaude Code

On this page
  1. Start, resume and update (in your shell)
  2. Everyday slash commands
  3. Models, modes and permissions
  4. Set up a project
  5. Check work and track usage
  6. Account and everything else
  7. Keyboard shortcuts
  8. Prefixes and multi-line input
  9. Permission modes at a glance
  10. Where settings and memory files live
  11. A starter settings.json
  12. What to do next

Claude Code commands come in two kinds: slash commands you type inside a session, such as /clear or /model, and shell commands with flags you type before it starts, such as claude -c. This cheat sheet lists the ones you will actually use, grouped by job, plus the keyboard shortcuts and the location of every settings file. Everything was checked against Anthropic's official commands reference in October 2026, when the current version was 2.1.302.

New to the tool? The beginner tutorial shows most of these in action, one step at a time.

The three commands that fix most problems

/clear

Starts a fresh conversation. Use it between unrelated tasks so old context stops confusing Claude and using your plan.

/context

Shows what is filling the context window. Run it when Claude seems to forget earlier details.

/rewind

Opens the rewind menu to restore code, conversation or both. Pressing Esc twice on an empty prompt does the same.

Start, resume and update (in your shell)

Type these in Terminal or PowerShell, not inside Claude Code. The full list is in the CLI reference.

CommandWhat it does
claudeStart an interactive session in the current folder
claude "your task"Start a session with your first prompt already sent
claude -p "question"Answer once and exit, with no interactive session (print mode)
claude -cContinue the most recent conversation in this folder
claude -rChoose an earlier conversation to resume; claude -r "name" jumps to a named one
claude -n "name"Start a session with a name you can resume by later
claude --model sonnetStart on a specific model, by alias or full name
claude --permission-mode planStart in a specific permission mode
claude --add-dir ../sharedAlso give access to another folder
claude --versionShow the installed version
claude updateInstall the newest version now
claude doctorCheck your install and settings without starting a session
claude auth statusShow which account you are signed in with (add --text for plain text)
claude mcp listList the MCP servers you have added
claude --desktopOpen the current folder in the desktop app (macOS and x64 Windows, subscription accounts)

Everyday slash commands

CommandWhat it doesReach for it when
/helpShow help and available commandsYou forget a command
/clearStart a new conversation with an empty context (also /new, /reset)You switch to an unrelated task
/compact [focus]Summarize the conversation so far to free spaceA long task is filling the context
/contextShow what is filling the context window, as a colored gridClaude seems to forget earlier details
/resumeReopen an earlier conversation (also /continue)You want yesterday's session back
/rename [name]Name the current sessionBefore /clear, so you can find it later
/branchSplit off a copy of the conversation to try another directionYou want to experiment without losing the current path
/rewindRoll code and conversation back to an earlier point (also /undo, /checkpoint)A change went wrong
/btw [question]Ask a side question that isn't added to the conversationYou need a quick check mid-task
/copyCopy the last response to the clipboardYou want to paste an answer elsewhere
/export [file]Save the conversation as plain textYou want a record
/recapGet a one-line summary of the session so farYou come back after a break
/exitLeave Claude Code (also /quit)You are done

Models, modes and permissions

CommandWhat it does
/model [name]Switch model and save it as your default; press s in the picker to switch for this session only
/effort [level]Set how hard the model thinks: low, medium, high, xhigh or max
/fastToggle fast mode, a faster Opus at a higher price; on subscription plans it bills to usage credits
/plan [task]Enter plan mode, optionally starting with a task
/permissionsView and edit your allow, ask and deny rules
/configOpen settings (also /settings); /config theme=dark sets one value directly
/themeChange the color theme
/output-style [style]Change how Claude formats its responses

Set up a project

CommandWhat it does
/initGenerate a starter CLAUDE.md file for the project
/memoryOpen and edit your CLAUDE.md files, and switch auto memory on or off
/mcpManage connected MCP servers and their sign-ins
/skillsList the skills available in this session
/pluginBrowse, install and manage plugins
/hooksView the hooks that are configured
/add-dir <path>Give this session access to another folder
/cd <path>Move the session to another folder and keep the conversation
/keybindingsOpen your keyboard shortcuts file
/terminal-setupSet up new-line shortcuts for your terminal (Shift+Enter in VS Code and Cursor, Option keys in Apple Terminal)
/statuslineConfigure the status line under the prompt
/doctorRun a setup checkup that finds problems and offers to fix them

Skills and MCP each have their own guide: how to create a Claude skill and what MCP is.

Check work and track usage

CommandWhat it does
/diffReview the changes in your working folder, including Claude's edits
/code-reviewReview the current changes for bugs (also /review); add --fix to apply the findings
/security-reviewCheck the changes on your branch for security problems
/usageSee session cost, plan usage limits and activity (also /cost, /stats)
/statusSee version, model, account and connection details
/insightsGet an HTML report on how you use Claude Code
/release-notesSee what changed in each version

Account and everything else

CommandWhat it does
/login and /logoutSign in or out of your Anthropic account
/upgradeOpen the page to move to a higher plan
/usage-creditsTurn on or request usage credits for when you hit a limit
/rate-limit-optionsChoose what happens when a usage limit stops a task
/privacy-settingsView and update privacy settings (Pro and Max)
/feedbackSend feedback or a bug report (/bug opens the same dialog)
/powerupTake short interactive lessons on Claude Code features
/desktopContinue this session in the desktop app
/remote-controlContinue this session from your phone or a browser (also /rc)
/mobileShow a QR code to download the Claude mobile app
/loop [interval] [prompt]Repeat a prompt on an interval while the session stays open
/scheduleCreate routines that run in the cloud on a schedule
/goal [condition]Keep Claude working across turns until a condition is met

Can't remember which command fits? Claude Code can answer questions about itself, so ask it directly:

Ask Claude Code about its own commands
I'm about to [TASK]. Which slash commands, shortcuts or settings would help me most? Explain each one in a single line and tell me when not to use it.

Keyboard shortcuts

From the interactive mode reference. Mac and Windows keys are the same unless noted.

ShortcutWhat it does
EscStop Claude mid-step (it keeps the work done so far); close a dialog
Esc twiceWith an empty prompt, open the rewind menu; with text, clear the draft
Shift+TabCycle permission modes
Ctrl+CInterrupt; with nothing running, first press clears the prompt, second press exits
Ctrl+DPress twice on an empty prompt to exit
Up and Down arrowsBrowse your earlier prompts
Ctrl+RSearch your prompt history
TabAccept an autocomplete suggestion
Ctrl+OShow the full transcript, with every tool call
Ctrl+TShow or hide Claude's task checklist
Ctrl+BMove a running command to the background
Ctrl+GOpen your prompt, or a proposed plan, in your text editor
Ctrl+SStash the current draft; press again on an empty prompt to bring it back
Ctrl+LRedraw the screen if the display gets garbled
Ctrl+V (Cmd+V in iTerm2, Alt+V on Windows)Paste an image from the clipboard
Option+P (Mac) or Alt+PSwitch model without losing your draft
Option+T (Mac) or Alt+TToggle extended thinking, on models where it can be switched off
? on an empty promptShow the shortcut help panel

In the desktop app, Shift+Tab doesn't cycle modes, so use the mode selector instead. Press Cmd+/ on a Mac or Ctrl+/ on Windows to see the app's own shortcuts.

Prefixes and multi-line input

Type thisWhat happens
/ at the startRun a command or skill
! at the startRun a shell command yourself; the output goes into the conversation and Claude responds to it
@Mention a file or folder, with path autocomplete
\ then Enter, or Ctrl+JNew line without sending, in any terminal
Shift+EnterNew line in iTerm2, Apple Terminal, Windows Terminal, Ghostty, Kitty, WezTerm and Warp; run /terminal-setup once in VS Code or Cursor

Permission modes at a glance

The status line showsModeRuns without asking
⏸ manual mode onManual (config value default)Reads only
⏵⏵ accept edits onacceptEditsReads, file edits and common file commands such as mkdir and mv
⏸ plan mode onplanReading and exploring; no edits until you approve a plan
⏵⏵ auto mode onautoMost actions, with a background safety check; the starting mode in current versions

Where settings and memory files live

~ means your home folder (%USERPROFILE% on Windows), ~/.claude is a hidden folder inside it, and a plain .claude means the folder inside your project. Details are in the official settings guide.

FileApplies toWhat it holds
~/.claude/settings.jsonYou, in every projectPersonal settings: theme, default model, your own permission rules
.claude/settings.jsonEveryone in the projectShared permissions, hooks and plugins; commit it to share it
.claude/settings.local.jsonYou, in this projectPersonal overrides; "Yes, and don't ask again" approvals are saved here
managed-settings.jsonYour whole organizationCompany policy that nothing overrides; lives in /Library/Application Support/ClaudeCode/ (Mac), /etc/claude-code/ (Linux) or C:\Program Files\ClaudeCode\ (Windows)
~/.claude.jsonYouSign-in state, your MCP servers, folder trust; Claude Code maintains it for you
~/.claude/CLAUDE.mdYou, in every projectPersonal instructions
CLAUDE.md or .claude/CLAUDE.mdThe projectProject instructions
CLAUDE.local.mdYou, in this projectPrivate project notes; add it to .gitignore
.claude/rules/*.mdThe projectInstructions split by topic, optionally only for certain files
.claude/skills/<name>/SKILL.mdThe project (or ~/.claude/skills/ for you)Skills you run with /name
.claude/agents/*.mdThe project (or ~/.claude/agents/ for you)Subagent definitions
.mcp.jsonThe projectMCP servers shared with the team
~/.claude/keybindings.jsonYouCustom keyboard shortcuts
~/.claude/projects/<project>/memory/You, per projectAuto memory: notes Claude writes for itself

When the same setting appears in several files, the one highest in this order wins:

Which settings file wins, highest first
  1. Managed settings

    Your organization's policy, which nothing else overrides

  2. Command line

    A --settings value, for that one session

  3. Project local

    .claude/settings.local.json, your personal project overrides

  4. Shared project

    .claude/settings.json, committed for the team

  5. User

    ~/.claude/settings.json, your defaults everywhere

Lists such as permission rules are combined across files instead of replaced, and a deny rule anywhere beats an allow rule anywhere. What belongs inside the CLAUDE.md files has its own guide: the CLAUDE.md file explained.

A starter settings.json

Save this as .claude/settings.json in a project, or as ~/.claude/settings.json to apply it everywhere:

json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "defaultMode": "default",
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)"
    ]
  }
}

"defaultMode": "default" makes new terminal sessions start in Manual mode, so Claude asks before each edit and command. The deny rules stop Claude's file tools from reading environment files, where passwords and keys usually live, and anything in a secrets folder.

Claude Code reloads most settings edits automatically. Run /status to confirm which files loaded.

Quick check0 of 3 correct

Which command starts a fresh conversation when you switch to an unrelated task?

Where do your personal settings for every project live?

Your team's .claude/settings.json allows a command and your user settings deny it. What happens?

What to do next

Print this page or keep it pinned, and learn three commands a week instead of all of them at once, starting with /clear, /context and /rewind. When long sessions start eating into your plan, the guide to Claude Code usage limits shows which of these commands stretch it furthest. The Claude Code course has a lesson dedicated to the shortcuts that save the most time.

Printable one-pager plus 12 situation recipes

The 30 commands and shortcuts you use most on a single printable page, plus 12 'when this happens, type this' recipes for the moments people get stuck.

Enter your email and the full section opens right here. You also get a free lesson from the course.

No spam. One click to unsubscribe. We use your email to send you the course and AI tips.

Frequently asked questions

Why don't I see some of these commands?

Some commands depend on your platform, plan or setup. For example, /desktop only appears on macOS and x64 Windows when you sign in with a Claude subscription, and /upgrade doesn't show on Enterprise plans. If a newer command is missing everywhere, run claude update.

Can I create my own slash commands?

Yes. A custom command is a skill: a folder containing a SKILL.md file, saved in .claude/skills/ for one project or ~/.claude/skills/ for all your projects, which you then run as /folder-name. Older single-file commands in .claude/commands/ still work too.

Can I change the keyboard shortcuts?

Yes. Run /keybindings to create or open ~/.claude/keybindings.json, where you can rebind or switch off most actions, and changes apply without a restart. A few text-editing shortcuts, such as Ctrl+W, can't be remapped.

Does Claude Code have a Vim mode?

Yes. Turn it on in /config under Editor mode, or set editorMode to vim in ~/.claude/settings.json. The old /vim command has been removed.

Where are my Claude Code conversations stored?

On your own computer, as plain-text files under ~/.claude/projects/, deleted after 30 days by default; the cleanupPeriodDays setting changes that. Running claude purge deletes everything Claude Code has stored for one project.

Keep reading