Skip to content

Keyboard Controls and Navigation

Escape, accept, reject, scroll, switch modes. The shortcuts that make you fast instead of fumbling.

About 15 keyboard shortcuts separate someone who looks comfortable in Claude Code from someone who's clearly fumbling. Once they're in muscle memory, you stop thinking about the tool and just use it.

The Controls You'll Use Every Session

Learn these first. You'll hit them dozens of times per session.

Ctrl+C cancels whatever's happening. Claude Code going in the wrong direction mid-generation? Hit it. Typed something you don't want to send? Hit it. Your escape hatch.

Ctrl+D exits the session. Gone. Use this when you're done, not when you want to start over (there's a better reset method, covered later).

Up and Down arrows cycle through previous prompts. Same as regular terminal history. Sent a prompt that almost worked? Arrow up, tweak, send again.

Ctrl+L clears the screen without erasing conversation history. Just cleans up visual clutter.

Ctrl+R opens reverse search through your command history. Type a few characters and it finds matching previous prompts. Surprisingly handy when you half-remember something you asked 20 minutes ago.

Mode Switching

Three permission modes, toggled without leaving your prompt.

Shift+Tab (or Alt+M) cycles between them: normal mode (asks permission for each action), Auto-Accept mode (approves everything automatically), and Plan Mode (reasons and plans but writes no code).

Plan Mode is underrated. When you're unsure about an approach, switch to Plan Mode first. Let Claude Code think through the problem and explain what it would do. Plan looks good? Switch back to normal and tell it to execute.

Alt+T (or Option+T on macOS) toggles extended thinking. Makes Claude Code reason more deeply before responding. Alt+P (or Option+P) lets you switch models without clearing your current prompt.

Multiline Input

Enter sends your message by default. Sometimes you need line breaks in a longer prompt.

Your options:

  • Backslash then Enter (\ + Enter): Works everywhere. The safe bet.
  • Option+Enter: Default on macOS.
  • Shift+Enter: Works in iTerm2, WezTerm, Ghostty, and Kitty. If your terminal doesn't support it, run /terminal-setup inside Claude Code to configure it.
  • Ctrl+J: Inserts a line feed. Works universally.
  • Paste mode: Paste a multi-line block and Claude Code detects it, keeps the formatting.

Ctrl+G is the one people sleep on. It opens your current prompt in your default text editor. Write the whole thing there, save, close, and it gets sent. For long or carefully structured prompts, this beats wrestling with terminal line breaks.

Quick Prefixes and Slash Commands

Three characters at the start of your input change what happens next.

/ opens the command menu. /help for available commands, /vim for vim keybindings, /terminal-setup to configure your terminal for better shortcut support. Slash commands also include skills (reusable prompt templates).

! is bash mode. Instead of talking to Claude Code, you run a shell command directly and the output gets added to conversation context. !git status is way faster than typing "can you run git status for me."

@ triggers file path autocomplete. Type @src/ and get suggestions for files in that directory. Beats typing full paths every time.

Text Editing Within Your Prompt

Stop arrow-keying across long prompts character by character.

Alt+B jumps back one word. Alt+F jumps forward one word. Ctrl+K kills everything from cursor to end of line. Ctrl+U kills the entire line. Ctrl+Y yanks back whatever you just deleted. Alt+Y cycles through your delete history.

Standard readline shortcuts. If you know them from bash, they work the same way here.

Vim Mode

If you are a vim user, run /vim inside Claude Code. You get full vim keybindings for editing your prompts: hjkl navigation, w/e/b for word movement, dd to delete a line, yy to yank, the works.

Handling Permissions and Suggestions

When Claude Code asks for permission (edit a file, run a command), a dialog pops up. Left and Right arrows cycle through the dialog tabs.

Sometimes you'll see grayed-out prompt suggestions. Tab accepts the suggestion into your input. Enter accepts it and immediately sends it.

Don't miss this one: Esc+Esc (press Escape twice) triggers a rewind. Restores your code and conversation to a previous checkpoint. Way faster than asking Claude Code to undo something.

macOS Users: Fix Your Option Key

If Alt+B, Alt+F, and other Option-based shortcuts aren't working on macOS, your terminal needs to treat the Option key as a Meta key.

iTerm2: Profiles, Keys, set Left Option Key to "Esc+". Terminal.app: Profiles, Keyboard, check "Use Option as Meta Key."

Without this, Option just types special characters instead of triggering shortcuts.

Try It

Open Claude Code and run through this sequence:

claude
  1. Type a prompt but do not send it. Press Ctrl+C to cancel.
  2. Press Up arrow to bring back your last prompt.
  3. Press Shift+Tab twice to cycle through permission modes. Watch the indicator change.
  4. Type !echo "hello from bash mode" and press Enter. See how the output appears in context.
  5. Type @ and start typing a filename from your project. Watch the autocomplete kick in.
  6. Press Ctrl+L to clear the screen, then Ctrl+D to exit.

30 seconds. Covers the shortcuts you'll actually reach for.

TL;DR

  • Ctrl+C to cancel, Ctrl+D to exit, Up/Down for history
  • Shift+Tab cycles permission modes. Plan Mode is your "think before acting" switch.
  • Multiline: \ + Enter works everywhere
  • ! prefix = bash mode. Faster than asking Claude Code to run commands for you.
  • macOS users: configure Option as Meta key or Alt shortcuts won't work

Mastering Claude Code

Lesson 3 of 70