# 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.

Source: https://shuriken.sh/guides/claude-code-keyboard-shortcuts

Every Claude Code keyboard shortcut worth knowing, for Mac and Windows, plus the slash commands that matter. One page, checked against Anthropic's docs.

By Shuriken Updated 27 October 2026 5 min read

**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](https://code.claude.com/docs/en/interactive-mode) and [commands](https://code.claude.com/docs/en/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](https://code.claude.com/docs/en/checkpointing).

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](https://shuriken.sh/guides/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) |

Shuriken runs your coding agents on your own computers and keeps them going when an account hits its limit.

[Download](https://shuriken.sh/download)

## 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](https://shuriken.sh/guides/claude-code-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](https://shuriken.sh/guides/check-claude-code-usage) and [why Claude Code uses so many tokens](https://shuriken.sh/guides/why-claude-code-burns-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](https://shuriken.sh/guides/claude-code-environment-variables) 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](https://shuriken.sh/download).

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-keyboard-shortcuts&text=Claude%20Code%20keyboard%20shortcuts%20and%20commands%20cheat%20sheet)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-keyboard-shortcuts)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-keyboard-shortcuts&t=Claude%20Code%20keyboard%20shortcuts%20and%20commands%20cheat%20sheet)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-keyboard-shortcuts&title=Claude%20Code%20keyboard%20shortcuts%20and%20commands%20cheat%20sheet)[E-mail](mailto:?subject=Claude%20Code%20keyboard%20shortcuts%20and%20commands%20cheat%20sheet&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-keyboard-shortcuts)

## Sources

- [Interactive mode: keyboard shortcuts (Claude Code docs)](https://code.claude.com/docs/en/interactive-mode) (accessed 22 October 2026)
- [Commands (Claude Code docs)](https://code.claude.com/docs/en/commands) (accessed 22 October 2026)
- [Checkpointing (Claude Code docs)](https://code.claude.com/docs/en/checkpointing) (accessed 22 October 2026)
- [Claude Code quickstart: essential commands](https://code.claude.com/docs/en/quickstart) (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.

Shuriken

The harness for your coding agents.

Run Claude Code, Codex and Gemini CLI on your own computers, move chats to your next account at a limit, and follow every chat from any device.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [How to change the model in Claude Code: Guide 27 Oct 2026 3 min read Change the model in Claude Code with /model, claude --model, an environment variable or settings.json. /model wins; Enter in its picker sets your default.](https://shuriken.sh/guides/change-model-in-claude-code)
- [Claude Code API Error 400 on tool_use: what to do: Guide 27 Oct 2026 4 min read A Claude Code API Error 400 about tool use means the saved history has a tool call out of step with its result. Update, then rewind past the broken turn.](https://shuriken.sh/guides/claude-code-api-error-400-tool-use)
- [Claude Code custom slash commands: make your own: Guide 27 Oct 2026 3 min read Make your own Claude Code slash commands: one Markdown file in .claude/commands or a skill, with arguments, shell output and allowed tools. With examples.](https://shuriken.sh/guides/claude-code-custom-slash-commands)
- [Claude Code thinking and effort levels, explained: Guide 27 Oct 2026 4 min read Claude Code's effort levels, low to max, set how much Claude thinks before it acts. What each level is for, the defaults, ultrathink, and how to set it.](https://shuriken.sh/guides/claude-code-effort-levels)
- [Claude Code chat history deleted? Set cleanupPeriodDays: Guide 27 Oct 2026 5 min read Claude Code deletes session transcripts after 30 days by default. Raise cleanupPeriodDays in settings.json to keep them, and back up what you can't lose.](https://shuriken.sh/guides/claude-code-history-deleted-after-30-days)
- [Claude Code hooks not working? Why they don't fire: Guide 27 Oct 2026 6 min read A Claude Code hook that never fires is either not loaded (missing from /hooks) or loaded with a matcher that matches nothing. The causes and their fixes.](https://shuriken.sh/guides/claude-code-hooks-not-working)
- [Does Claude Code remember between sessions? How memory works: Guide 27 Oct 2026 6 min read Does Claude Code remember between sessions? Only through CLAUDE.md files and auto memory. A past chat comes back only when you resume it.](https://shuriken.sh/guides/claude-code-memory-between-sessions)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
