Skip to the content.

Lesson 1: What Vibe Coding Really Is

Course home Next: Lesson 2: Set up your tools

Time: about 30 minutes. No installs yet.

Goals

By the end of this lesson you will be able to:

Concepts

From autocomplete to agents

AI help for programmers has arrived in three waves:

  1. Autocomplete. The editor suggests the rest of the line or the next few lines as you type. Useful, but you still drive every keystroke.
  2. Chat. You paste code into a chat window and ask questions. The AI answers, you copy the answer back. Helpful, but slow and error-prone because the AI cannot see your whole project.
  3. Agents. The AI works directly in your project folder. It can open files, search, edit, run commands such as tests, look at the results and try again. You give it a goal; it takes many small steps to reach it, asking your permission along the way.

This course is about the third wave. Tools like Claude Code, OpenAI Codex, GitHub Copilot’s agent mode and Google Antigravity are all agents.

How an agent works

Under the hood, an agent is a large language model (LLM) running in a loop with some tools:

          +-------------------------------+
          |  Your goal + project context  |
          +---------------+---------------+
                          |
                          v
   +-----------> 1. Think: what should I do next?
   |                      |
   |                      v
   |             2. Act: read a file / edit a file / run a command
   |                      |        (asks you first for risky actions)
   |                      v
   |             3. Observe: what happened? did the test pass?
   |                      |
   +------ not done ------+------ done ------> 4. Report back to you

Key points:

Where agents shine

Where agents stumble

Two styles of vibe coding

The phrase “vibe coding” was coined by Andrej Karpathy in February 2025 for a style where you accept whatever the AI produces and barely look at the code. That style is fun for weekend toys. Most people now use the phrase for any AI-first way of building.

  Pure vibe coding AI-assisted engineering (this course)
Who reads the code Nobody, really You, at least skimming every diff
Testing “It seems to work” Automated tests plus manual checks
Size of each step Whatever the AI does Small, reviewable steps
Version control Optional Commit after every working step
Good for Throwaway experiments Anything people will use or rely on

You will still move fast. The extra habits cost minutes and save hours.

Your role changes, it does not disappear

When an agent writes the code, you become:

The rest of the course trains each of these roles.

Walkthrough

No installs today. You can do this in any AI chat interface you already have, or just read along.

Step 1: See the difference between vague and clear

Imagine giving each of these to an agent:

Make a habit tracker.
Build a habit tracker web page using only HTML, CSS and plain JavaScript,
no frameworks. A user can type a habit name and add it to a list, then tick
it off for today. Keep it to three files: index.html, styles.css, app.js.
Before writing code, list the files and what goes in each.

Write down three things the second prompt tells the agent that the first does not. (Suggested answer at the bottom of this lesson.)

Step 2: Read the plan for the app you will build

Over the next lessons you will build Tiny Habits:

Lesson What gets added
3 HTML page: title, form, empty list
5 Styling, mobile layout, dark mode, accessibility
6 Adding, ticking and deleting habits; streaks
7 Saving to localStorage
8 Git history and reviewed changes
9 Automated tests
10 Bugs found and fixed
11 Security hardening
12 Live on the web

Step 3: Spot the hallucination

Here is a made-up agent reply. Read it and find the problem.

To save the habits, call localStorage.saveArray("habits", habits). It stores the array directly, so you don’t need JSON.

The browser’s localStorage has setItem, getItem, removeItem, clear and key. There is no saveArray, and localStorage only stores strings, so you do need JSON.stringify and JSON.parse. You can check this on MDN’s localStorage page. This is exactly the kind of fluent, plausible, wrong answer you will learn to catch.

Step 4: Decide your ground rules

Write these on a sticky note or in a text file. You will turn them into an AGENTS.md file in Lesson 4.

  1. Plan before code.
  2. One small step at a time.
  3. I read every diff.
  4. I run it myself before I believe it works.
  5. I commit when it works.
  6. I read every command before I approve it.

What good output looks like

There is no code yet, so “good output” today is good understanding. You are on track if you can:

Checklist

Mini-quiz

  1. What makes an AI coding agent different from a chat assistant?
  2. Why might an agent describe a function in your project incorrectly?
  3. Name two signs that a request is too big for one step.
  4. True or false: if the agent writes the code, you do not need to understand any of it.
  5. What does localStorage store: any JavaScript value, or only strings?
Answers 1. An agent can take actions in your project (read and edit files, run commands) in a loop, checking results, instead of only replying with text. 2. Because it has not read that file in the current session (it is not in its context), or because it is predicting plausible-looking text and hallucinated. 3. Any two of: you cannot describe how you would check it in a sentence; it touches many files or features at once; you could not review the result in a few minutes; it contains "and" several times ("add accounts and sync and charts"). 4. False. You need to understand it well enough to review it, test it and keep it safe. 5. Only strings. Objects and arrays must be converted with `JSON.stringify` and read back with `JSON.parse`.

Assignment

Pick a small app idea of your own (not the habit tracker). Write:

  1. One sentence describing who it is for and what it does.
  2. A vague prompt for it, like “make a recipe app”.
  3. A clear prompt for it with: the tech (HTML, CSS, JS), the files, the one main feature, and a request for a plan first.
  4. Three smaller steps you would build it in.

Keep it. You will use it again in Lesson 12 when you plan your next project.

Suggested answer to Step 1 The clear prompt specifies: the technology (HTML, CSS, plain JS, no frameworks); the features (add a habit, tick it for today); the file layout (three named files); and the process (plan before code).

Next: Lesson 2: Set up your tools