Free mini-course · Lesson 0 of 4

0 What programming is, and the command line

What a program is, what code looks like, and the handful of terminal commands you need before you install Claude Code.

⏱ 15 min

Start here if you’ve never programmed

This lesson is for people starting from absolute zero. In 15 minutes you’ll know what a program is, what code looks like, and how to move around your computer in the terminal, the window where Claude Code lives. If you already know all this, skip ahead to the next lesson.

A program is a list of instructions

A program is a list of instructions that the computer follows in order, one at a time, exactly as written. Think of a recipe written for a robot: it doesn’t guess what you meant and it doesn’t skip steps. It does what’s written.

Each line below is an instruction: “show this text”. The results show up in the console, below the code, and they update as you type.

Try it

Instructions, in order

Console
Nothing in the console yet. Use console.log(...) to show values here.

Challenges:

  1. Swap the first and last lines. The computer follows the new order without complaining, even though it makes no sense.
  2. Add a fourth line, console.log('Drink it');, copying the shape of the others.

The computer takes you literally

Now break something on purpose: in one of the lines, change console to consol. An error shows up in red.

An error isn’t a disaster, and it doesn’t break your computer. It’s the program telling you “I didn’t understand this line”. Reading the error, or copying it to the AI, is the first step to fixing it. Programmers see errors all day long.

Code is text, saved in files

Code is just text, saved in files. The end of the file name (the extension) says what kind of code it holds. A website is usually made of three kinds:

File What it does Like in a house
index.html What’s on the page: headings, text, buttons The walls and rooms
style.css How it looks: colors, sizes, fonts The paint and furniture
script.js What happens: clicks, calculations, changes The electricity

A project is a folder with all its files inside. When you ask Claude Code to build an app, it creates and edits files inside the folder you’re in.

Files live in folders, and folders have paths

Your computer organizes everything in folders inside folders. The path is the address of a file: each / goes one folder deeper.

/Users/ana/Documents/my-first-app/index.html

Read it from left to right: in the user folder ana, inside Documents, inside my-first-app, there’s the file index.html. The ~ sign is a shortcut for your home folder, so the same path can be written as ~/Documents/my-first-app/index.html.

The terminal: talking to the computer in writing

The terminal (also called the command line) is a window where you type commands instead of clicking. It shows the same files and folders you see in Finder or File Explorer, only in text.

To open it:

  • On a Mac: press Cmd + Space, type Terminal, and press Enter.
  • On Windows: open the Start menu, type PowerShell, and press Enter.

When it opens, you’ll see a line like this, called the prompt:

ana@mac ~ %

It says who you are (ana), on which computer, and which folder you’re in (~, your home folder). You type after the % (on Windows, after the >) and press Enter. The answer shows up below, and the prompt comes back when the command is done.

Four commands are enough to start

Command What it does
pwd Shows which folder you’re in (“print working directory”)
ls Lists what’s in the folder
cd name Moves into a folder. cd .. goes back up one
mkdir name Creates a new folder

Practice them in this pretend terminal. Nothing you type here touches your computer, so mistakes are free. Follow the missions:

Practice terminal

Practice freely: nothing here touches your computer

Type a command and press Enter. Type help to see the list.
you@mac ~ %
Missions
  1. 1Find out which folder you are in: pwd
  2. 2See what's in it: ls
  3. 3Go into Documents: cd Documents
  4. 4Create a folder for your first app: mkdir my-first-app
  5. 5Go into it: cd my-first-app
  6. 6Check where you are now: pwd
  7. 7Go back up one folder: cd ..

This is exactly what you’ll do when you install Claude Code: create a folder for the project, go into it, and start Claude Code there.

Three tricks that save time

  • Tab completes names. Type cd Doc and press Tab: the terminal fills in Documents for you.
  • The up arrow brings back the last command, so you don’t have to type it again.
  • Ctrl + C stops a command that’s still running. If the terminal seems stuck, that’s the way out.
Task

Practice

0 of 4 done

Checkpoint

Check what you learned

  1. What does the computer do with the instructions in a program?

  2. An error shows up in red when you run some code. What does it mean?

  3. Which command shows which folder you are in?

  4. You are in ~/Documents/my-first-app. What does cd .. do?

Finished the lesson?

Mark it complete to track your progress.