What is vibe coding? A step-by-step way to try it safely
What is vibe coding, and where does the name come from? Karpathy's definition, plus 7 steps in Claude Code: permission modes, tests, and undoing changes.
This article in other languages:العربيةDeutschEspañolFrançaisItaliano日本語Polski简体中文
In this article
- What is vibe coding, and where does the name come from?
- How is vibe coding different from programming with AI?
- What can go wrong?
- Step 1: which project should you pick first?
- Step 2: how do you set up the tool and an empty folder?
- Step 3: how do you describe what you are building?
- Step 4: which permission mode should you choose?
- Step 5: how does the agent know it is done?
- Step 6: how do you undo changes when something breaks?
- Step 7: what should you check before showing the project to others?
- FAQ
What is vibe coding? It means building a program by talking to a language model, without reading the code the model writes. Andrej Karpathy coined the name in early February 2025 and said right away what this way of working is good for: throwaway weekend projects.
In this tutorial we build exactly that kind of project, in seven steps, set up so that an agent’s mistake costs a few minutes at most. The examples use Claude Code, and the commands come from its documentation.
What is vibe coding, and where does the name come from?
Karpathy described a new kind of coding where you “fully give in to the vibes, embrace exponentials, and forget that the code even exists”. In the same post he admitted that he always clicks “Accept All”, no longer reads diffs, and pastes error messages to the agent without comment.
Two sentences from that post get quoted less often. The code grows beyond what the author would usually keep in his head, and the whole thing, he wrote, is not too bad for “throwaway weekend projects”. So the definition came with a limit from the start.
It also matters who wrote it. Karpathy is a co-founder of OpenAI and the former head of AI at Tesla, someone who can read the code whenever he wants to. I wrote about what he builds this way today in the piece on HackerTube.
How is vibe coding different from programming with AI?
Simon Willison drew the cleanest line in “Not all AI-assisted programming is vibe coding (but vibe coding rocks)”, published March 19, 2025. Vibe coding, in his definition, is building software with an LLM without reviewing the code it writes. If you reviewed the code, tested it, and can explain to someone else how it works, that is ordinary software development, even when the model wrote every line.
Willison has a golden rule for this: no code goes into a repository unless he could explain exactly what it does to somebody else. At the same time he defends the idea itself. If vibe coding lets millions of people build their own small tools, he can hardly think of better news.
What can go wrong?
Two examples from 2025 show where the fun ends.
- Lovable. Matt Palmer of Replit (a competitor, that is) scanned 1,645 apps built with Lovable and, as Semafor reported, in 170 of them anyone could read users’ data: names, email addresses, financial information and API keys. The cause was a misconfigured database.
- Replit. Jason Lemkin, the founder of SaaStr, reported in July 2025 that Replit’s agent deleted his production database even though it had been told not to change anything without permission, and that earlier it had generated a database of 4,000 fictional people. The Register covered the whole story.
In both stories the trouble started in the same place: the project stopped being a toy (real users, a real database), and the way of working stayed the same.
Step 1: which project should you pick first?
Willison lists the conditions under which vibe coding is fine. The project should be low stakes, meaning a bug or a security hole cannot hurt anyone. It should not touch secrets (API keys, passwords) or private data that could leave your computer. And it should not use services billed by usage, because according to Willison there have been bills in the thousands of dollars after vibe coding against an API with no spending limit.
So a good first project is something for one person and without a network: a habit tracker, a file converter, a simple browser game.
Step 2: how do you set up the tool and an empty folder?
Claude Code installs with a single command from the official quickstart. On macOS, Linux and WSL:
curl -fsSL https://claude.ai/install.sh | bash
In Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
To sign in you need a Claude subscription (the documentation lists Pro, Max, Ultra, Team and Enterprise) or a Claude Console account. I covered installation and the first run in more detail in Claude Code from scratch.
If you prefer OpenAI’s Codex, the Codex CLI documentation has the equivalent command: curl -fsSL https://chatgpt.com/codex/install.sh | sh, then codex in the project folder and “Sign in with ChatGPT”. Permissions there are set with the /permissions command.
Now the most important part: start the agent in a new, empty folder, not in your home directory and not in a repository from work.
cd /path/to/your/project
claude
Step 3: how do you describe what you are building?
You do not need a finished spec. The best practices documentation suggests letting Claude interview you, and gives this prompt as a pattern (the original is about rate limiting in an API):
I want to add rate limiting to the public API but haven't thought it through yet. Interview me until you could write the spec, then write it to SPEC.md.
Swap the first part for your own idea. Claude asks questions with options to choose from until the answers add up to a SPEC.md file. The documentation then advises starting a new session and building from that file, with a clean context and a written definition of “done”.
Step 4: which permission mode should you choose?
This is where you decide how much “Accept All” you really want. The modes are described on the permission modes page, and you switch between them in a session with Shift+Tab.
| Mode | What the agent does without asking | Who it is for |
|---|---|---|
Manual (default) |
reads only | you want to see every change |
| Accept edits | reads, edits files, runs simple file commands (mkdir, mv, cp) |
you iterate and review the code |
| Plan | reads and proposes a plan; edits wait for your approval of it | before changing anything |
| Auto | everything, with a separate classifier model judging each action in the background | long tasks |
| Bypass permissions | everything, with no prompts and no checks | isolated containers and virtual machines only |
According to the documentation, new sessions in the terminal and in VS Code start in auto mode. For vibe coding that is a reasonable middle ground, but the same documentation says auto mode reduces the number of prompts and does not guarantee safety.
Do not use the --dangerously-skip-permissions flag (the equivalent of Bypass permissions) on your own laptop. Anthropic’s warning is unambiguous: this mode protects against neither prompt injection nor unintended actions. I explain the first of those attacks in What is prompt injection.
Step 5: how does the agent know it is done?
Since nobody is reading the code, something else has to check it. The documentation says Claude stops when the work looks finished, and that without a test you become the test suite. Its advice: give Claude something it can run that returns pass or fail. That can be a test file, a build result or a linter.
The simplest version fits in the prompt. An example from the documentation:
run the auth tests after, and keep going until they pass
At the end, ask for evidence: the command the agent ran and its output. “All tests pass” on its own tells you little.
Step 6: how do you undo changes when something breaks?
Claude Code saves the state of your files before each prompt you send. You open checkpoints with the /rewind command (or by pressing Esc twice with an empty input) and choose whether to restore the code, the conversation, or both. A session keeps the last 100 checkpoints.
There is one catch: a file changed only by Bash commands is not tracked, and /rewind will not restore it. The documentation states plainly that checkpoints do not replace version control, so after every working stage ask the agent for a commit. The quickstart has a ready-made prompt:
commit my changes with a descriptive message
Step 7: what should you check before showing the project to others?
As long as you are the only one using the program, vibe coding can stay vibe coding. Before sharing it with anyone, Willison advises consulting a more experienced developer, and there are three things you can do yourself:
- Run
/code-review. According to the documentation, the diff is then examined by a fresh subagent that has not seen your conversation, so it is not swayed by the reasoning that produced the code. - Check that the repository contains no keys or passwords (the Claude Code secrets leak showed how a reflexive “Yes, and don’t ask again” ends).
- If a database or a login has been added, read that part of the code, or ask the agent to explain it to you until you can repeat it in your own words. This is the moment Willison’s rule starts applying to you too.
I covered deny rules, the sandbox and keeping keys in order in AI agent security.
FAQ
Do you need to know how to program to vibe code?
No. Willison writes that nobody should need a computer science degree to get a computer to do a specific task for them. Being able to read code starts to matter when the project stops being a toy.
Is vibe coding suitable for production apps?
According to Willison, not in its pure form: production code has to be reviewed, tested and understood. The Lovable and Replit cases show what happens when that step disappears.
How is vibe coding different from working with an AI agent?
The tool is the same, for example an AI agent such as Claude Code or Codex. The difference is on your side: in vibe coding you do not read the code, and in ordinary work with an agent you review its changes.
Is Claude Code available for free?
For signing in, the documentation lists the Pro, Max, Ultra, Team and Enterprise plans and a Claude Console account with prepaid credits. A free plan is not on that list.