RunCabin Blog · For vibe coders · Part 1

Source control for vibe coders: set up GitHub, then make your agent use it

December 4, 2026 · 9 min read

Your coding agent can change forty files in a minute. Source control is how you get back to the version that worked. It takes a free GitHub account, about twenty minutes, and one file, AGENTS.md, that tells your agent to save its work on every task without being asked. The file is below, ready to copy.

Why it matters the first time something breaks

You ask for a bigger logo. The agent also tidies up the contact form, and now the form doesn't send. You ask it to put things back, and it guesses, because it doesn't remember what the file looked like an hour ago. Neither do you.

With source control, every working version is a save point. Going back is one command, and before you accept a change the agent can show you exactly which lines it touched. It also covers the dull disasters: a dead laptop, a deleted folder, a redesign you want to try without losing the site that works.

Five words you need

Git is the program on your computer that keeps the history. GitHub is the website that holds a copy of it.

Step 1: get a GitHub account

  1. Sign up at github.com. The free plan includes unlimited private repositories.
  2. Turn on two-factor sign-in: Settings, then Password and authentication. Your code lives here now, along with anything you forget to keep out of it.
  3. Install git and the GitHub CLI. On a Mac with Homebrew: brew install git gh. On Windows: winget install --id Git.Git -e, then winget install --id GitHub.cli -e. Or ask your agent to install them.
  4. Sign in from the terminal with gh auth login. Pick GitHub.com and HTTPS, say yes when it offers to authenticate git with your GitHub credentials, and finish in the browser.
  5. Tell git who you are, once: git config --global user.name "Your Name" and git config --global user.email "you@example.com". To keep your real address out of the history, use the private noreply address GitHub shows under Settings, then Emails.

Do step 4 yourself. Never paste a password or token into the chat with your agent; the browser sign-in means you never have to.

Step 2: put your project under source control

You can tell your agent "set up git here and put it on my GitHub as a private repo", or do it yourself. Either way, start with a file called .gitignore in the project folder. It lists what never goes to GitHub: your secrets and anything your tools can rebuild.

.env
.env.*
!.env.example
node_modules/
dist/
.DS_Store

Then, from the project folder:

git init -b main
git add -A
git status
git commit -m "First save point"
gh repo create my-site --private --source=. --push

Read what git status prints before you commit. If .env is in the list, fix .gitignore first. When the last command finishes, open your repository on GitHub: your files are there, with one commit.

If a key ever reaches GitHub, deleting the file doesn't remove it. It is still in the history. Revoke the key with whoever issued it, make a new one, and add the file to .gitignore.

Step 3: the AGENTS.md that makes your agent use it

Your agent knows git. Left alone, it uses it when it feels like it: one session commits every step, the next edits main for an hour and saves nothing. AGENTS.md fixes that. It is a plain text file at the root of your project that coding agents read before they start, and it turns "please commit" into a rule for every task.

Codex, Cursor, GitHub Copilot's coding agent, Windsurf, Zed, Jules and many more read it; agents.md keeps the list. Claude Code reads it when your project has no CLAUDE.md. If yours has one, put the line @AGENTS.md at the top of CLAUDE.md. Gemini CLI reads it once you set "context": { "fileName": "AGENTS.md" } in .gemini/settings.json.

Copy this into a file named AGENTS.md at the root of your project, commit it, and start a new chat so the agent reads it.

AGENTS.md
# AGENTS.md

## Source control: use it on every task, without being asked

This project is a git repository. Its copy on GitHub is `origin`, and `main` is the version that works. Every step that works gets a commit, so any mistake is one step to undo.

### Before you change anything
1. Run `git status`. If there are changes you didn't make, stop and ask me what to do with them. Never throw them away.
2. Get the latest: `git checkout main`, then `git pull`.
3. Make a branch for this task, named for it: `git checkout -b fix-contact-form`. Never work on `main` directly.

### While you work
4. Commit each step that works: `git add -A`, then `git commit -m "Add the phone number to the header"`. Say what changed in plain words, never just "update" or "fix".
5. One idea per commit, so a bad step can be undone on its own.
6. Before every commit, read `git diff --staged`. If it holds a password, API key, token or `.env` file, stop and tell me. Secrets live in `.env`, and `.env` stays in `.gitignore`.
7. Never commit a file over 50 MB (videos, zips, exports). Ask me where it goes.

### When the task works
8. Push the branch: `git push -u origin <branch>`.
9. Tell me in two lines what changed and the branch name, then ask before you merge.
10. When I say merge: `git checkout main`, `git pull`, `git merge <branch>`, `git push`, then `git branch -d <branch>`.

### Undo
When I say "undo that" or "go back", show me `git log --oneline -10`, ask which save point I mean, and undo with `git revert`, which keeps the history.

