Vibe coding made generation cheap. It did not make proof free.
Most sessions that "almost worked" share the same shape:
- Agent writes a lot
- Something green appears once
- You stop
- Next session, the same class of bug returns
The fix is not a better prompt personality. It is a verification loop you run until it is boring.
This sits next to the beginner vibe coding guide. That guide is the curriculum. This is the magnet you pin.
Kill the default approach
Default: generate until it "looks right," glance at the page, merge later.
What breaks first:
- Plausible code with no automated truth
- Scope creep ("while we are here")
- Session 2 cannot reconstruct session 1
- Secrets and money paths without a human gate
If the agent never ran a green command, you did not finish the session. You paused the theater.
By the end you will have
- The Five-Gate Verify Loop named and memorized
- A Session Receipt template you reuse
- Three session playbooks (feature / stuck / review-only)
- A clear list of failure modes the loop kills
- Rules for when not to skip a gate
Mechanism: proof is the product of the session
Generation is the cheap step. The expensive step is closing the loop between edit and evidence.
One mechanism: every gate either reduces search space (scope, plan) or produces evidence (verify, receipt). Skip a gate and you buy rework with interest.
Surfaces (Claude Code, Cursor, Codex) do not replace gates. Stack map: vibe coding stack mid-2026.
Magnet: Five-Gate Verify Loop
Name: Five-Gate Verify Loop
Copy into a skill, CLAUDE.md, or session note header.
# Five-Gate Verify Loop
1. SCOPE
- One user-visible outcome in one sentence
- Agent must restate it before tools
2. PLAN
- Files likely touched
- Green command that proves done
- Out of scope (migrations, redesign, drive-bys)
3. IMPLEMENT
- One promise per session when possible
- No "while we are here" without a new scope line
- Prefer small diffs
4. VERIFY (non-negotiable)
- Run the green command (typecheck / test / lint / build)
- Chain: simulate before send
- Auth / money / keys: human gate
5. RECEIPT
- Decision
- Evidence (command + result)
- Next action for tomorrow-youMinimum green command (TypeScript example):
pnpm typecheck && pnpm lint && pnpm testIf the repo has no green command, making one is the real task.
You should see: scope sentence, green command output, and a three-line receipt in the same session log. Missing any one = loop incomplete.
Promote repeated plans into a skill.
Gate details that matter
Scope
- Bad: "Improve auth"
- Good: "User can reset password via email link and land signed in"
Plan
List out-of-scope explicitly. Agents invent work when silence looks like permission.
Implement
Reject module rewrites that are not in the scope sentence.
Verify
- Solana: simulate before send (beginner stack)
- No model gets unsupervised mainnet or production credentials
Receipt
Journal pattern, not chat dump. Difference between residue and an agent OS.
Worked example: one afternoon feature
Scope: "User can export last 30 days of jobs as CSV from the dashboard."
Plan: three files (route, UI button, test); green command pnpm test -- jobs-export.
Implement: agent adds route + button; you kill a drive-by redesign of the table.
Verify: tests fail once on date timezone; fix; green.
Receipt:
- Decision: UTC day boundary for export window
- Evidence:
pnpm test -- jobs-exportgreen - Next: wire download analytics tomorrow
You should see: PR size matches scope; tomorrow-you does not need the chat.
Session templates
30-minute feature
- Scope sentence
- Plan: 3 steps max
- Implement
- Green command
- Receipt: 5 bullets
Stuck debug
- Reproduce in one command
- Switch model once if thrashing (routing)
- Minimal fix
- Same failing command now green
- Receipt: root cause in one line
Review-only
- List risks (security, data, scope)
- Run verify without "helpful" refactors
- PR notes only
Failure modes the loop kills
| Symptom | Missing gate | Fix |
|---|---|---|
| Works on my machine only | Verify | Add CI-local green command |
| Wrong module rewritten | Scope / plan | File allowlist in skill |
| Session 2 amnesia | Receipt | Journal + memory stack |
| Green bar, broken UX | Verify too thin | One e2e or scripted check |
| Secrets in logs | Human gate | Pre-commit deny + skill out-of-scope |
When not to use the full five gates
- Pure reading / learning with no repo writes
- Emergency hotfix already reduced to a one-line known fix (still run verify)
- Pairing where a human is the verify loop in real time (still write a receipt)
- Exploratory spikes you will delete - mark them
throwaway/so they never merge
Do not use "when not to" as an excuse to skip verify on merge candidates.
Standing protocol (paste)
## Session rule
No PR without: scope sentence, green command output, three-line receipt.Bottom line
Speed is easy. Proof is the craft.
Your next action: run Five-Gate Verify Loop on the next session today - write the scope sentence before the first tool call.
- Free map: Agent OS checklist
- Install with package scope: Agent OS Setup
- Related: harness is the product