Skip to content

How to vibe code

By Mari Luukkainen · 12 min read · Last updated

On this page

To vibe code, describe a small app to an AI coding tool, run what it builds, tell it what is wrong in plain words and repeat in short rounds until it works. Then save the project in Git and publish it. A first project takes one afternoon.

This guide builds one example app from the first prompt to a live URL: a recipe scaler that multiplies ingredient amounts for a chosen number of servings. The prompts are written so you can paste them. The test list and the errors are the ones to expect in the first week. After the first app it covers a second project with a database and login.

If you want the definition first, read what vibe coding is. To pick a tool before you start, read the list of tools.

Ask AI about this pageChatGPTClaudePerplexityGoogle AI ModeGrok

What do you need before you start?

Three things: an AI coding tool, a folder on your computer or a project in a browser builder, and one small idea.

  • A tool. Cursor, Claude Code and Codex work on a folder on your computer. Lovable, Bolt.new and Replit work in the browser and need no install. The tool guide lists the free tiers and prices.
  • A free GitHub account. You save the project there, and most hosts publish straight from it.
  • Node.js, if your tool works on your computer and builds a Next.js app. Node.js runs the app you are building. It is not needed to install Claude Code with its native installer. Ask the tool: "Is Node.js installed on this machine? If not, tell me how to install it for my operating system."
  • One idea that fits in two sentences. If it needs more, it is two projects.

I started in March 2025 and did it badly. I was asking ChatGPT "What's md for Mac?" and breaking things with typos. It began to work when I planned in ChatGPT first, split the work into pieces and only then touched code (post). Planning first is step 1 below.

Step 1: write the idea down before you prompt

The first prompt sets the shape of the whole project, so write it in a text file first. Answer four questions: who uses it, what they do on each screen, what happens when they press the main button, and what is out of scope.

For the recipe scaler: a home cook uses it; one screen with a list of ingredients and a servings field; changing servings rescales every amount; no accounts, no database, no sharing.

Say what is out of scope. An AI tool fills every gap with a guess, and the usual guesses are a login system and a database you do not need.

The ultimate guide to vibe coding · Grow with Google (Google)

Step 2: the first prompt

Open your tool in an empty folder and paste a prompt that contains the four answers. Name the technology if you have a preference. If you have none, ask the tool which stack it will use and why before it builds. Browser builders pick their own stack, and I have not checked which one each uses by default.

first prompt
Create a web app called Recipe Scaler.

Who uses it: a home cook who wants to cook for a different number of people than the recipe says.

What it does: one page. The user enters a recipe title, the number of servings the recipe was written for, and a list of ingredients (name, amount, unit). A second field sets the servings they want. When they change it, every amount updates immediately. Amounts display as simple decimals, rounded to two places.

Out of scope: accounts, a database, sharing, images. Save the current recipe in the browser so it is still there after a refresh.

Use Next.js with TypeScript and Tailwind CSS. Make it work on a phone screen first. Plain, readable design, no gradients.

Before you write code, tell me the file structure you plan to create and wait for my OK.

Asking for the plan first takes ten seconds and shows whether the AI understood. If the plan lists a database or a login page, correct it now. My prompts changed shape after I read Anthropic's guidance for newer models: they read like a brief with the outcome, who it is for and what done means, and I let the model propose the plan before it builds (post on goals instead of task lists).

Reply "OK, go ahead" when the plan is right. The tool creates the files, installs the packages and usually starts the app.

Step 3: run it and test like a user

If the tool did not start the app, ask: "Start the dev server and tell me the URL." It runs npm run dev and reports an address, normally http://localhost:3000. Open it in your browser and test the cases a real person would try:

  • Enter an ingredient with an amount of 0.5 and double the servings. Expect 1.
  • Enter an amount with a comma, as in 1,5. Many people type it that way.
  • Leave the servings field empty. Nothing should show NaN or Infinity.
  • Add 15 ingredients. The page should still scroll and the buttons stay reachable in a 375 pixel wide window.
  • Refresh the page. The recipe should still be there.

