What you need before you start

  • A Lovable project and a free GitHub account.
  • A coding agent. Claude Code comes with Claude's Pro and Max plans, and you sign in to it with your Claude account. Codex and Mistral Vibe work the same way for this guide.
  • Git installed on your computer, and about 30 minutes.

1. Connect your project to GitHub

In Lovable, open your project's settings, find the GitHub integration and connect your GitHub account. Then link the project. Lovable creates a new repository for it and starts syncing straight away.

One thing Lovable can't do: start from code you already have somewhere else. The repository has to be created from the Lovable project, not the other way round.

2. Understand how the sync behaves

The sync goes both ways. Every change you make in Lovable becomes a commit on your repository's default branch (usually main), and commits pushed to that branch show up back in Lovable.

That's useful, and it's also where people get hurt. If Lovable and your agent both edit main at the same time, you end up with two versions of the same file and a confusing history. The fix is simple: keep main for finished work, and give your agent its own branch.

3. Get the code on your computer

On your repository's page on GitHub, click Code and copy the address. Then, in a terminal:

git clone https://github.com/your-name/your-app.git
cd your-app
npm install
npm run dev

If the app talks to Supabase, Stripe or another service, it needs keys that are usually not in the repository. Look for a .env.example file or the README. If there isn't one, copy the values from each service's dashboard into a .env file. That file stays on your computer: check that .env is listed in .gitignore so it never ends up on GitHub.

4. Give your agent a branch and a clear request

Create a branch for the feature you want, then start your agent in the project folder:

git switch -c contact-form
claude

Write the request the way you'd brief a freelancer: what you want, and how you'll know it's done. For example: "Add a contact form with name, email and message. Done when submitting it sends me an email and shows a thank-you message. Don't change the database." The last sentence matters more than it looks. Agents tend to do a little extra, and saying what's off limits keeps the change small. Our guide on writing a request your coding agent will follow goes further.

5. Review, then merge

When the agent says it's finished, push the branch and open a pull request:

git push -u origin contact-form

GitHub shows a button to open the pull request. Go to the Files changed tab and read the list of files before anything else: it tells you quickly whether the agent stayed on task. We wrote a separate guide on what to look for in that list.

If it looks right, merge the pull request into main. A few moments later, the change appears in Lovable.

What changes once you've made the move

You now own a real history of your app: every change has a date, a description and a way back. You can keep using Lovable for the visual tweaks it's good at, and use your agent for the heavier work. And you can stop using Lovable entirely one day without losing anything, because the code lives in your repository.

The new job is keeping track of what the agent did. That part doesn't take long once it's a habit, and it's the habit that keeps a project you understand from turning into one you don't. Before your first real launch, go through our checklist for putting an AI-built app live.