Claude Code keyboard shortcuts and commands cheat sheet
Every Claude Code keyboard shortcut worth knowing, for Mac and Windows, plus the slash commands that matter. One page, checked against Anthropic's docs.
Contents
The Claude Code keyboard shortcuts you'll use every day are few: Esc stops Claude, Esc Esc rewinds, Shift+Tab changes the permission mode (plan mode included), Ctrl+R searches your history, and / opens the command list. Type ? on an empty prompt for the full panel. The tables below have the rest, for Mac and Windows.
Everything is from Anthropic's interactive mode and commands pages, read on 22 October 2026. Shortcuts can vary by terminal, and Claude Code adds new ones often, so ? in your own session is the final word.
The everyday shortcuts#
| Shortcut | What it does |
|---|---|
Esc |
Stop Claude mid-turn so you can redirect it. The work so far stays. Also closes a dialog |
Esc Esc |
With text in the prompt: clear it (it goes to history). With an empty prompt: open the rewind menu |
Shift+Tab |
Cycle permission modes: Manual, accept edits, plan, then bypass and auto when available |
Ctrl+C |
Interrupt a running operation. With nothing running: first press clears the prompt, second exits |
Ctrl+D |
Exit (press twice). With text in the prompt it deletes the character after the cursor |
Ctrl+R |
Search your previous prompts |
Up / Down |
Move through the prompt, then through history |
Ctrl+L |
Redraw a garbled screen, keeping input and history |
Ctrl+O |
Open the transcript viewer: every tool call, with the model on each reply |
Ctrl+B |
Send running shell commands and agents to the background (tmux users press it twice) |
Ctrl+T |
Show or hide Claude's to-do list |
Ctrl+G |
Edit your prompt in your text editor |
Ctrl+S |
Stash the prompt; press again on an empty prompt to bring it back |
Ctrl+Enter |
Send your queued messages now |
Tab |
Accept an autocomplete suggestion |
? |
Toggle the shortcut help panel (on an empty prompt) |
The rewind menu is the one most people don't know they have. It lists your prompts; pick one and restore the code, the conversation or both to that point. It only covers edits made through Claude's own file tools, not files changed by shell commands, and Anthropic is clear it's no replacement for git. More in the checkpointing docs.
Ctrl+B is the one to know when a dev server would otherwise hold up the session: what happens to a backgrounded command, and when exiting stops it, is in Claude Code background tasks.
Mac and Windows differences#
| What | Mac | Windows and Linux |
|---|---|---|
| Switch model, keeping your prompt | Option+P |
Alt+P |
| Extended thinking on or off | Option+T |
Alt+T |
| Fast mode on or off | Option+O |
Alt+O |
| Paste an image | Ctrl+V (Cmd+V in iTerm2) |
Ctrl+V; Alt+V on Windows and WSL |
| Cycle permission modes | Shift+Tab |
Shift+Tab, or Alt+M on Windows when the terminal doesn't pass Shift+Tab |
| Suspend to the shell | Ctrl+Z, then fg to resume |
Ctrl+Z on Linux; not on Windows |
| Delete the previous word | Option+Delete |
Ctrl+Backspace on Windows |
On a Mac, most Option shortcuts need Option set as Meta in your terminal (iTerm2, Terminal.app and the rest each have a setting). Without it, Option+P does nothing instead of switching models. Option+T is the exception: it works either way. Thinking is always on for Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models, so the toggle does nothing there.
Editing the prompt#
These follow the readline habits of most shells:
| Shortcut | What it does |
|---|---|
Ctrl+A / Ctrl+E |
Start / end of the line |
Ctrl+K |
Delete to the end of the line |
Ctrl+U |
Delete to the start of the line (Cmd+Backspace in iTerm2 and Terminal.app) |
Ctrl+W |
Delete back to the previous space: one press removes a whole path |
Ctrl+Y |
Paste what you last deleted; Alt+Y after it cycles older deletions |
Alt+B / Alt+F |
Back / forward one word |
Alt+D |
Delete to the end of the word |
Ctrl+_ |
Undo the last edit to the prompt |
New lines without sending#
| Method | Where it works |
|---|---|
\ then Enter |
Every terminal |
Ctrl+J |
Every terminal, no setup |
Shift+Enter |
iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal |
Option+Enter |
Mac, with Option as Meta |
In VS Code, Cursor, Alacritty or Zed, run /terminal-setup once to get Shift+Enter.
Prefixes at the start of the prompt#
| Type | What happens |
|---|---|
/ |
Commands and skills |
! |
Shell mode: run a command directly and hand its output to Claude |
@ |
File path autocomplete |
? |
The shortcut panel (empty prompt only) |
The slash commands that matter#
Claude Code has many more; these are the ones worth learning first.
| Command | What it does |
|---|---|
/clear |
Start a fresh conversation. The old one stays in /resume |
/compact [focus] |
Summarise the conversation to free context, keeping what you name |
/context |
See what's filling the context window, as a grid |
/usage |
Session cost, plan usage limits and what's using them (/cost and /stats are aliases) |
/model |
Switch model, and set effort with the arrow keys |
/effort |
Set the effort level directly |
/status |
Version, model, account and connection |
/config |
Settings: theme, model, editor mode (vim), release channel |
/init |
Write a CLAUDE.md for the project |
/memory |
Edit CLAUDE.md files and auto memory |
/mcp |
Manage MCP servers and their sign-ins |
/permissions |
Allow, ask and deny rules for tools |
/resume |
Pick up an earlier conversation |
/rewind |
The rewind menu (aliases /checkpoint, /undo) |
/branch |
Branch the conversation here and try another direction |
/review |
Review the current diff, a branch or a pull request |
/btw |
Ask a side question without adding it to the conversation |
/tasks |
See and manage background shells and subagents |
/add-dir |
Give this session access to another folder |
/export |
Save the conversation as plain text |
/statusline |
Set up the status line |
/keybindings |
Open your shortcuts file |
/help |
Every command |
/exit |
Quit (alias /quit) |
A command only runs when it starts your message. Some, such as /status, /tasks and /usage, run at once even while Claude is mid-turn; most others wait for the turn to end. If you're watching your limits, /usage and /context are the pair to know: our guides on checking Claude Code usage and why Claude Code uses so many tokens explain what they show.
From the shell#
| Command | What it does |
|---|---|
claude |
Start a session |
claude "task" |
Start with a first prompt |
claude -p "query" |
Answer once and exit |
claude -c |
Continue the latest conversation in this folder |
claude -r |
Resume an earlier conversation |
Make your own shortcuts#
Run /keybindings to open your keyboard shortcuts file and rebind actions there. The readline word shortcuts above can't be remapped. For vim-style editing, open /config and set Editor mode. Many shortcuts also have an environment variable or setting behind them; our environment variables guide lists the useful ones.
And one from Shuriken#
Shuriken runs Claude Code chats in its own window rather than a terminal, so it has its own keys. The one to know is ⌘K: one search over your chats, files, settings and actions. If you'd like to try it alongside your terminal, download Shuriken.
Sources
- Interactive mode: keyboard shortcuts (Claude Code docs) (accessed 22 October 2026)
- Commands (Claude Code docs) (accessed 22 October 2026)
- Checkpointing (Claude Code docs) (accessed 22 October 2026)
- Claude Code quickstart: essential commands (accessed 22 October 2026)
Frequently asked questions
How do I see all keyboard shortcuts in Claude Code?
Type ? on an empty prompt to toggle the shortcut help panel. Type / to see every command and skill available to you, and /keybindings to open your own shortcuts file.
What does pressing Esc twice do in Claude Code?
With text in the prompt, it clears the draft and saves it to history. With an empty prompt, it opens the rewind menu, where you can restore code, the conversation or both to an earlier point.
How do I add a new line without sending in Claude Code?
Shift+Enter works natively in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal. Everywhere else, type a backslash then Enter, or press Ctrl+J. Run /terminal-setup to add Shift+Enter in VS Code, Cursor, Alacritty or Zed.
Why don't the Alt shortcuts work on my Mac?
Alt+B, Alt+F, Alt+D, Alt+Y and Alt+P need your terminal to treat Option as Meta. Turn that on in your terminal's settings. Option+T works without it.
How do I switch to plan mode with the keyboard?
Press Shift+Tab to cycle the permission modes: Manual, accept edits, plan, and then bypass and auto when they're available.