Write each failure as one sentence. Each becomes a prompt.

Ultimate Vibe Coding Guide for Beginners · Tech With Tim

Step 4: fix in small rounds

One request per round. A prompt with five changes returns a result where you cannot tell which change broke what.

fix prompt
Bug: when I type 1,5 as an amount (with a comma), the scaled amount shows NaN.

Expected: treat the comma as a decimal point, so 1,5 is 1.5.

Only change the amount parsing. Do not restyle anything. Tell me which file you changed.

A fix prompt has three parts: what you did, what you saw, what you expected. Add "only change X" so the tool does not rewrite things you did not ask about.

feature prompt
Add a "Copy as text" button under the ingredient list. It copies the scaled recipe to the clipboard as plain text, one ingredient per line, like "300 g flour". After copying, the button label changes to "Copied" for two seconds.

Do not change anything else on the page.

After each round, run the app and repeat the test list. When a round goes wrong, do not argue with the tool for ten messages. Return to the last commit (step 6) and write the prompt again with the failure included.

Step 5: ask the AI to explain what it built

You do not need to read every line. You need to know what the parts are, because that lets you write precise prompts.

explain prompt
Explain this project to me as if I have never programmed. List each file, what it does in one sentence, and which file I would open to change (a) the page title, (b) the colours, (c) the rounding of amounts.

Keep the answer. "Change the rounding in lib/scale.ts" gets a better result than "fix the numbers".

Step 6: save your work with Git before it matters

Git records snapshots of your project. When a prompt breaks something, you can return to the last snapshot instead of repairing the damage by hand. Most tools can run the commands for you.

git prompt
Initialise a Git repository in this folder, add a .gitignore suitable for a Next.js project, and make a first commit with the message "First working version". Then show me how to see the list of commits.

Commit after every round that works. To drop a failed experiment, ask the tool to show what Git would discard first, then to return to the last commit. Read that answer before you accept it. Discarding changes deletes work, and files the tool created since the last commit are not restored by a plain restore; a stash that includes untracked files (git stash -u) keeps them.

Then create an empty repository on GitHub and ask the tool to connect your folder to it and push. It gives you the exact commands.

Step 7: publish it with environment variables

A static app like the recipe scaler needs no server of your own. My one-afternoon marketing site guide uses Vercel: push the code to GitHub, import the repository, deploy, and every later push publishes again (post). The same flow works on other hosts.

  1. Create an account at the host and connect your GitHub account.
  2. Choose "import project" and pick the repository.
  3. Keep the detected settings (the host recognises Next.js).
  4. Before you press deploy, open the environment variables section. If the app reads any secret (a database URL, an API key), add it here by name and value. The names must match what the code reads. Never put the value in the code or in Git.
  5. Deploy. Open the URL on your phone and run your test list again.
  6. Add a custom domain only after the app is worth one.

Variables whose names start with NEXT_PUBLIC_ in a Next.js app are copied into the code that runs in the visitor's browser, so a secret never goes in one of those. If you change a variable after the first deploy, the host usually needs a new deploy before the app sees it.

Second project: accounts and a database

The recipe scaler stores nothing on a server, which is why it is a safe first app. The next step is a project where each user sees only their own data, such as a reading list with a login. This is where the security problems in is vibe coding bad start to apply.

I started on Supabase and Vercel like most people do, and later moved everything to my own servers (first-year post). For a second project, Supabase is a reasonable first database because the login service and the database come together. Its Row Level Security (RLS) rules decide which rows each user can read or write. If RLS is off on a table, anyone with the public key can read it. CVE-2025-48757 was assigned to an insufficient RLS policy in Lovable-generated sites (NVD).

second project prompt
Build a reading list app. Users sign up and log in with email. Each user sees, adds and deletes only their own books (title, author, status: want to read, reading, finished).

