Skip to main content

Keyboard Shortcuts

Module: Navigation & Shortcuts | Lesson: 1 of 4 | Time: ~10 minutes

What You Will Learn

  • Essential shortcuts: Escape, Ctrl+C, Ctrl+D
  • How to navigate input history
  • How to enter multi-line input
  • All available keybindings

Prerequisites

Why Keyboard Shortcuts Matter

When you first started using Claude Code, you probably typed a message and pressed Enter. That works fine, but as you use Claude Code more, you will find yourself wanting to do things faster — cancel a response, scroll through your previous prompts, or type a message that spans multiple lines.

Keyboard shortcuts let you do all of this without taking your hands off the keyboard. Think of them like the difference between clicking through menus in a program versus using Ctrl+C to copy — same result, but much faster once you build the habit.


The Most Important Shortcuts

Enter — Send Your Message

You already know this one. Type your prompt and press Enter to send it to Claude.

You: What files are in this project?
[press Enter]

Claude immediately begins processing your request.

Shift+Enter — New Line (Multi-Line Input)

What if you want to type a long, detailed prompt that spans several lines? If you press Enter, it sends the message. Instead, press Shift+Enter to add a new line without sending.

You: I need you to do three things:
[press Shift+Enter]
1. Create a new file called index.html
[press Shift+Enter]
2. Add a basic HTML template
[press Shift+Enter]
3. Include a heading that says "Hello World"
[press Enter to send]
When to use multi-line input

Multi-line prompts are great when you have a list of tasks, want to include code snippets in your prompt, or need to give Claude detailed step-by-step instructions. The clearer your prompt, the better Claude's response.

Escape — Dismiss or Cancel

The Escape key is your "nevermind" button. It serves several purposes:

  • Dismiss autocomplete suggestions — If Claude Code is suggesting a completion and you do not want it, press Escape.
  • Exit the current input — If you have typed something but decide not to send it, press Escape to clear the input area.
  • Cancel a tool use — If Claude is about to run a command and asks for permission, press Escape to deny it.

Ctrl+C — Stop Claude Mid-Response

Sometimes Claude starts responding and you realize you asked the wrong question, or the response is going in the wrong direction. Press Ctrl+C to interrupt Claude immediately.

You: List every file in my entire computer
[Claude starts generating a massive response]
[press Ctrl+C]
You: Actually, just list the files in this project folder
Ctrl+C on Windows

On Windows, Ctrl+C is normally used to copy text. Inside Claude Code (which runs in the terminal), Ctrl+C instead sends an interrupt signal. This is standard terminal behavior. To copy text from the terminal, use your terminal's copy shortcut (often Ctrl+Shift+C or right-click).


Up Arrow and Down Arrow — Prompt History

Just like the Windows Command Prompt remembers your previous commands, Claude Code remembers your previous prompts. Press the Up Arrow to cycle back through messages you have sent, and Down Arrow to cycle forward.

This is extremely useful when you want to:

  • Re-send a prompt you sent earlier
  • Modify a previous prompt slightly and send it again
  • Remember what you asked a few messages ago
[press Up Arrow]  → Shows your last prompt
[press Up Arrow] → Shows the one before that
[press Down Arrow] → Goes back to the more recent one

Tab — Autocomplete

When Claude Code shows you suggestions (such as file names or command completions), press Tab to accept the suggestion. This saves typing and reduces typos.


Advanced Shortcuts

Ctrl+O — Open an Editor

If you need to write a very long or complex prompt, the multi-line input with Shift+Enter can feel cramped. Press Ctrl+O to open your prompt in an external text editor (such as Notepad or VS Code, depending on your system configuration). Write your prompt there, save and close the editor, and the text will be sent to Claude Code.

Setting your preferred editor

Claude Code uses the editor set in your system's EDITOR environment variable. If you are not sure what that is, do not worry — you can ask Claude Code to help you set it:

You: How do I set my default editor to VS Code on Windows?

Ctrl+R — Fuzzy Search History

If you have sent many prompts and cannot remember the exact one you want, press Ctrl+R to search through your prompt history. Start typing any part of a previous prompt and Claude Code will find matches.

[press Ctrl+R]
[type "html"] → Finds your earlier prompt about creating an HTML file
[press Enter] → Loads that prompt into the input area

This is much faster than pressing the Up Arrow dozens of times.


Customizing Keybindings

If you prefer different key combinations, Claude Code lets you customize its keyboard shortcuts. Your custom keybindings are stored in ~/.claude/keybindings.json.

To see or modify your keybindings, you can ask Claude:

You: Show me how to customize my keybindings in Claude Code

Or you can directly open the file in your text editor:

You: Open ~/.claude/keybindings.json

The file uses a JSON format where each entry maps an action to a key combination:

[
{
"key": "ctrl+s",
"command": "submit",
"description": "Send the current message"
}
]
Be careful with conflicts

If you bind a key that your terminal already uses (like Ctrl+C for interrupt), the terminal shortcut usually takes priority. Stick to combinations that do not conflict with your terminal emulator.


Quick Reference Card

Here is every shortcut covered in this lesson, in one place:

ShortcutWhat It Does
EnterSend your message
Shift+EnterNew line (multi-line input)
EscapeDismiss / cancel
Ctrl+CStop Claude mid-response
Up ArrowPrevious prompt in history
Down ArrowNext prompt in history
TabAccept autocomplete suggestion
Ctrl+OOpen prompt in external editor
Ctrl+RFuzzy search through prompt history

Try It Yourself

Practice each shortcut in a quick hands-on session:

  1. Open Claude Code in any folder.
  2. Send a simple prompt by pressing Enter: What is 2 + 2?
  3. Write a multi-line prompt using Shift+Enter:
    Tell me three things:
    [Shift+Enter]
    1. What day of the week is it?
    [Shift+Enter]
    2. What is the capital of France?
    [Shift+Enter]
    3. What is 10 times 10?
    [Enter to send]
  4. Press Ctrl+C while Claude is responding to interrupt it.
  5. Press the Up Arrow twice to scroll back through your prompt history, then press Enter to re-send an older prompt.
  6. Press Ctrl+R, type part of a previous prompt, and select it.
  7. Press Escape when you see any autocomplete suggestion to dismiss it.
Build muscle memory

You do not need to memorize every shortcut right now. Start with Enter, Shift+Enter, Ctrl+C, and the Up Arrow. Add the others as you get comfortable.


What You Learned

  • Enter sends your message; Shift+Enter adds a new line without sending.
  • Escape dismisses suggestions and cancels actions.
  • Ctrl+C stops Claude mid-response — essential when things go off track.
  • Up/Down Arrows let you cycle through your prompt history.
  • Ctrl+O opens an external editor for long prompts.
  • Ctrl+R lets you fuzzy-search your prompt history.
  • Tab accepts autocomplete suggestions.
  • You can customize all keybindings in ~/.claude/keybindings.json.

Help Us Improve

How was this lesson? Take 2 minutes to share your feedback — it helps us make the tutorials better for everyone.

Give Feedback →

Next Up

Next: Slash Commands Overview