Skip to content

Interface and Shortcuts

📚 Series Navigation: The previous article 13 Project Structure Analysis taught you how to quickly take over an unfamiliar codebase. This article returns to the tool itself, unlocking the hidden efficiency boosters in the terminal interface. Next article 15 Slash Commands (/).

"I wanted to write a long prompt with three points, but the moment I pressed Enter to start a new line, it just sent it out! Only half a sentence written, Claude started reading files wildly, and I couldn't stop it."

This is a grievance common to almost every beginner using the Claude Code terminal version. The terminal interface looks like a rudimentary input box, giving the illusion that you can only type one sentence and press Enter.

Actually, Claude Code's terminal is extremely feature-rich, wrapping a complete readline-like experience. Mastering a few core shortcuts is the dividing line between 'clumsy beginner' and 'efficient pro'.

After reading this article, you will get:

  • The correct posture for multi-line input (no more accidental sends)
  • How to quickly recall and modify historical prompts (like the up/down arrows in shell)
  • The ! shortcut to execute bash commands directly within Claude
  • How to gracefully interrupt a wildly running Claude

01 The Biggest Pain Point: How to Input Multiple Lines?

In the terminal, pressing Enter means "Send". So how do you write a structured prompt with line breaks?

The Solution: Option + Enter (Mac) or Alt + Enter (Windows/Linux).

When you press this combination, the cursor will move to the next line without sending the message. You can write beautiful, multi-paragraph instructions:

text
Help me refactor the login function. (Press Option+Enter)
Specific requirements: (Press Option+Enter)
1. Extract the validation logic into a separate file (Press Option+Enter)
2. Add type definitions

Then press Enter alone to send the complete block.

⚠️ Mac Users Note: If your terminal (like iTerm2) has mapped the Option key to Meta (Esc+), Option+Enter might fail. You can either configure your terminal to treat Option as Normal, or simply use a text editor to write the prompt and paste it into the terminal.


02 Time Travel: Arrow Keys and History

Wrote a very long prompt, it failed, and you want to modify a few words and try again? Don't type it all over again!

Just like in a normal bash/zsh shell, press the Up Arrow (↑) key, and Claude Code will bring back your last sent prompt. Press it multiple times to flip further back in history. Use the Left/Right arrows to move the cursor and edit.

This is extremely useful when you are fine-tuning a prompt through trial and error.


03 The Hidden Killer Feature: ! Bash Execution

Sometimes you are chatting with Claude, and you suddenly want to see what files are in the current directory, or check the git status. Do you need to exit Claude, run ls, and then launch Claude again?

Absolutely not. Use the ! prefix.

In the Claude Code input box, if a line starts with !, it will be executed directly as a local shell command, completely bypassing the AI model (so it costs 0 tokens).

Examples:

  • !ls -la (List files)
  • !git status (Check git status)
  • !npm run test (Run tests yourself)

The output of the command will be printed directly in the terminal, and you can immediately refer to it in your next prompt to Claude. It's like having a full shell embedded inside the AI chat.


04 The Emergency Brake: Ctrl + C and Esc

What if Claude misunderstood your instruction, and is currently proposing a massive diff modifying 50 files, or spinning in a loop trying to read useless logs?

You need to pull the handbrake.

  • Ctrl + C: The universal interrupt signal in terminals. Pressing it while Claude is "thinking" or "reading" will force it to stop the current operation and return the prompt to you.
  • Esc twice (when input box is empty): Opens the /rewind menu, letting you revert file changes (as covered in the First Run article).

Don't be afraid to interrupt it. If you see it going down the wrong path, stopping it early saves both time and token costs.


05 Summary of Essential Shortcuts

Print this out or keep it in your head:

ActionShortcut / PrefixWhy you need it
Send MessageEnterSubmit current prompt
New Line (Multi-line)Option+Enter / Alt+EnterWrite structured, readable prompts
Recall History (Up Arrow)Modify and resend previous prompts
Run Shell Command!command (e.g., !git)Run local commands without exiting Claude
Interrupt AICtrl + CStop a runaway Claude
Clear InputCtrl + UQuickly delete everything in the current input box

💡 One-sentence summary: Use Option+Enter for multi-line, for history, and ! for shell commands to seamlessly blend AI conversation with native terminal workflows.


Next article 15 Slash Commands (/)—We've mastered the keyboard shortcuts, now let's look at Claude Code's built-in command system. How do you clear context? How do you switch models? How do you check your bill? Everything relies on the magical / commands.