Vibe coding with Claude Code course Β· Module 1: Claude Code and Cursor

Terminal: read the commands Claude runs

8 min read Β·
In this lesson14

Welcome back! In the previous lesson Claude Code wrote files. But the crew doesn't only write: it also runs commands in the terminal, and in Manual mode it asks your permission before many of them. Today you will learn to read those commands.

The problem: "Yes" without understanding is a coin toss

Imagine Claude asks whether it may run mkdir maps or npm install. If you don't know what the command does, your "Yes" is a guess. You don't have to write commands like an experienced programmer, but you must understand the ones you sign. The terminal is a text window to your computer: instead of clicking icons, you type commands and read the answers. In Cursor you open it with Control+` on a Mac or Ctrl+` on Windows and Linux. This is where the claude session runs and where the permission requests appear.

Where you are: pwd

The terminal always stands in some folder, which we call the working directory. The pwd command (print working directory) prints its full path:

pwd

The terminal will answer for example /Users/ann/Documents/pirate_ship. This matters, because claude started in the terminal works in exactly this folder: you see the same path above the session's request field. The command itself changes nothing, it only shows.

What is here: ls

The ls command lists the contents of the current folder. In PowerShell on Windows you can also type dir:

ls

In the pirate_ship folder you will see pirate.html from the previous lesson. ls only reads: it doesn't create, move or delete anything.

Moving around: cd

The cd command (change directory) takes you to another folder, and cd .. goes up one folder:

cd pirate_ship
cd ..

The first line enters the pirate_ship folder, the second goes back to the folder you were in. Only the place where the terminal stands changes: the files stay untouched.

Creating: mkdir and touch

The mkdir command (make directory) creates a new folder, and touch creates an empty file on macOS and Linux (in PowerShell you type New-Item instead):

mkdir maps
touch journal.html

After these two lines the current folder gains a maps folder and an empty file journal.html. These are the first commands in this lesson that really change something on disk, which is why Claude will ask about them in Manual mode.

Shortcuts that save time

Shortcut or commandWhat it does
up arrowrecalls the previous command from history
Tabcompletes a file or folder name
Ctrl+Cinterrupts a running command
clearclears the terminal screen

Tab works like this: you type the beginning of a name, press Tab, and the terminal fills in the rest. The [Tab] notation below means pressing the key:

cd pir[Tab]

The terminal will turn this into cd pirate_ship if the folder has only one name starting with "pir". Less typing means fewer typos.

Two commands in one line: &&

The && sign joins two commands: the second runs only if the first succeeds. This is how you enter the project folder and start Claude Code in it right away:

cd pirate_ship && claude

If the folder doesn't exist, cd reports an error and claude doesn't start at all, so you won't begin a session in the wrong place. You will also meet this notation in Claude's permission requests and in the CMD installation command from lesson 0_2.

Which commands Claude runs without asking

Claude Code knows a set of read-only commands, among them ls, pwd, cd and the reading forms of git, such as git status, and it runs them without asking in every mode, because they change nothing. For commands that change something, such as mkdir, it asks in Manual mode. Check it yourself:

Request for Claude Code:

Show me which folder I am in and what is in it. Then create a folder
maps here. Before you run a command, say in one sentence what it will do.

Claude will check the folder without asking, and at mkdir maps it will stop with a permission request. The request has the title Bash command, the command and a short description below it, and under that the question "Do you want to proceed?" with options. Yes agrees once. The option "Yes, and don't ask again for..." saves permission for similar commands in this project permanently, so choose it only for commands you understand well. No or Esc refuses. If you hover over Yes or No and press Tab, you add a comment, for example "No, create this folder in the assets subfolder".

Captain's review before "Yes"

Before you agree, answer three questions for yourself:

  1. Where will it run? Check the working directory and the paths in the command.
  2. What will it change? Files in the project, installed packages, something outside the project, or maybe something on the internet?
  3. Can it be undone? /rewind restores files changed with Claude's file editing tools, but it doesn't track a file changed only by a terminal command.

At these commands stop, refuse or ask: rm -rf deletes files and folders with no trash and no questions, sudo runs a command with administrator rights, curl with the address of an unknown server joined by | to bash downloads someone else's script and runs it immediately, and git push --force overwrites history on the server. You ran the Claude Code installation with a similar command, but yourself, from the maker's address. Auto mode blocks some such actions on its own, for example downloading and running code or a force push, but in Manual mode the decision is yours.

Your hand on the helm: the exclamation mark in a session

Sometimes you want to run a command yourself without leaving the session. Type ! and the command in the request field:

! ls

The command runs right away, without Claude and without a permission request, and its output goes into the conversation, so Claude can comment on it. You leave exclamation mark mode with Esc or with Backspace on an empty field.

Node.js and npm in a nutshell

Node.js runs JavaScript outside the browser, and npm is a package manager that installs libraries and tools. Claude Code installed natively does not need Node.js, but projects in later locations do. You check the versions like this:

node --version
npm --version

Each command prints a version number. The current long-term support (LTS) line of Node.js is 26, as of November 2026. If you see command not found, Node.js is not installed yet, and for now you don't need it.

You will see these three npm commands most often in Claude's permission requests, when in location 2 it sets up a Next.js project:

npm install
npm run dev
npm run build

npm install installs the packages the project needs, npm run dev starts the app in development mode, and npm run build builds the production version. None of them sends your code out into the world, but npm install downloads packages from the internet, so check that Claude installs what you asked for.

Git in a nutshell

Git is a version control system, that is, the ship's logbook for code: it records the history of changes so you can return to a working version. The four basic commands look like this:

