Vibe Coding: build real apps with AI · Episode 2. Every AI reply here was really run on 6 November 2026 with Claude Code 2.1.318. Every price and free limit was checked on the tool's official page on 6 November 2026. They change often: check again on the day you sign up.
The problem: from one file to a real app
Last episode Ravi's bill splitter worked: one small file, one job. Now the flat wants rent, groceries, the Wi-Fi bill and a history of who paid what. That's a real app with several files that work together. Which tool should he use?
Kind 1: chat assistants (and their limit)
A chat assistant is a chat website or app (Claude, ChatGPT, Gemini) where you type a question and it replies, including code.
What goes wrong on a real project:
| Problem | What happens |
|---|---|
| Copy-paste | Ravi copies every change out of the chat into the right file: he's the delivery person |
| It can't see your files | the files aren't in its context, so it guesses (real reply from Episode 1: "I haven't seen your script") |
| It can't run anything | Ravi runs it, copies the error, pastes it back, waits |
| Versions get mixed up | 20 replies later he pastes an old version over a new one |
Great for: a question, an explanation, one small script.
Kind 2: IDE assistants
An IDE (integrated development environment) is the app where you write code, such as VS Code. An IDE assistant lives inside it and can see your open files. It gives inline suggestions (also called completions): grey suggested text appears as you type, and you press Tab to accept it.
| Doing homework | Coding |
|---|---|
| asking a friend on the phone (you read every question out) | chat assistant: sees only what you paste |
| the friend sits next to you and sees your notebook | IDE assistant: sees your open files |
| the friend finishes your sentence | inline suggestions / completions |
Real examples (official pages, 6 Nov 2026):
- GitHub Copilot: works in VS Code and other editors. Copilot Free: 2,000 completions per month, auto model selection, limited agents. Copilot Student: free for verified students. Copilot Pro: $10/month. Pro+: $39/month. (GitHub Docs: plans)
- Cursor: a whole editor built around AI. Free: limited use of Agent, Chat and Tab completions. New paid plans start at Plus, $8/month. (Cursor: pricing and plans)
- Windsurf-style AI editors: on 6 Nov 2026, windsurf.com's pricing and editor pages redirected to devin.ai ("Devin Desktop"). Names change fast; always check the official site.
- Claude Code also has extensions for VS Code and JetBrains editors. An extension is an add-on that gives an app new features.
What's still missing: Ravi still creates every file and runs every command himself.
Kind 3: agents
An agent is a program that works towards a goal by taking steps on its own. An AI coding agent works in a loop: plan, edit files, run a command, read the output, fix, repeat (Episode 6 goes deep). Permissions are the rules about what it may do, for example "write files, but ask before running commands".
| A trusted house helper | An AI coding agent |
|---|---|
| "Make dinner for 4": one goal, not 50 steps | you give a goal |
| cooks, tastes, adjusts | works in a loop |
| "Can I use the gas?" | asks before risky steps (permissions) |
A real agent run
--allowedTools "Write" = it may write files, nothing else.
ravi@laptop:~/split$ claude -p "Create split.py that splits a 1000 rupee bill among 3 friends in whole paise so the shares add up exactly, then run it with python3 and tell me the output." --allowedTools "Write"
Real reply (shortened):
I created `/home/ravi/split/split.py`, but I haven't run it. The command
to run it needed your approval, so there is no output to report yet.
...
That's from reading the code, not from a run. If you approve the
command, I'll run `python3 split.py` and confirm the real output.
ravi@laptop:~/split$ ls
split.py
Now approve exactly one command:
ravi@laptop:~/split$ claude -p --continue "You may run it now." --allowedTools "Write" "Bash(python3 split.py)"
Real reply:
I ran `split.py` and it printed:
Friend 1: 333.34 rupees (33334 paise)
Friend 2: 333.33 rupees (33333 paise)
Friend 3: 333.33 rupees (33333 paise)
Sum: 100000 paise (expected 100000)
The shares add up to exactly 100,000 paise (1000 rupees).
Friend 1 pays the extra paisa.
The file the agent wrote (real):
def split(total_paise, n):
base, rem = divmod(total_paise, n)
# first `rem` friends get one extra paisa
return [base + 1 if i < rem else base for i in range(n)]
total = 1000 * 100 # 1000 rupees in paise
shares = split(total, 3)
for i, s in enumerate(shares, 1):
print(f"Friend {i}: {s // 100}.{s % 100:02d} rupees ({s} paise)")
print(f"Sum: {sum(shares)} paise (expected {total})")
assert sum(shares) == total
- It's different from Episode 1's code: AI output changes from run to run.
assertis a check that stops the program with an error if something is false. The agent added its own safety check.- In normal use you don't type these flags; Claude Code shows each command and asks yes or no. Read it before you say yes. Narrow permissions are safer: an agent that may run anything can also delete anything.
Examples: Claude Code is an agent; Cursor and GitHub Copilot have agent modes. The catch: agents work on your computer, so it needs an editor, a terminal and languages installed (Episode 3).
Kind 4: browser app builders
An app builder is a website where you describe an app and it builds the whole thing (screens, code and often hosting, which means putting the app on the internet so others can open it) in your browser.
| Getting a home | Getting an app |
|---|---|
| a furnished flat: move in today | app builder: a whole app from a prompt |
| the landlord's rules: you can't knock down a wall | usage limits, and lock-in (stuck with one company because leaving is hard) |
| check you can take your furniture | check you can export the code (download it and run it elsewhere) |
Real examples (official pages, 6 Nov 2026):
| Tool | Free plan | A paid plan |
|---|---|---|
| v0 (by Vercel) | 7 messages a day (v0 docs: pricing) | Plus $30/user/month |
| Lovable | 5 credits a day, up to 30 a month (Lovable docs) | see their plans page |
| Bolt | 1M tokens a month, 300K daily limit (Bolt pricing) | Pro $25/month |
| Replit Agent | Starter: a daily Agent allowance, 1 published app (Replit docs) | Core $204/year |
A credit is a unit of usage the company defines (one big request can use more than one). A token is a small piece of text, often part of a word, that AI usage is measured in.
Free tiers and paid plans at a glance (6 Nov 2026)
| Tool | Free | Paid starting point |
|---|---|---|
| Claude Code | not on the Claude Free plan | Claude Pro: $20/month billed monthly ($17/month with the annual discount); Max from $100/month (Claude pricing) |
| GitHub Copilot | Free: 2,000 completions/month; Student: free if verified | Pro $10/month |
| Cursor | Free: limited Agent, Chat, Tab | Plus $8/month |
| v0 | 7 messages/day | Plus $30/user/month |
| Lovable | 5 credits/day (max 30/month) | see plans page |
| Bolt | 1M tokens/month | Pro $25/month |
| Replit | Starter: daily Agent allowance | Core $204/year |
Prices in US dollars, before tax. You can follow this course with free plans and the free SyntaxPilot compiler; when a step needs a paid tool, we say so.
Choosing a tool
| Job | Best kind |
|---|---|
| a question, an explanation, one small script | chat assistant |
| you write code yourself, with help as you type | IDE assistant |
| a real project, many files, run and test | agent |
| a quick prototype, only a browser | app builder |
Tools come and go (Windsurf, this week). Skills (clear prompts, reading code, testing) work everywhere.
What an API key is
An API (application programming interface) is a doorway one program uses to talk to another, for example your program asking a weather service for Delhi's temperature. An API key is a long secret piece of text your program sends with each request, so the service knows who is asking and whom to bill.
| Metro card | API key |
|---|---|
| tap it, the gate knows it's you | proves who you are |
| each trip charges your balance | each request is counted, and billed to you |
| lose it, a stranger travels on your money | leaked: strangers use your account and run up your bill |
A real AI key mistake
DEMO_KEY_1234_NOT_REAL is a made-up placeholder. Never show or paste a real key.
ravi@laptop:~/weather$ claude -p "Write a short Python script weather.py that gets today's temperature in Delhi from the OpenWeatherMap API. My API key is DEMO_KEY_1234_NOT_REAL. Just show the code."
Real reply (shortened):
# weather.py
import requests
API_KEY = "DEMO_KEY_1234_NOT_REAL"
URL = "https://api.openweathermap.org/data/2.5/weather"
params = {"q": "Delhi,IN", "appid": API_KEY, "units": "metric"}
...
Two mistakes: Ravi pasted the key into a prompt, and the AI hard-coded it (wrote the value directly into the code), with no warning.
Why it's dangerous: code gets shared (GitHub, friends, screenshots). Anthropic's own API key best practices warn that developers often commit plain keys to public GitHub repositories, which leads to abuse; it says never put keys directly in code, use environment variables, add .env files to your ignore file, and revoke a key immediately if you think it leaked. (Commit = save a version of your code with Git, Episode 26. Revoke = cancel the key on the service's website.)
The fix: environment variables
An environment variable is a named value that lives in your computer's settings for a program, not in the code (your metro card in your wallet, not taped to your notebook).
ravi@laptop:~/weather$ claude -p --continue "Don't put the key in the code. Read it from an environment variable called OWM_API_KEY instead, and print a clear message if it's missing. Just show the code."
Real reply (shortened):
# weather.py
import os
import sys
import requests
API_KEY = os.environ.get("OWM_API_KEY")
if not API_KEY:
sys.exit("Error: OWM_API_KEY environment variable is not set.\n"
"Set it first, e.g.: export OWM_API_KEY=your_key_here")
...
Check it (real):
ravi@laptop:~/weather$ grep -n "API_KEY" weather.py
6:API_KEY = os.environ.get("OWM_API_KEY")
7:if not API_KEY:
8: sys.exit("Error: OWM_API_KEY environment variable is not set.\n"
9: "Set it first, e.g.: export OWM_API_KEY=your_key_here")
12:params = {"q": "Delhi,IN", "appid": API_KEY, "units": "metric"}
ravi@laptop:~/weather$ python3 weather.py
Error: OWM_API_KEY environment variable is not set.
Set it first, e.g.: export OWM_API_KEY=your_key_here
grep searches a file for text and shows line numbers. No secret in the file. Episode 13 stores keys in a .env file and keeps it out of GitHub.
Common mistakes
| Mistake | What you see | Why | Fix |
|---|---|---|---|
| copy-pasting 5 files in and out of a chat | old code pasted over new code | the chat can't see or run your files | use an IDE assistant or an agent for projects |
| letting an agent run any command | it can delete files too | wide permissions = wide damage | read each command; approve one at a time |
API_KEY = "DEMO_KEY_1234_NOT_REAL" |
the secret is visible to anyone with the code | hard-coded keys leak with the code | os.environ.get("OWM_API_KEY") |
| pasting a real key into a prompt | the key is now in a chat log | prompts are stored and shared | never paste real keys; use placeholders |
Mini project: your tool map
Make a table with the four kinds of tools. For each, write one tool you'd try, its free limit from the official page today, and one job you'd use it for.
Example
| Kind | Tool | Free limit (checked today) | My job |
|---|---|---|---|
| chat assistant | Claude | free plan | explain an error message |
| IDE assistant | GitHub Copilot Free | 2,000 completions/month | help while I type HTML |
| agent | Claude Code (Pro) | paid | build the flat expenses app |
| app builder | v0 Free | 7 messages/day | a sign-up page prototype |
Practice questions
- Why can't a chat assistant fix a bug in a file it hasn't seen?
Answer
The file isn't in its context. It can only guess from what you paste.
- What did
--allowedTools "Write"allow, and what did it block?
Answer
It allowed writing files and blocked everything else, including running python3 split.py, until that exact command was allowed.
- Rewrite this line safely:
API_KEY = "DEMO_KEY_1234_NOT_REAL"
Answer
import os
API_KEY = os.environ.get("OWM_API_KEY")
- What should you do if you pushed a real key to a public repository?
Answer
Revoke it immediately on the service's website, create a new one, and keep the new one in an environment variable.
Quiz
An AI wrote API_KEY = "sk-live-...your real key...". What should you do?
A) Nothing, it works · B) Move the key to an environment variable, and revoke it if it was shared · C) Make the key shorter · D) Put the line at the bottom of the file
Answer
B. A key in code leaks with the code. If the file was ever shared or pushed, assume it leaked: revoke it and make a new one.
Interview questions
- Compare chat assistants, IDE assistants, agents and app builders. Chat: questions and small scripts, sees only what you paste. IDE: inside the editor, sees files, completions. Agent: plans, edits files, runs commands in a loop with permissions. App builder: a whole app in the browser, with limits and lock-in.
- Why do agents ask permission before running commands? Commands can change or delete things on your computer; permissions limit the damage of a wrong step.
- How do you keep an API key out of your code? Environment variables (or a secret manager in production),
.envfiles listed in.gitignore, never in prompts; revoke and rotate leaked keys. - What is lock-in? Depending on one platform so much that leaving is hard; check whether you can export your code.
Glossary
| Term | Meaning (plain words) | Example |
|---|---|---|
| Chat assistant | an AI chat website or app that replies to questions, including with code | Claude, ChatGPT, Gemini |
| IDE | integrated development environment: the app where you write code | VS Code |
| IDE assistant | an AI helper inside the editor that sees your open files | GitHub Copilot |
| Inline suggestion / completion | grey suggested code that appears as you type; Tab accepts it | Copilot Free: 2,000 a month |
| Extension | an add-on that gives an app new features | Claude Code for VS Code |
| Agent | a program that works towards a goal by taking steps on its own | Claude Code writing and running split.py |
| Loop (agent loop) | plan, edit, run, read the output, fix, repeat | Episode 6 |
| Permissions | rules about what an agent may do | --allowedTools "Write" |
| assert | a check that stops the program if something is false | assert sum(shares) == total |
| App builder | a website that builds a whole app from a prompt | v0, Lovable, Bolt, Replit Agent |
| Hosting | putting an app on the internet so others can open it | an app builder's published app |
| Lock-in | being stuck with one company because leaving is hard | an app you can't export |
| Export | download your app's code to run elsewhere | "export to GitHub" |
| Credit | a unit of usage a company defines | Lovable: 5 a day |
| Token | a small piece of text, often part of a word; AI usage is measured in it | Bolt: 1M a month |
| Free tier | what a tool lets you use without paying | Copilot Free |
| API | a doorway one program uses to talk to another | the OpenWeatherMap API |
| API key | a secret text that proves who you are to an API; usage is billed to you | DEMO_KEY_1234_NOT_REAL (placeholder) |
| Hard-coding | writing a value directly into the code | API_KEY = "..." |
| Environment variable | a named value kept in your computer's settings, outside the code | OWM_API_KEY |
| Revoke | cancel a key so it stops working | after a leak |
| grep | a command that searches a file for text | grep -n "API_KEY" weather.py |
Summary
- Four kinds of AI coding tools: chat assistants, IDE assistants, agents, app builders, each fixing the last one's limit.
- Agents edit files and run commands in a loop, and ask permission; read every command before approving.
- App builders are fast but come with limits and lock-in; check you can export.
- Free tiers and prices change: check the official page (we checked on 6 Nov 2026).
- An API key is a secret that bills you; never in code, never in a prompt. Use environment variables.
Next episode: your setup: VS Code, the terminal, PATH, Node and npm, Python and pip, Git, and a no-install option.