Keys
Keys can differ by platform and terminal, and can be rebound. The full list is in the interactive mode page and, for rebinding, keybindings.
| Key | Action | Note |
|---|---|---|
Esc | Interrupt the current response or tool call. Work done so far is kept. | On a permission prompt, Esc declines the action. |
Ctrl+C | Interrupt a running operation. | On an idle prompt: first press clears the input, second exits. |
Esc Esc | With text in the prompt: clear the draft (Up recalls it). With an empty prompt: open the rewind menu. | |
Shift+Tab | Cycle permission modes. | Order: default (shown as Manual), acceptEdits, plan, then bypassPermissions and auto when available. On Windows, Alt+M when the runtime does not enable VT input mode. |
/clear | Clear the context by starting a new conversation. | Do this between unrelated tasks. Aliases /reset, /new. |
Ctrl+D | Exit the session. | Press twice. |
Ctrl+R | Reverse-search the command history. | |
Ctrl+O | Toggle the transcript viewer with detailed tool usage. | |
Ctrl+G | Open the prompt in your default text editor. | |
Ctrl+B | Run the current Bash command or agent in the background. | |
Ctrl+S | Stash the current prompt; press again on an empty prompt to restore it. | |
Alt+P / Option+P | Switch model without clearing the prompt. | |
! | At the start of the prompt: run a shell command and add its output to the session. | |
@ | Mention a file path, with autocomplete. |
The permission-mode indicator is shown while you cycle. Confirm the mode before approving anything; see permission modes by kind of work.
Multi-line input
| Method | Works |
|---|---|
\ then Enter | In all terminals. |
Ctrl+J | In any terminal, without configuration. |
Shift+Enter | Natively in several terminals (iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal); others need setup, see terminal configuration. |
| Paste | Pasting a block, such as a log, works directly. |
Habit: name the file instead of describing it
A description such as “the config loader” leaves the tool to guess which file, and it may pick a plausible wrong one. A path leaves nothing to guess, costs less context, and shows up in the transcript for review. Use @ to complete the path.
| Roundabout | Direct |
|---|---|
| Fix the bug where the date parser fails on empty input. | In @src/parse/date.ts, parseDate("") throws. Make it return null. Do not edit anything under tests/. |
| Update the build config to include the new folder. | Add src/plugins/ to the include list in @tsconfig.json. Change nothing else in that file. |
State what must not change in the same sentence. That is the part a description cannot imply.
Habit: verify with real commands, not the report
A tool’s statement that tests pass, or that a file was changed, is a claim. Run the command yourself, in a terminal you control or with the ! prefix, and read its output.
git status --short # what actually changed
git diff --stat # how much, in which files
git log --oneline -5 # commits made during the session
<your test command> # run it yourself and read the exit code
echo $? # 0 means success (POSIX shells)- Check the exit code, not only the summary line.
- Read the diff for files you did not expect to be touched.
- Re-run after the last edit. A run from before the final change proves nothing about it.
Habit: know which shell ran it
The shell the tool runs commands in may not be the one you are looking at. On macOS and Linux the tool loads your shell start-up file (~/.zshrc, ~/.bashrc or ~/.profile) to pick up aliases and functions. On Windows the Bash tool is available only when Git Bash is installed, and a PowerShell tool is used when it is not. Syntax that works in one ($VAR, &&, /dev/null) can fail in the other. Details: tools reference.
echo "$0" # POSIX shells: name of the running shell
$PSVersionTable.PSVersion # PowerShell only: version
pwd # directory the command ran inUnofficial notes, not affiliated with or endorsed by Anthropic. Command names, flags and behaviour change between versions; the official documentation and the tool's own help output are authoritative.