What AI actually does in software development
A large language model is a program that predicts what text comes next. That is the whole mechanism. It was trained on an enormous amount of writing — including most of the public code ever published — and from that it learned which words, and which lines of code, tend to follow which others.
ChatGPT from OpenAI, Claude from Anthropic, and Gemini from Google are the three you have most likely used. They differ in training, size, personality, and price, and people hold strong opinions about which is best at what. Underneath, they work the same way, and everything in this book applies to all of them.
This sounds too simple to be useful, and it is the single most important thing to understand. The model is not looking anything up. It has no database of correct answers, no compiler, no way to check whether the function it just wrote exists. It is producing the most plausible continuation of your text, and plausible is not the same as correct.
That explains almost every strange behaviour you will meet. It invents a library function that does not exist because a function with that name would be plausible. It agrees with you when you push back because agreement is the plausible continuation of a disagreement. It writes confident nonsense because it has no separate signal for confidence — the tone was in the training data too.
The model is a very good writer with no ability to verify anything it writes. Your job is to supply the verification — and the context that makes the plausible answer also the correct one.
Which is genuinely useful, because an enormous amount of programming is writing text that follows well-known patterns. Boilerplate, tests, data transforms, glue code, config, documentation, refactors that touch forty files identically. A model that produces the plausible continuation is very fast at exactly that work, and it does not get bored on the thirty-ninth file.
What "vibe coding" means
The term was coined by Andrej Karpathy in early 2025, and it describes a shift in where the programmer's attention goes. Instead of typing each line, you describe the intent, the constraints, and the user flow, and let the model produce the implementation. You steer; it types.
Karpathy's original framing was deliberately loose — he was describing a fast, informal mode where you barely read the diffs and just keep nudging until the thing works. That is genuinely fine for a weekend prototype, and genuinely dangerous for anything you or anyone else has to maintain.
The useful version of vibe coding is not "stop reading the code". It is a change in the unit of work. You stop thinking in lines and start thinking in intent, constraints, and verification:
- Intent — what should be true when this is done, described in terms of behaviour rather than implementation.
- Constraints — the stack, the patterns, the things that must not change, the parts of the codebase that are off limits.
- Verification — how you will know it worked. A test, a command to run, a page to open.
Supply all three and the results are startlingly good. Supply only the first and you get the horror stories: confident code that runs, looks reasonable, and quietly does the wrong thing.
AI App Builders vs AI Code Editors
These are two different categories of tool aimed at two different people, and picking the wrong one is the most common early mistake.
App builders
Tools like Lovable and Bolt.new generate a whole working application from a description. They own the stack, the hosting, and the project structure. You describe a product; you get something deployed you can click.
These are built for people who need a working thing to exist — founders validating an idea, someone who needs an internal tool by Friday, anyone whose goal is the product rather than the code. The trade is control: you are inside their conventions, and moving the result somewhere else later is real work.
Code editors
Tools like Cursor, Windsurf, and Claude Code work inside a codebase that already exists. They read your files, follow your patterns, and make changes you review like any other diff. Nothing is hidden and nothing is owned by the tool.
These are built for engineers with an existing project, a team, a review process, and opinions about architecture. They are worse at "make me an app from nothing" and far better at "change this behaviour across a codebase without breaking the other forty things that depend on it".
If the code is the deliverable, use an editor. If the running product is the deliverable and the code is a means to it, a builder will get you there faster. Most people who get frustrated picked the tool that matched their ambition instead of the one that matched their deliverable.
Who this is for
Everything after this phase assumes you are working on something that lasts longer than one conversation. That is the dividing line this book cares about — not how much code you write, but whether the work continues tomorrow.
If you only ever ask one-off questions, you do not need memory files or caching or skill definitions. Ask better questions and you are done. But the moment a project spans sessions, everything changes: the model starts each conversation knowing nothing, and every hour you spend re-explaining your project is an hour the tool cost you rather than saved.
That is the problem Phase 2 solves, and it is the reason this book exists.
Your first workflow
Before any of the advanced machinery, this loop alone will put you ahead of most people using these tools. Try it on something real and small.
- State the outcome, not the steps. "Users should stay logged in after refreshing" beats "add a useEffect that reads localStorage". This one is worth its own section — see the golden rule below.
- Name your constraints up front. The framework, the version, the file it belongs in, and anything it must not touch. Constraints you leave unsaid will be invented.
- Ask for the plan before the code. One paragraph describing the approach. Reading a wrong plan takes ten seconds; reading a wrong implementation takes ten minutes.
- Let it write, then read every line. Not to be thorough — to catch the confident invention. You are the compiler it does not have.
- Verify by running something. A test, the app, a command. "It looks right" is not verification.
Notice that steps 1 to 3 are all about supplying context before anything is generated, and that steps 4 and 5 are about verifying afterwards. Every technique in the rest of this book is a more powerful version of one of those two moves.
The golden rule: what beats how
Of the five steps above, the first one carries most of the weight, and it is the one people get wrong most reliably. Compare these two requests:
"Users should stay logged in after refreshing."
"Add a useEffect that reads localStorage."
Both will produce code. Only one of them lets the model help you. Here is why the difference is so much larger than it looks.
You let it pick the right tool for your stack
The second request forces one specific path. If you are working in a modern
server-rendered framework, that path is actively wrong — reading
localStorage in an effect introduces hydration problems, and putting a
session token there exposes it to any script running on the page, which is exactly the
thing HTTP-only cookies exist to prevent.
The model very likely knows this. It will not tell you, because you did not ask for a
solution — you asked for a useEffect, and it is obliging. State the outcome
instead and it is free to suggest the HTTP-only cookie, the server-side session check, or
the persistence layer your framework already ships.
You get the whole feature, not the fragment
"Users should stay logged in" is a user story, and the model has read an enormous number of complete implementations of that story. Ask for the outcome and you tend to get the parts you would have forgotten:
- A loading state covering the moment while auth status is still unknown.
- The expired-token case, which is the one that reaches production unhandled.
- A redirect back to login when the check fails.
Ask for the hook and you get the hook. Every one of those surrounding concerns stays on your desk, and you will discover the missing ones the same way everyone does.
You spend your attention where it is scarce
This is the real point of working this way. Your limited thinking should go to user
flows, business rules, and whether the feature is the right feature at all. Whether the
answer needs useEffect, useLayoutEffect, or a custom hook is a
question the model can answer faster than you can, and getting it wrong is cheap to fix.
Getting the product decision wrong is not.
The management analogy
Treat it as a fast, well-read junior developer with no context on your project. The difference between the two requests is the difference between two managers:
- Micromanaging: "Go to line 45, write a for-loop, push the result to the DOM." You get exactly that, including the bug you did not notice in your own instruction.
- Delegating: "Users need to see their past orders, and it should load fast." You get judgement applied to a goal.
The catch — and it is why this is a rule rather than a trick — is that delegating only works when the brief is complete. A junior developer given a goal and no constraints will invent the constraints, and so will the model. That is the whole argument for the rest of this book: describe the what, then make sure the context around it is good enough that only one sensible how remains.