all guides

Shortcuts most people miss, explained by monkey

(plus a cheat sheet)

comment: KEYS

The Claude Code prompt hides a stash, an undo, a shell, a history search and a side-question box. Most people only ever press Enter and Esc. Here's every key worth knowing, the traps in each one, and a cheat sheet to keep next to your terminal.

Claude Code's prompt box does a lot more than send messages. You can park a half-written prompt, get back one you wiped by accident, run your own commands, search everything you've typed and paste screenshots. None of it is hidden on purpose, it just isn't on screen. Press ? on an empty prompt and the shortcut panel opens.

The cheat sheet

cheat sheet
?              on an empty prompt: open the shortcut panel
Ctrl+S         park the draft / press again on an empty prompt to bring it back
Ctrl+C, then ↑ cleared it by accident? ↑ on the empty prompt brings it back
Ctrl+_         undo the last edit in the box (also Ctrl+Shift+-)
Ctrl+W         delete back to the last space (a whole path in one press)
Ctrl+Y         paste back what you just deleted
Ctrl+G         write the prompt in your own editor (also Ctrl+X Ctrl+E)
\ then Enter   new line without sending (Ctrl+J works too)
! command      run it yourself, Claude reads the output
@path/file     put a file's contents in your message
Ctrl+R         search every prompt you've typed, in every project
Ctrl+V         paste an image (Cmd+V only in iTerm2, Alt+V on Windows)
Esc            stop Claude, keep the work done so far
Esc Esc        text in box: clear it (↑ brings it back) / empty box: rewind
Ctrl+B         send the running command to the background
Ctrl+O         open the transcript
Option+P       switch model without losing your draft
/btw question  a side question that stays out of the conversation

Ctrl+S: park a half-typed prompt

You're halfway through a long prompt and need to ask something quick first. Press Ctrl+S: the text is put aside and the box is cleared. Ask your quick question. Then press Ctrl+S again on an empty prompt and the draft comes back, with the cursor where it was and anything you pasted still in it.

  • It also remembers the mode. A command you stashed in shell mode (starting with !) comes back in shell mode.
  • Ctrl+_ (or Ctrl+Shift+-) undoes your last edit in the box, for when you deleted the wrong thing rather than everything.

Wiped it by accident? Press ↑

One Ctrl+C clears the box. If you didn't mean to, press ↑ while the prompt is still empty and the draft comes back. This needs v2.1.288 or later. Esc twice with text in the box clears it too, and that draft is also saved, so ↑ brings it back.

! runs a command yourself

Start a line with ! and it runs as a shell command, typed by you, with no approval prompt. The output goes into the conversation and Claude answers it on its own, so this one line gets you an explanation of the failures without writing a second message:

cheat sheet
! npm test
  • Claude's reply costs the same as sending a normal prompt. It isn't free.
  • Your ! commands run outside the sandbox, even when sandboxing is on. The sandbox covers the commands Claude runs, not yours.
  • Tab completes from the ! commands you ran before.
  • Esc or Backspace on an empty prompt leaves shell mode.

@ puts a file in your message

cheat sheet
Explain the logic in @src/utils/auth.js
  • The file's contents go straight into your message, so Claude doesn't spend a step reading it.
  • @ on a folder (@src/components) gives the list of files, not what's in them.
  • Mentioning a file also loads the CLAUDE.md files in its folder and the folders above it.
  • A text file over 256KB isn't included, and it stops at the Read tool's limit (25,000 tokens by default).

Ctrl+R searches everything you've typed

Ctrl+R opens a search over your earlier prompts, and the inline search always covers every project, not just this one. Press Ctrl+R again for older matches.

  • Careful: Enter runs the match straight away.
  • Press Tab or Esc instead to put the match in the box so you can edit it first.
  • In fullscreen mode, Ctrl+S inside the search switches between this session, this project and all projects.

Pasting a screenshot on a Mac

Copy a screenshot to the clipboard and press Ctrl+V, even on a Mac. The docs list Cmd+V for iTerm2 only, and Alt+V on Windows and WSL. The image lands as an [Image #1] chip at the cursor, so you can write "compare Image #1 with Image #2". Dragging the file into the terminal works too.

Writing longer prompts

  • Ctrl+G opens the prompt in your own editor ($EDITOR). Ctrl+X Ctrl+E does the same, if your fingers know it from bash.
  • New line without sending: \ then Enter works in every terminal, and so does Ctrl+J. Shift+Enter works in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal.
  • Ctrl+W deletes back to the last space, so src/utils/foo.ts goes in one press. Option+Delete stops at each /. Ctrl+Y pastes back what you deleted.
  • Type / in the middle of a sentence and Tab completes the command name: run the tests, then /com + Tab.

While Claude is working

  • One Esc stops Claude mid-turn and keeps the work done so far. On a permission prompt, Esc means No.
  • Press Enter to queue a message instead of interrupting. Ctrl+Enter (or Ctrl+X Ctrl+S) sends the queue right now (v2.1.275 or later). ↑ pulls queued messages back into the box to edit.
  • Ctrl+B sends the running command to the background. In tmux, press it twice.
  • Ctrl+O opens the transcript: every tool call, with a timestamp and the model that wrote each message.
  • Ctrl+X Ctrl+K, pressed twice within 3 seconds, stops every background subagent.
  • Ctrl+T shows Claude's to-do list, not background tasks. For those, use /tasks.

Model, thinking and side questions

  • Option+P (Alt+P on Windows and Linux) switches model without clearing what you've typed.
  • Option+T turns thinking on or off. It does nothing on Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable, which always think. Option+O turns fast mode on or off.
  • /btw your question asks a side question that never goes into the conversation. In the answer, c copies it as Markdown and f turns it into a background subagent with full tools. Shift+← and Shift+→ (or [ and ]) step through your earlier side questions.

Gotchas

  • The # memory shortcut is gone (removed in v2.0.70). A # at the start of a line is just text now. Tell Claude to edit your CLAUDE.md, or use /memory.
  • The old & background prefix isn't in the docs any more, and its hint was removed as stale in v2.1.154. Use Ctrl+B, /bg or claude --bg.
  • Option/Alt shortcuts on a Mac (Alt+B, Alt+F, Alt+Y) need Option as Meta switched on in your terminal. Option+T works without it.
  • Ctrl+D quits if you press it twice within 800ms on an empty prompt.
  • Shift+Tab cycles permission modes. From a new session it's three presses to plan mode, so /plan is quicker.
Interactive modethe official docs: every keyboard shortcut, shell mode and the history searchCommon workflows@ file mentions, pasting images and the limits on bothRewind, explained by monkeywhat Esc Esc on an empty box opensBackground work, explained by monkeyCtrl+B and keeping long jobs out of your wayPlan mode, explained by monkeythe three Shift+Tab presses, or just /plan

Monkey believe in you. Now go build.

follow @nocodemonkey

More guides