Skip to content
zero2vibecodelearn vibe coding
Level 0 · What vibe coding is 6 min Reviewed by the author · Aug 4, 2026

What the agent actually does

A step-by-step look inside one request: what the agent reads, what it guesses, what it changes on your disk, and where you are supposed to interrupt.

Level 0 · 0 / 3 lessons0%

No hands-on task in this lesson — just read it through and answer the questions.

From the outside it looks like magic: you type a sentence, files appear, the thing runs.

From the inside it is five boring steps in a loop. Knowing them is what turns “it didn’t work” into “it failed at step one, and here is why”.

The five steps

Say you ask for this:

Add a dark mode toggle to the settings page.

Here is what happens.

1. It gathers context. The agent looks for what it needs to know: which files exist, what the settings page currently contains, how styling is done in this project. It opens a handful of files and reads them.

It does not read your whole project. Projects are too big, and the agent has a limited working memory — a . It reads what it thinks is relevant.

2. It forms a plan. Usually silently, sometimes out loud. Something like: add a toggle control to the settings page, store the choice, apply a CSS class to the root element.

3. It writes changes. It edits real files on your disk. Not a preview, not a suggestion — the actual files, unless your tool is set to ask first.

4. It runs something. Starts the app, runs the tests, executes a build. This is where reality gets a vote.

5. It reads the result and decides whether to loop. If the build failed, it reads the error and goes back to step three. If it looks fine, it stops and tells you what it did.

Quick check

Which of the five steps is the one where the agent's assumptions get tested against reality?

Step one is where most failures start

The agent knows three kinds of things:

  • What it read — the files it actually opened in this session.
  • What you told it — your request, plus any notes file in the project it picked up.
  • What it absorbed during training — general knowledge of languages, libraries and patterns, frozen at some point in the past.

That last category is the dangerous one, because it feels identical to the other two from the inside. The agent cannot tell you “I am remembering this rather than reading it”. It just answers.

So when it invents a function that does not exist in your project, it is not lying. It read three files, none of which contained your existing helper, and generated something reasonable for a project shaped like the one it saw.

Important

“The agent ignored my existing code” almost always means “the agent never opened that file”. The fix is not a stronger instruction — it is telling it where to look.

What it changes, and what you can stop

Two things happen in a session that touch the real world:

File edits. New files, modified files, occasionally deleted files. All reversible if you are using version control — a system that records snapshots of your project so you can go back. If you are not, they are reversible only by hand.

Commands. Installing packages, starting servers, moving files, calling out to the internet. Some of these are reversible. Some are not.

Most tools will show you a command before running it and wait for approval. That prompt is not a formality. It is the single cheapest place to catch an expensive mistake, and it takes two seconds to read.

Quick check

Your agent asks permission to run a command that deletes a folder. What is the right instinct?

Where you are supposed to interrupt

There are three natural interruption points, and using them is most of what separates a smooth session from a mess:

  • Before the plan is executed — “wait, that is not what I meant”.
  • Before a risky command runs — “no, do not install that”.
  • After the first run — “it works, but not the way I want”.

Interrupting is cheap. A wrong direction caught in the first thirty seconds costs one sentence. The same wrong direction caught after twenty files have been edited costs an afternoon.

Tip

If you feel the session drifting away from what you wanted, stop it and restate the goal in one sentence. Do not try to steer a wrong plan back on course with small corrections.

Try it yourself

One request, all five steps. Two of them are yours to interrupt.

The mental model to keep

Think of it as a fast, capable collaborator who has never seen your project, cannot ask your colleagues, remembers a lot of general knowledge that may be out of date, and will confidently fill any gap you leave.

That model predicts nearly everything you will experience. Gaps get filled by guesses. So the job is to leave fewer gaps — which is exactly what level 2 of this course is about.

Quick check

Which mental model of a coding agent is most useful in practice?

Check your understanding

Answered 0/2
Mode:

Why does an agent sometimes ignore an existing function in your project and write a duplicate?

What is the most important thing to check before an agent runs a command that changes your machine?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Lesson Q&A

Why does an agent sometimes ignore an existing function in your project and write a duplicate?

The agent works from what it has read. A file it never opened may as well not exist.

What is the most important thing to check before an agent runs a command that changes your machine?

Deleting, overwriting and installing are the operations you cannot undo by editing a file. Read those before approving.

Which of the five steps is the one where the agent's assumptions get tested against reality?

Until code actually runs, everything is plausible. Execution is the first honest feedback in the loop.

Your agent asks permission to run a command that deletes a folder. What is the right instinct?

Blanket approval and blanket denial are both lazy. Reading the specific command takes seconds and is the whole point of the prompt.

Which mental model of a coding agent is most useful in practice?

It predicts the real failures: missing context produces confident guesses rather than questions.

Related reading on the blog

Move between lessons with · search with ⌘K