Module 3 · Page 7 of 9

Terminal basics: Working with Claude Code

You have launched Claude Code inside VS Code. Now let's get comfortable talking to it. A few keyboard shortcuts will make writing longer prompts, fixing mistakes, and stopping an unwanted response much easier.

What you'll be able to do: Write and edit multiline prompts, navigate your prompt history, interrupt Claude, and recognize when you are talking to Claude versus entering a command for your computer.

You do not need to master the command line for this course. This page covers a few practical skills you'll use immediately.

1. Write and edit prompts

In a word processor such as Word, Enter starts a new paragraph. In Claude Code, as in most browser chat windows, the Enter key normally sends your prompt. To write a longer prompt with paragraphs, use a different shortcut.

I want to…What to press
Send my promptEnter
Start a new line without sendingCtrl + J (works in any terminal); or Shift + Enter when supported/configured
Move back or forward in a line← / →
Go to the start / end of the current lineCtrl + A / Ctrl + E
Delete the text back to the previous spaceCtrl + W
Delete from the cursor to the start of the lineCtrl + U
Delete from the cursor to the end of the lineCtrl + K
Restore text removed by those delete shortcutsCtrl + Y
Undo my last editing actionCtrl + _ (or Ctrl + Shift + -)
Bring back an earlier prompt↑ when the cursor is at the top of the input
TipIf Shift + Enter sends your prompt, try Ctrl + J instead. Claude Code also supports \ followed by Enter to insert a new line. Multiline shortcuts can vary across terminals.

Example: A prompt with paragraphs

Suppose you want to give Claude some background, a task, and a constraint. Write each part on its own line:

Claude Code · prompt input (illustrative) ↵ new lines
❯ I'm a business student working on a marketing project.

  Suggest three ways I could segment a customer dataset.

  Use plain language and give one example per segment.

Use Ctrl + J to start each new line. Press Enter only when your prompt is ready.

2. Control Claude Code

Sometimes you'll change your mind while Claude is working, want to revise an earlier request, or need to switch how Claude operates.

SituationWhat to do
Claude is responding and I want it to stopEsc interrupts the current response or tool call
I want to clear what I'm typingCtrl + C clears an idle input (and interrupts a running operation)
I want to revise a previous prompt↑ to recall it, edit, then Enter
I want to switch to Plan ModeShift + Tab cycles permission modes; stop when Plan is shown
I want to mention a fileType @ and select a suggested file
I want to see built-in commandsType / at the beginning of the prompt
I want to exit Claude CodeType /exit
ImportantStopping Claude does not undo work it already completed. If it edited a file before you pressed Esc, that edit may still be there. Check the files before continuing.

3. Know where you're typing

The terminal can show two different kinds of prompts. They are not interchangeable.

Before Claude Code starts: the computer's terminal

VS Code terminal · shell
student@laptop project % claude
# The command above launches Claude Code.

After Claude Code starts: the AI conversation

Claude Code · interactive session
❯ What files are in this folder?
# This is a request to the AI, not a shell command.

You may also see a permission request when Claude wants to run a command or change files. Read it before approving. The commands listed below belong in the regular terminal, outside a Claude Code chat (or in Claude Code's explicit shell mode).

4. A few useful terminal commands

You'll rarely need to memorize commands in this course, but it's useful to recognize these when you see them.

CommandWhat it does
pwdShows the current folder (Mac/Linux; also works in PowerShell)
ls (Mac) / dir (Windows)Lists the files in the current folder
cd foldernameMoves into a folder named foldername
cd ..Moves up one folder
clear (Mac) / cls (Windows)Clears the terminal display

Windows examples assume PowerShell, the common default terminal in VS Code. Some commands and shortcuts differ between shells.

5. Try it yourself

Activity · about 5 minutes

Practice editing a prompt

  1. Open the project folder you used on the previous page in VS Code. Launch Claude Code in its integrated terminal using claude.
  2. Type the prompt below, using Ctrl + J to insert blank lines. Do not submit it yet.
I am a business undergraduate learning to use Claude Code.

Explain three ways it could help me with a class project.

Keep the explanation under 150 words.
  1. Use Ctrl + A, Ctrl + E, and arrow keys to move around the text.
  2. Change “three ways” to “five ways” without retyping the entire prompt.
  3. Try Ctrl + W or Ctrl + K to delete text, then Ctrl + Y to restore it.
  4. Press Enter to submit. While Claude is answering, try Esc to interrupt it. (If it finishes too quickly, ask a longer follow-up first.)
  5. Use ↑ to recall a previous prompt. Revise it and submit again.

Checkpoint: You should be able to write a multiline prompt, edit it, and reuse an earlier prompt without starting from scratch.

6. Common questions

I accidentally pressed Enter. What now?

If Claude received your unfinished message, send a follow-up with the missing detail. You can also retrieve an earlier prompt using ↑, revise it, and resend.

Why does the up arrow sometimes move the cursor instead of recalling a prompt?

In a multiline prompt, the arrow first navigates your text. Move to the top row of the prompt and press ↑ again to browse earlier prompts.

Can I write a long prompt somewhere else and paste it?

Yes. You can draft in a text editor or in a Markdown file in VS Code, then copy and paste the text into Claude Code. This is often easier for long or carefully structured prompts.

How do I select or copy text with my mouse?

Text selection and copying in the VS Code terminal are controlled by VS Code and your operating system, rather than Claude Code's input shortcuts. If mouse selection is awkward, draft or edit longer instructions in a text file instead.

Claude seems stuck. What should I check?

Look to see whether it is still working, asking for permission, or waiting for your next input. If you want to stop a response or tool call, use Esc. If the screen looks garbled, Ctrl + L can redraw it.

TipKeep this handy: The four shortcuts worth remembering first are Ctrl + J (new line), Ctrl + W (delete backward), ↑ (previous prompt), and Esc (stop Claude).

Shortcuts checked against Claude Code's interactive-mode documentation. Key combinations can vary by terminal, operating system, and Claude Code version.

Next · Page 8 of 9
Use case: Segmentation from a CSV
→