Claude Code Cheat Sheet: Commands, Flags and Shortcuts
A one-page Claude Code cheat sheet: CLI commands, launch flags, daily slash commands, keyboard shortcuts, prompt prefixes and where config files live.
Josh Pocock8 min read
AI Coding
Cheat sheet
Stride AI Academy
This Claude Code cheat sheet puts the commands, flags and shortcuts you use most on one page. Start a session with claude, continue the last one with claude -c, run a one-off task with claude -p "...", and type / inside a session for every slash command. Esc stops Claude mid-turn, Shift+Tab cycles permission modes, and Ctrl+C twice exits.
It covers terminal commands, launch flags, the slash commands worth memorizing, keyboard shortcuts, prompt prefixes and file locations. It's a quick reference, so each line links to a fuller guide where one exists. Everything here was checked against Claude Code's CLI reference, commands reference, interactive mode docs and .claude directory docs on November 22, 2026. Shortcuts can vary by terminal, and on a Mac the Alt shortcuts for text editing need Option set as Meta in your terminal.
Claude Code commands you run in the terminal
| Command | What it does |
|---|---|
claude |
Start an interactive session in the current folder |
claude "explain this project" |
Start a session with a first prompt |
claude -p "query" |
Answer once and exit, for scripts (headless mode) |
cat logs.txt | claude -p "explain" |
Pipe content in |
claude -c |
Continue the most recent conversation in this folder |
claude -r "auth-refactor" |
Resume a session by ID or name |
claude update |
Update to the latest version |
claude install stable |
Install or reinstall a version or channel |
claude doctor |
Read-only install and settings diagnostics |
claude auth login |
Sign in. --console bills to a Console account instead |
claude auth logout |
Sign out |
claude auth status |
Show sign-in status as JSON, or text with --text |
claude mcp |
Configure MCP servers |
claude plugin |
Manage plugins |
claude agents |
Open agent view for background sessions |
claude remote-control |
Start a Remote Control server. Alias: claude rc |
claude purge [path] |
Delete Claude Code's saved data for one project |
Mistype a subcommand and Claude Code suggests the right one. For keeping it current, see how to update Claude Code.
Claude Code flags worth knowing
| Flag | What it does |
|---|---|
--model opus |
Use a model for this session. See changing the model |
--effort high |
Set the effort level for this session |
--permission-mode plan |
Start in a permission mode such as plan or acceptEdits |
--continue, -c |
Load the most recent conversation in this folder |
--resume, -r |
Resume by ID or name, or open a picker |
--name, -n |
Name the session so you can resume it by name |
--worktree, -w |
Start in an isolated git worktree |
--add-dir ../lib |
Give Claude access to another folder |
--allowedTools |
Tools that run without a permission prompt |
--disallowedTools |
Deny rules, or remove tools entirely |
--settings |
Load a settings file or inline JSON for this session |
--mcp-config |
Load MCP servers from a JSON file or string |
--append-system-prompt |
Add text to the end of the system prompt |
--output-format json |
text, json or stream-json, for -p runs |
--max-turns 3 |
Limit agentic turns, for -p runs |
--max-budget-usd |
Stop a -p run once estimated spend reaches an amount |
--chrome |
Turn on the Chrome browser integration |
--debug |
Debug mode, with optional filters such as --debug='mcp,startup' |
--version, -v |
Print the version |
--dangerously-skip-permissions |
Skip permission prompts. Read what it skips first |
A common scripted run:
claude -p "list the TODOs in src" --output-format json --max-turns 3Slash commands you'll use every day
Type / at the start of a message to see every command, and keep typing to filter. These are the ones worth memorizing. The full list, plus how to write your own, is in our Claude Code slash commands guide.
| Command | What it does |
|---|---|
/init |
Create a starter CLAUDE.md |
/clear |
New conversation, empty context |
/compact [focus] |
Summarize the conversation to free context |
/context |
Show what's filling the context window |
/model [model] |
Switch model and save it as your default |
/effort [level] |
Set the effort level |
/fast |
Toggle fast mode |
/plan [task] |
Enter plan mode |
/permissions |
Manage allow, ask and deny rules |
/mcp |
Manage MCP servers and sign-in |
/memory |
Edit CLAUDE.md files and auto memory |
/resume |
Reopen an earlier conversation |
/rewind |
Roll code and conversation back to a checkpoint |
/diff |
Review the changes in your working tree |
/btw [question] |
Ask a side question without adding to the conversation |
/usage |
Session cost, plan limits and activity |
/status |
Version, model, account and connectivity |
/config |
Open settings. /config key=value sets one directly |
/doctor |
Setup checkup that can fix problems |
/release-notes |
Browse the changelog by version |
/exit |
Quit. Alias: /quit |
Claude Code keyboard shortcuts
Controlling the session
| Shortcut | What it does |
|---|---|
Esc |
Stop Claude mid-turn, keeping the work done so far |
Esc Esc |
Clear your draft, or open the rewind menu when the prompt is empty |
Ctrl+C |
Interrupt, or clear input. A second press on an empty prompt exits |
Ctrl+D |
Exit (press twice) |
Shift+Tab |
Cycle permission modes. Alt+M on some Windows setups |
Option+P / Alt+P |
Switch model without clearing your prompt |
Option+T / Alt+T |
Toggle extended thinking, on models that allow it |
Option+O / Alt+O |
Toggle fast mode |
Ctrl+O |
Toggle the transcript viewer |
Ctrl+B |
Send a running command or agent to the background. Tmux users press twice |
Ctrl+T |
Show or hide Claude's task checklist |
Ctrl+R |
Search your command history |
Typing your prompt
| Shortcut | What it does |
|---|---|
\ then Enter |
New line, in any terminal |
Ctrl+J |
New line, in any terminal |
Shift+Enter |
New line in iTerm2, WezTerm, Ghostty, Kitty, Warp and Windows Terminal 1.25+ |
Ctrl+G |
Open your prompt in your text editor |
Ctrl+S |
Stash your prompt, then press again to restore it |
Ctrl+V |
Paste an image. Cmd+V in iTerm2, Alt+V on Windows and WSL |
Ctrl+K / Ctrl+U |
Delete to the end or start of the line |
Ctrl+W |
Delete back to the previous space |
Ctrl+_ |
Undo your last edit to the prompt |
Up / Down |
Move through the prompt, then through history |
Run /terminal-setup to add the Shift+Enter binding in VS Code, Cursor and some other terminals. To change any shortcut, run /keybindings.
Prompt prefixes
| Type | What happens |
|---|---|
/ |
Run a command or skill |
! |
Shell mode: run a command and add its output to the session |
@ |
File path autocomplete |
? on an empty prompt |
Show the shortcut help panel |
ultrathink anywhere |
Ask for deeper reasoning on that one turn |
Where Claude Code keeps its files
| Path | What it is |
|---|---|
~/.claude/settings.json |
Your settings for every project |
.claude/settings.json |
Shared project settings, committed to Git |
.claude/settings.local.json |
Your settings for one project, kept out of Git |
~/.claude.json |
Account, personal MCP servers and project state. Claude Code writes it |
CLAUDE.md or .claude/CLAUDE.md |
Project instructions (examples) |
~/.claude/CLAUDE.md |
Your instructions for every project |
CLAUDE.local.md |
Your notes for one project |
.claude/rules/*.md |
Topic or path-scoped rules |
.claude/skills/<name>/SKILL.md |
Project skills, run as /name |
~/.claude/skills/ |
Your skills for every project |
.claude/agents/*.md |
Project subagents. ~/.claude/agents/ for yours |
.mcp.json |
Shared project MCP servers |
~/.claude/keybindings.json |
Custom keyboard shortcuts |
~/.claude/projects/ |
Transcripts and auto memory |
On Windows, ~ means %USERPROFILE%. For what each settings key does and which file wins, see our settings.json reference.
Learn to build with Claude Code
The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.
FAQ
What are the most useful Claude Code commands?
In the terminal: claude, claude -c to continue, claude -p for one-off tasks and claude update. Inside a session: /clear, /compact, /context, /model, /plan, /permissions and /rewind cover most daily work.
How do I see all Claude Code commands?
Type / at the start of a message to open the command menu, then type letters to filter it. Run /help for help, and claude --help in the terminal for CLI flags, though the docs note it doesn't list every flag.
How do I stop Claude Code while it's working?
Press Esc. Claude stops the current response or tool call and keeps the work done so far, so you can redirect it. Ctrl+C also interrupts a running operation.
How do I add a new line in a Claude Code prompt?
Type \ then Enter, or press Ctrl+J, which work in any terminal. Shift+Enter works natively in iTerm2, WezTerm, Ghostty, Kitty, Warp and recent Windows Terminal, and /terminal-setup adds it to VS Code and Cursor.
How do I switch permission modes in Claude Code?
Press Shift+Tab to cycle through the modes, including accept edits and plan mode. To start in one, launch with --permission-mode, such as claude --permission-mode plan. Our permissions guide explains each mode.
Can I change Claude Code keyboard shortcuts?
Yes. Run /keybindings to open your ~/.claude/keybindings.json file and remap actions there. Some text-editing shortcuts, like the word-movement keys, can't be remapped.