git status
git add .
git commit -m "I added a pirate page"
git push

git status shows what changed, git add . marks all changes for saving, git commit -m saves the state with a description, and git push sends the saved changes to a server, for example GitHub. You will get to know Git better in a separate lesson, and Claude will drive it for you through conversation.

When something goes wrong

  • command not found: a typo or the tool is not installed. The terminal reacts the same way to claude when the install directory has not reached the PATH yet.
  • permission denied: no permission. Don't add sudo blindly: ask Claude where the error comes from and read the answer.
  • the terminal "froze": the command is still running. Ctrl+C will interrupt it.

Exercise

Run these commands in order in Cursor's terminal, outside the claude session. On Windows in PowerShell use New-Item instead of touch:

pwd
mkdir my_adventures
cd my_adventures
touch journal.html
ls
cd ..
clear

After ls you should see journal.html, and after cd .. you stand in the starting folder again. At the end type cd my_adventures && claude and ask "What is in this folder?". Notice that Claude looks into the folder without asking for permission, because reading alone changes nothing.

Remember: a captain doesn't have to row, but must know what every order they sign means.

Code for this lesson: index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Pirate Terminal</title>
    <style>
        body {
            background-color: #000;
            color: #0f0;
            font-family: 'Courier New', monospace;
            padding: 20px;
        }
        .terminal {
            background-color: #1a1a1a;
            border: 2px solid #0f0;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
        }
        .command {
            color: #00ff00;
            margin: 10px 0;
        }
        .output {
            color: #ffffff;
            margin-left: 20px;
        }
        .question {
            color: #facc15;
            margin: 10px 0;
        }
    </style>
</head>
<body>
    <h1>Captain Redbeard's Terminal</h1>

    <div class="terminal">
        <div class="command">$ pwd</div>
        <div class="output">/home/captain/pirate_ship</div>

        <div class="command">$ ls</div>
        <div class="output">pirate.html</div>

        <div class="command">$ mkdir maps</div>

        <div class="command">$ ls</div>
        <div class="output">maps  pirate.html</div>
    </div>

    <h2>Claude Code permission request (simplified look)</h2>

    <div class="terminal">
        <div class="question">Bash command</div>
        <div class="output">mkdir maps</div>
        <div class="output">Creates a maps folder for treasure maps</div>
        <div class="question">Do you want to proceed?</div>
        <div class="output">1. Yes</div>
        <div class="output">2. No</div>
    </div>

    <p>Before you pick Yes: where will it run, what will it change, and can it be undone?</p>
</body>
</html>

Spotted a mistake in this lesson?

Check yourself

Answer the questions from this lesson. Pick an answer to see right away whether it is correct.

  1. 1. What does the pwd command do in the terminal?

  2. 2. What does the ls command do in the terminal?

  3. 3. Which command creates a new folder?

  4. 4. What does the cd .. command do in the terminal?

  5. 5. Which command creates a new file on Mac/Linux?

  6. 6. What is the Tab key used for in the terminal?

  7. 7. What does the up arrow (↑) do in the terminal?

  8. 8. What does the clear command do in the terminal?

  9. 9. What is npm?

  10. 10. Which command installs the project packages?

  11. 11. Which shortcut interrupts a running command in the terminal?

  12. 12. What does the 'command not found' error mean in the terminal?

  13. 13. Which command builds the project to the production version?

Hands-on tasks in the game

  • Code editor

    Run the terminal commands and type them in the commands.sh file

  • Vertical ordering

    Arrange the commands for creating a project in the terminal (one under another):

  • Horizontal ordering

    Assemble the command that, after typing the prefix, you complete with the Tab key:

  • Click in order

    Click the elements in order to build the command that checks the Node.js version:

  • Horizontal ordering

    Assemble a command that enters the project folder and immediately starts Claude Code in it (in one line):

  • Click in order

    Click the elements in order to build the command that runs the project in development mode:

  • Click in order

    Click the elements in order to build the command that builds the project to the production version:

  • Vertical ordering

    Arrange the steps from the permission request to the decision:

  • Click in order

    Click the elements in order to build the command that resumes the latest conversation with Claude Code in the current folder:

  • Horizontal ordering

    Assemble the command that checks the npm version (on one line):

  • Click in order

    Click the elements in order to build the command that checks whether Claude Code is installed:

  • Vertical ordering

    Arrange the stages of working on a project from start to finish:

  1. QuestionQuiz: The pwd command
  2. QuestionQuiz: The ls command
  3. Coding taskPractice: Terminal commands
  4. QuestionQuiz: The mkdir command
  5. QuestionQuiz: The cd .. command
  6. Put in orderSorting: Creating a project in the terminal
  7. QuestionQuiz: The touch command
  8. Put in orderSorting: The Tab key in the terminal
  9. QuestionQuiz: The Tab key
  10. Click in orderClick in order: Node.js version
  11. QuestionQuiz: The up arrow
  12. Put in orderConnecting: Starting in the project folder
  13. QuestionQuiz: The clear command
  14. QuestionQuiz: What is npm
  15. Click in orderClick in order: running the project
  16. QuestionQuiz: Installing packages
  17. QuestionQuiz: Interrupting a command
  18. QuestionQuiz: The command not found error
  19. Click in orderClick in order: building the project
  20. Put in orderSorting: Permission for a command
  21. Click in orderClick in order: returning to a conversation
  22. Put in orderAssemble: Checking the npm version
  23. QuestionQuiz: Building the project
  24. Click in orderClick in order: checking the installation
  25. Put in orderSorting: The whole workflow

Useful articles