AI Writes Fast and Breaks Things: A Git Workflow for the One-Person-One-AI Team
An agent changes twenty files in one go and you can't possibly review them all — that's when git becomes your only undo button. This guide lays out a Git workflow designed around one premise: the AI will mess up. Keep main always runnable, branch per task, let the AI write conventional commits, master three rollback moves, and have the AI generate a daily changelog. No ceremony, just survival.

Why vibe coders need git discipline more than anyone
A traditional developer's rhythm: code for an hour, commit once, touch a handful of files. An AI's rhythm: you say one sentence, it changes twenty files, deletes three functions you never noticed, and casually refactors a module you never asked it to touch. You can't review it all — nobody can. So for you, git isn't "version control," it's the undo button: the AI will mess up, and your workflow must be designed around that premise.
The whole discipline boils down to one sentence: always be able to get back to the last state that worked. Everything below serves that sentence.
Branch strategy: main always runs, every task gets its own branch
The rule is simple: the main branch must always be runnable. Every task — a bug fix, a new feature, an AI-led refactor — starts with a fresh branch off main, and the AI gets to thrash around inside that branch. When it's done, you read the diff, and only merge when you're satisfied.
Have the AI name branches feature/xxx, fix/xxx, experiment/xxx, with xxx as a short English phrase. Don't underestimate naming: three months from now, experiment/ai-rewrite-auth tells you exactly what that branch was for, while dev2-final-final tells you nothing.
Reading the diff before merging is the one step in this workflow you may never outsource. The more the AI changed, the harder you should look. If you can't understand the diff, don't merge — ask the AI to explain what it changed first. If it can't explain clearly, it didn't think clearly either.
Let the AI write commit messages: the conventional commits format
The AI writes code fast and writes commit messages fast — don't waste that ability. Give it one hard rule: every commit follows conventional commits — feat: for features, fix: for bugs, refactor: for refactors, chore: for chores — one line saying what changed and why.
Good example: fix: correct coupon stacking calculation on checkout page. Bad examples: update, fix bug, AI generated changes. Commit messages are written for you-three-months-from-now, not for git.
A prompt you can use verbatim: "Write commit messages in conventional commits format, under 50 characters, stating what changed and why. No filler." Paste it into your AGENTS.md and every commit becomes compliant automatically.
Three rollback moves for when the AI wrecks things
Move one: git stash, shelve the half-finished work. The AI is halfway through and you realize it's going the wrong way, but a few snippets are worth keeping — git stash tucks the current changes away and returns the working tree to clean; git stash pop brings them back later. When to use it: your train of thought gets interrupted, or you need to jump over and fix a different bug first.
Move two: git reset, go back to the last working commit. After the AI's flurry of edits the project no longer runs — don't argue with it line by line. git reset --hard HEAD takes you straight back to the last commit. When to use it: the branch is too mangled, and salvaging costs more than redoing. The precondition: you need a "last commit" to return to, so have the AI commit after every small step instead of batching.
Move three: git reflog, recover what got deleted. The AI deleted a branch, or you regretted a reset — don't panic. git reflog shows every historical movement of HEAD; find the commit hash from before the deletion and switch back to it. When to use it: those moments when you were sure you knew what you were doing. The reflog is git's black box, kept for 90 days by default.
The shutdown ritual: a daily AI-generated changelog
Before you stop for the day, have the AI walk through that day's commits and generate a changelog entry in CHANGELOG.md. No fancy format needed: date, which features changed, which bugs were fixed, one line on why.
This pays off late: three months from now a user reports "this feature worked last week," and the changelog gets you to the offending AI refactor in three minutes. Six months from now when you write a project retrospective, the changelog is ready-made material. In the AI era code is written fast — and forgotten just as fast. A changelog is the cheapest weapon against forgetting.
One last statement of the core thesis: AI made writing code ten times faster, and making mistakes ten times faster too — git is the only safety belt that didn't get more expensive. Branches, commit messages, rollbacks, changelogs: get all four in place, and one person plus one AI can ship as steadily as a team.
Related articles

Prompts in vibe projects live in code strings, admin text boxes, and docs — changed live, version unknown when things break. This guide shows how to treat prompts like code: a prompts/ layout, YAML frontmatter, semantic versioning, PR reviews, canary rollouts with one-click rollback, plus an evals baseline — and a real war story: one added sentence cost 12 points of classification accuracy.

The faster AI writes code, the more review matters. Four layers: diffs for logic (boundaries, errors, concurrency — plus auth, payments, SQL, encryption, secrets), runtime for behavior (type checks, lint, security scans go green first), AI for first-pass screening (a second model reviews, humans read only flagged parts), humans for the final call (AI never clicks merge). Includes commit norms, PR template, branch protection, rollback plans.

Mitchell Hashimoto published OSC 7501, the "Program Status Protocol": any program can report via a terminal escape sequence whether it is idle, working, blocked, or done — and why. The motivation: people running N coding agents today can only "read the screen and guess." He wants to turn guessing into knowing. Ghostty already implements it, with a dozen-line PoC for Claude Code and Codex.