The Complete Claude Guide
← Back to topic
Chapter 06 · CLI

Interactive mode: shortcuts, multiline, Vim and shell mode

Interactive mode offers a rich editing layer: keyboard shortcuts, multiline input, Vim mode, shell mode and a task queue. Mastering them makes daily work much faster.

Verified against source on 2026-09-30

Video

Know whether you are writing a prompt or a command

You will learn a few controls that prevent accidental execution. Examples are illustrations.

Interactive input is not always natural language. Slash commands control Claude Code; ! enters shell mode. Shell text can run directly, so pasted content needs inspection before Enter.

Enter a short multi-line request

Use the newline shortcut supported by your terminal. Current documentation lists options such as Shift+Enter in supported terminals and other terminal-dependent combinations; inspect help and terminal configuration rather than assuming one shortcut everywhere.

Inspect index.html only.
Explain the three course units and unset date.
Do not edit, execute scripts or access the network.

Before sending, check that all lines remain one request and that no accidental ! prefix changes the mode. Success is a request matching your intended limits.

Interrupt and inspect

If work departs from the brief, interrupt using the documented control such as Esc, then state the correction. Ctrl+C also has cancellation/exit behavior depending on state; read the live interface instead of assuming every key is harmless.

Stop that installation. This is read-only explanation of one file.
Report what was actually done, then continue only with the original reading task.

Inspect file state if any command may have run. Interruption does not automatically undo effects.

Recall input without executing it

Up/Down or reverse search can retrieve earlier input. The current guide describes Ctrl+R search with interface-dependent behavior. Place a found prompt into the input, edit it and inspect before sending. History can contain shell commands; recalling one is not approving it.

Expected behavior: the earlier text appears for editing, not proof that the previous task reran. If your renderer behaves differently, use its visible controls.

Shell mode is a separate action

A harmless inspection example inside Claude Code:

! pwd

This runs a shell command rather than asking Claude what directory you are in. The guide says pasted text beginning with ! can enter shell mode automatically. Never paste unknown setup, deletion or deployment commands to “see what happens”.

Command output can be added to the conversation and trigger a model response under current settings. Shell execution and model response can have separate consequences; do not assume manual shell input has no usage effect.

Optional Vim mode

Vim mode is optional. Use /vim only if its modal editing fits your habits. NORMAL and INSERT states change what keys do; begin with a harmless unsent prompt and learn how to return to INSERT before writing work instructions.

Do not enable many unfamiliar shortcuts at once. Three reliable controls are better than memorizing a full table you cannot use safely.

Graded practice

Easy: multi-line input

Enter the bounded brief. Success: one intended request, no shell-mode prefix.

Intermediate: recall and edit

Find earlier input and change the filename before sending. Success: no accidental rerun of old text.

Challenging: distinguish modes

Explain a prompt, /context and ! pwd. Success: understand language request, product command and shell execution separately.

Troubleshooting

Enter sends too early: use your terminal's supported newline route.

Paste enters shell mode: inspect prefixes and cancel before execution.

Vim keys type unexpectedly: inspect current editor mode.

Interrupted command already changed files: inspect actual state; do not claim interruption restored it.

Shortcut differs: current help and terminal configuration govern mechanics.

Filmed demo · Video is added in the media phase

Recap

Comprehension check

What does shell mode do in interactive mode?

Recap

Sources and further reading

← Previous Back to topic Next →