TellWorldAI World Archive
Ask中文

Home›Practice›Practice

Practice

Claude Code interactive mode: shortcuts and tips

Common Claude Code interactive-mode shortcuts and tips: interrupting, queuing messages, running commands with !, asking side questions with /btw, and fixing Option-key shortcuts on macOS.

Who this is for

People who already run Claude Code and talk to it in the terminal every day. After reading, you can use the shortcuts you need most, run shell commands with !, ask side questions with /btw without adding them to the history, queue messages while Claude works, and fix Option-key shortcuts that do not respond on macOS.

What it is

Interactive mode is the session where you type into the terminal and Claude Code replies as it works. It comes with a set of shortcuts for editing the input, interrupting a response, switching permission modes and models, and inspecting tool calls. The exact keys can vary by platform and terminal.[1]

Setup

  • Make sure claude runs in your terminal and that you are signed in.
  • On a Mac, the Option-key shortcuts that appear as Alt+B, Alt+F, Alt+D, Alt+Y and Alt+P need Option set as the Meta key in your terminal first. Option+T works on macOS without that setting.[1]

Editing and input

  • New lines: \ followed by Enter works in all terminals. Ctrl+J works in any terminal without configuration, and Shift+Enter is native in iTerm2, WezTerm, Ghostty, Kitty, Warp and Windows Terminal.[1]
  • Deleting and pasting: Ctrl+K deletes to the end of the line and Ctrl+U deletes to the start. Deleted text is stored, and Ctrl+Y pastes back the text you last deleted.[1]
  • Prefixes: / at the start opens commands and skills, @ triggers file path autocomplete, and ! at the start enters shell mode.[1]
  • History: Up recalls earlier prompts, including prompts from past sessions in the same project, because input history is stored per working directory.[1]
  • Ctrl+R searches previous commands in reverse.[1]

Getting started

  1. Try shell mode first. Start the input with ! and the command runs directly, for example:[1]
! npm test
! git status
! ls -la
  1. The command and its output go into the conversation context, and Claude responds to the output automatically, so you do not need a second prompt. To leave shell mode, press Escape, Backspace or Ctrl+U on an empty prompt.[1]
  2. To ask something without leaving it in the history, use /btw. It answers from what is already in the conversation and cannot read files, run commands or search.[1]
  3. Keep typing while Claude is busy. Pressing Enter queues the message rather than interrupting the turn, and queued entries stay listed until they are sent. To send them immediately, press Ctrl+Enter or Ctrl+X Ctrl+S; Ctrl+Enter requires Claude Code v2.1.275 or later.[1]
  4. To take queued messages back, press Up from the first line of the input box. They return to the input box.[1]

Interrupting, clearing and stashing

  • Ctrl+C interrupts a running operation. When nothing is running, the first press clears the input and a second press exits Claude Code.[1]
  • Esc stops the current response or tool call mid-turn so you can redirect Claude. The work already done is kept.[1]
  • With text in the input, double Esc clears it and saves the draft to history. With an empty input, double Esc opens the rewind menu.[1]
  • A draft cleared with Ctrl+C can be recovered. Right after clearing, with the prompt still empty, press Up; this requires v2.1.288 or later. After you send a message, Up can still step back to the draft, and Claude Code keeps the ten most recent cleared drafts for the session.[1]
  • Ctrl+S stashes the prompt when it has text. Pressed again on an empty prompt, it restores the stashed text, pasted content and input mode.[1]
  • Ctrl+L forces a full redraw while keeping input and history, which helps when the display is garbled.[1]

Permissions, models and details

  • Shift+Tab cycles the permission modes: default (shown as Manual in the mode indicator), acceptEdits and plan, then bypassPermissions and auto where available.[1]
  • Option+P (Alt+P on Windows and Linux) switches models without clearing the prompt.[1]
  • Option+O (Alt+O on Windows and Linux) toggles fast mode.[1]
  • Ctrl+O opens the transcript viewer, which shows detailed tool usage with a timestamp and the model used for each assistant message.[1]
  • /diff shows the changes in the working tree. With fullscreen rendering the diff panel opens beside the conversation; with the classic renderer the diff dialog opens above the prompt.[1]

Common questions

**A shortcut such as Alt+P does nothing on a Mac.** Check that Option is set as the Meta key in your terminal. Option+T does not need that setting. It has no effect on Opus 5.5, Sonnet 5.5, Haiku 5.5 or the Fable models, which always use extended thinking.[1]

A command runs too long. When a command reaches its timeout before finishing, Claude Code moves it to the background instead of stopping it, unless the command starts with sleep.[1]

Next steps

This article covers the most-used keys. For the complete shortcut list, the transcript viewer keys and vim editing mode, use the official interactive mode page.[1]

Sources

  1. 1
    Interactive modeAnthropic Claude Code docs

Cite this page: Claude Code interactive mode: shortcuts and tips. TellWorld, https://www.tellworld.net/practice/practice-claude-code-interactive-mode. Updated 2026-11-14

Related news

View all