Use Supabase for login and the database. Turn on Row Level Security on every table and write policies so a user can only select, insert, update and delete rows where user_id equals their own id. Tell me each policy you created.

Keep the Supabase keys in environment variables. Only the public anon key may be used in browser code.

After building, give me a test plan: how to prove that user A cannot see user B's books.

Then run the test plan yourself with two test accounts. Do not skip it, and do not use real people's data.

When it breaks: errors a beginner hits and what to type next

For every message below, copy the full text from the terminal or browser, paste it into the tool, and add what you were doing when it appeared.

ReferenceError: localStorage is not defined

The code reads the browser's storage while the server is still rendering the page, and the server has no browser. Type:

fix prompt
I get "ReferenceError: localStorage is not defined" when I load the page. The recipe is saved with localStorage. Read the browser storage only after the component has mounted on the client, and keep the page rendering without errors on the server.

Hydration failed because the server rendered HTML didn't match the client

The page the server produced differs from what the browser produced on its first render. A common cause is showing saved data immediately instead of after mounting. Paste the full error and add: "This happens after I added saving to localStorage."

Module not found: Can't resolve '@/components/IngredientRow'

The code imports a file that does not exist at that path, often because the AI renamed or moved it in an earlier round. Type: "List every file in components/ and fix the import that fails."

Error: listen EADDRINUSE: address already in use :::3000

A previous copy of the app is still running. Type: "Stop whatever is using port 3000, then start the dev server again." Or close the old terminal window.

npm ERR! ERESOLVE unable to resolve dependency tree

Two packages ask for incompatible versions of a third. Paste the whole output and type: "Resolve this without using --force or --legacy-peer-deps, and explain what you changed."

The app works locally but the published version is blank or errors

Run the production build locally first. Type: "Run npm run build and fix every error it reports, without disabling checks." A build that passes locally usually passes on the host. If the app uses a secret key, check that the host has it set under the same name.

The AI keeps rewriting something you fixed

Tell it what must not change: "Do not touch the amount parsing in lib/scale.ts. Only change X." Put the rules in the project instruction file once: AGENTS.md is read by Codex, Claude Code, GitHub Copilot and OpenCode, and Cursor reads it too. If a tool needs its own file, such as CLAUDE.md, put the single line @AGENTS.md in it.

What to do after the first app

  • Keep a text file of prompts that worked. The prompt library is a starting point.
  • Learn the words you keep seeing in the glossary.
  • Try a terminal agent once you outgrow the browser builder. What is Claude Code explains one of them.

After 100+ apps I barely read the code anymore. I also keep a handbook of my own decisions, so the AI in each repository builds things my way (post). That took months. Start with one app and the test list.

Frequently asked questions

Do I have to pay for an AI tool to follow this guide?

Not to start. As of 1 November 2026 Lovable, Bolt.new, v0, Cursor and GitHub Copilot all have a free plan with limits. Claude Code does not: it needs a paid Claude plan (Pro from $20 a month) or an API account.

Is Lovable's free plan enough to finish a first app?

The free plan gives 5 build credits a day, up to 30 a month, according to Lovable's plan page (checked 1 November 2026). A one-screen app like the recipe scaler can fit. A project with accounts and many fix rounds will likely not.

Can I publish a vibe coded app for free?

It depends on the tool. Replit's free Starter plan allows one published app, and the link goes down after 30 days. Bubble requires a paid plan to deploy a live version. A GitHub repository connected to a static host is the other route; read that host's plan page first.

Does Claude Code need Node.js installed?

Not if you install it with the native installer, Homebrew or WinGet. Only the npm install route needs Node.js, version 22 or newer. The app you build with it may still need Node.js to run.

What does it cost to put a vibe coded app in the app stores?

Google Play charges a one-time $25 registration fee, and new personal accounts need a closed test with at least 12 testers for 14 days before production. Apple's developer program is $99 per year, with prices varying by region.

Next guideBest vibe coding tools →