### Never, unless I ask for it in this chat
- `git push --force`, `git reset --hard`, `git clean`, `git restore`, `git checkout -- <file>`, or anything else that throws work away
- Deleting a branch that isn't merged
- Rewriting commits that are already on GitHub
- Making this repository public

## Publishing with RunCabin (delete this section if you host elsewhere)

This site is hosted on RunCabin through its MCP server, https://runcabin.com/mcp.

- RunCabin site id: (write it here after the first publish, and commit). Always publish to this id, so the address stays the same.
- Publish only when I ask, and only what is committed and pushed on `main`.
- To show me first, stage it with `cabin_deploy_preview`, and make it live with `cabin_promote` when I say so.
- After each publish or promote, tag the commit with its deployment and push the tag: `git tag deploy-<deploymentId>`, then `git push origin deploy-<deploymentId>`.
- If the live site breaks, put the last good version back first with `cabin_rollback` (pick it from `cabin_list_deployments`), then fix the mistake here and publish again.
- If the live site changed outside this repository (with `cabin_edit_site`, or from my phone), copy the changed files back with `cabin_get_site` and `cabin_get_file`, and commit them before you change anything else.

The last section is for a site you publish through RunCabin, covered below. If you host somewhere else, delete it and keep the rest. These are the same rules RunCabin's own agents work under: branch off main, commit each step that works, land it the same day.

What a normal task looks like now

You say: "Make the pricing section three columns."

  1. The agent runs git status, finds nothing stray, pulls main and makes a branch called pricing-three-columns.
  2. It changes the files and commits: "Pricing: three columns on desktop, one on phones".
  3. It pushes the branch and tells you it's done, on pricing-three-columns, and asks whether to merge.
  4. You look. If it's right, you say merge. If it's wrong, you say "undo that", and it reverts to the save point before.

If you'd rather review changes on GitHub, ask the agent to open a pull request (gh pr create) instead of merging. You read the changes on github.com and click Merge when you like what you see.

Put it online from the same chat

Git keeps every version of your code. RunCabin keeps every version of your live site, and your agent runs both from the same chat through RunCabin's MCP server.

Add RunCabin to your coding tool once. In Claude Code:

claude mcp add --transport http runcabin https://runcabin.com/mcp

Then run /mcp, pick runcabin, and sign in in the browser window that opens. There's no API key to paste. Cursor, VS Code, Windsurf, Codex CLI and Gemini CLI each take one line too: setup for every coding tool.

Then say "put it online". The agent publishes the site and hands you an HTTPS link on a free RunCabin address. From there:

One catch: if you or your phone's assistant change the live site directly, the live site and your repository disagree. The AGENTS.md tells the agent to copy those changes back and commit them before it starts anything new.

RunCabin hosts static sites: HTML, CSS, JavaScript and images, up to 200 files and 10 MB a version. If your project has a build step, the agent publishes the built folder. If your app needs its own server or database, host that part elsewhere; git works the same either way. The site is free on a RunCabin address for its first 90 days online, and $4.99 a month on your own domain, plus the domain. Part 2 walks through the first deploy, previews and rollback.

Questions

Do I need GitHub, or is git on my computer enough?

Git alone keeps the history on your computer, which covers undo. GitHub keeps a copy off your computer, so a dead laptop or a deleted folder costs you nothing, and you can pick the project up on another machine. Private repositories are free.

Will my coding agent use git without an AGENTS.md?

Sometimes. Agents know git, but left alone they use it unevenly: one session commits every step, the next edits main for an hour and saves nothing. An AGENTS.md at the root of the project makes the same rules apply on every task.

What if I already pushed an API key to GitHub?

Revoke the key with whoever issued it and make a new one. Deleting the file in a new commit doesn't remove the key, because it is still in the history. Then add the file to .gitignore so it can't happen again.

Does Claude Code read AGENTS.md?

Yes, when the project has no CLAUDE.md. If it has one, put the line @AGENTS.md at the top of CLAUDE.md and Claude Code loads both. Codex, Cursor, GitHub Copilot's coding agent, Windsurf and many others read AGENTS.md directly.

Does RunCabin replace GitHub?

No, they do different jobs. GitHub holds your code and its history. RunCabin hosts the live site and keeps every version you published, so you can roll the site back in seconds. Use both, and tag each commit with the RunCabin deployment it made so each live version points at its code.

Your agent wrote it. Let it put it online.

Add RunCabin to Claude Code, Cursor, Codex or any MCP client and say "put it online". Free on a RunCabin address for its first 90 days online, and $4.99 a month on your own domain.

Add RunCabin to your coding tool →

Rather have us build it? It's built with AI and finished by a web developer, for $29.99 a month with nothing up front. Start our planner


The series: part 1, source control and an AGENTS.md (this post) · part 2, deploy from Claude Code or Cursor with preview and undo. Related reading: is it safe to let an AI agent update your website? · what an AI agent can and can't do to your site · how to publish a website from Claude · a new way to host websites