Lovable’s docs say your code is yours to host wherever you choose, and moving from Lovable to Claude Code shows it: clone the GitHub repository Lovable syncs to and open it. What moves is the editor. Lovable’s hosting, your custom domain and the Lovable Cloud backend keep running, and Cloud keeps using credits, until you move each on purpose.
Lovable to Claude Code: what moves and what stays put
A switch from Lovable to Claude Code replaces one of a Lovable app’s five parts: the editor and its AI agent. The code sits in the GitHub repository Lovable syncs to once Git sync is on, and the hosting, the custom domain and the Lovable Cloud backend stay with Lovable until each is moved on its own.
The five parts are our own split of the three that Lovable’s ownership docs name (code, frontend, and backend and data), plus the editor and agent, which the same page says “cannot be self-hosted or deployed inside a customer VPC”. The right-hand columns use Anthropic’s Claude Code overview, which describes “an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools” and documents no hosting, domain or database service for the app you are working on.
| Part of a Lovable app | What Lovable was doing | Does Claude Code replace it | What still has to happen |
|---|---|---|---|
| The code | Keeping it in the project and syncing it to your GitHub repository | No | Turn on Git sync if it is off; Claude Code then opens that repository |
| The hosting | Serving the app on Lovable hosting | No | Lovable keeps serving it until you deploy it somewhere else |
| The custom domain | Production hosting with custom domains and automatic SSL | No | It keeps pointing at Lovable’s hosting until you repoint it |
| The Cloud backend | Running the managed backend, databases and infrastructure | No | It keeps running, and keeps using workspace credits, until it is migrated on its own |
| The editor and AI agent | Running the AI agent and visual editor that change the code | Yes | Claude Code reads the codebase, edits files and runs commands on your machine |
A plan to migrate from Lovable to Claude Code can mean two different jobs: changing the tool that writes the code, or changing where the finished app runs. Claude Code does the first and none of the second. The second is two moves of its own, moving the backend off Lovable Cloud and deploying a Lovable app to Vercel or another host, and Lovable’s docs say you can keep building in Lovable while another host serves the app.
Claude or Lovable: which one edits what
The two tools do different jobs on the same app. Lovable is a managed service with an AI agent, a visual editor and preview environments; Claude Code is an agent that works in your terminal, IDE, desktop app or browser on the repository itself. We’d split the work this way: visual changes in Lovable’s editor, anything that touches data, payments or sign-in in the terminal, and never both tools on the same branch in the same week.
Why it matters for a live app
Claude Code changes files and runs shell commands inside your repository, so your app gains a second agent with write access, and the only history it has of why the code looks the way it does is what the repository and a CLAUDE.md tell it. From Claude Code v2.1.283, auto mode is the built-in starting mode for interactive terminal sessions, where “a classifier reviews actions instead of you, and Claude edits most files and runs most commands without asking you.” Before you keep that default, read what Claude Code can reach before it asks.
At least 17 of the 21 third-party apps we audited had no deploy gate: every push ships straight to production with nothing checking it first. Those audits ran in June and July 2026 on the 21 apps chosen for review, not drawn at random, so the count describes that group and not Lovable apps in general.
That gap is where an agent’s mistakes land. Future AI-assisted changes can undo hardening unless the workflow checks them, and automated checks catch regressions before changes reach customers. The same holds for the wider set of code health controls for AI-assisted teams once an agent writes most of the code.
Railway, the hosting platform, put one version of this on record in its changelog on May 1, 2026. It made API volume deletes undoable for 48 hours after “seeing an AI agent deleting a production database using a long-lived account-scoped token it found on a developer’s machine”; until then, its volumeDelete call “removed volumes immediately, with no recovery path.” The lesson we take from it: the safeguard has to sit outside the agent, in a check or a platform rule that holds whatever the agent was told.
How it works: day one, and running both tools on one branch
Everything in this section comes from Anthropic’s and Lovable’s documentation, read on October 5, 2026; we did not run a migration to write it.
Day one: how to switch to Claude Code before the first prompt
The usual way to export a Lovable project to Claude Code is a git clone of the repository Lovable syncs to, not a download; Lovable creates that repository private by default on every plan. The download route has its own page: what a Lovable code export contains.
- 01 Clone the GitHub repository Lovable syncs to (connect Git sync first if the project has none), so the project exists as files on your machine.
- 02 Install Claude Code with the install command the quickstart gives for your system, then confirm the version.
- 03 Log in with an account type Anthropic lists: a Claude Pro, Max, Team or Enterprise plan, a Claude Console account, or an enterprise cloud provider. A Lovable plan pays for none of it.
- 04 Change into the project folder and start a session with the claude command.
- 05 Run /init, so Claude Code writes a starting CLAUDE.md from the build commands, test instructions and conventions it finds in the code.
Step four is two commands:
cd /path/to/your/project
claude
The version check in step two is claude --version, which prints a version number followed by “(Claude Code)”. Claude Code’s quickstart has the install commands for macOS, Linux, WSL and Windows, and Claude Code pricing and its limits covers which plan fits how much you will use it.
Claude Code’s memory docs put a project CLAUDE.md at ./CLAUDE.md or ./.claude/CLAUDE.md, and if one already exists, /init suggests improvements instead of overwriting it. Check three lines in it yourself; /init writes what it finds in the code, and these three decide what an agent does next:
- Which stack this is: Lovable apps created from May 13, 2026 (June 22, 2026 for Enterprise workspaces) use TanStack Start, and older apps use React and Vite.
- That the backend still runs on Lovable Cloud, if the app uses it, so a schema or sign-in change reaches a service Lovable runs, not only files in the repository.
- The build command that has to pass before any change counts as done.
Anthropic’s guidance is to keep each CLAUDE.md under 200 lines, and the same page says Claude treats the file “as context, not enforced configuration”. So a rule written there needs a check behind it, and guardrails for AI coding agents covers what else belongs in the file. One more day-one fact: Lovable’s docs say environment variables prefixed with VITE_ “are embedded at build time, not runtime”, so pointing the app at a different backend means a rebuild, not a settings change, and the same guide says to run the app on your own computer from a clone before you deploy it anywhere.
One branch, two agents: Lovable’s two-way sync
Lovable’s GitHub integration docs describe sync in both directions: changes made in Lovable sync to GitHub, changes pushed to the active branch sync back into Lovable, and “Lovable only edits and syncs one branch at a time”, by default the repository’s default branch (usually main).
That rule decides how to use Lovable with Claude Code together without either one undoing the other. A branch you work on in Claude Code stays invisible to Lovable until you merge it into the synced branch or switch Lovable’s branch picker to it, and whatever you merge there is what Lovable’s agent edits next. Both tools write to that one branch, so pick which of them is the source of truth for a given week. That advice is ours; Lovable’s docs describe only the mechanism.
Two edges of the sync matter here. If Lovable and GitHub have diverged, a push from GitHub replaces Lovable’s version of the branch, “and the project no longer contains edits made only in Lovable.” Deleting the GitHub repository stops the sync; renaming the repository, your account or your organization keeps it running, and a transfer keeps it running only when your Lovable workspace has a GitHub connection for the new owner.
Lovable MCP and Claude: connecting Claude Code to a Lovable project
Lovable’s MCP server connects Claude Code to your Lovable account without moving anything: one command adds it, a browser login signs you in, and Claude Code can then create projects, send messages to Lovable’s agent and inspect code. Two kinds of call spend Lovable credits, and one tool runs SQL with your full database permissions.
So to connect Claude Code to Lovable there are two routes: the sync above, or this server. Lovable’s MCP server docs put it at https://mcp.lovable.dev and give setup steps for ChatGPT, Claude (Claude Desktop and claude.ai), Claude Code, Cursor and VS Code; other clients can connect if they support OAuth. The Claude Code command, as the docs print it:
claude mcp add --transport http lovable "https://mcp.lovable.dev"
Paste it as printed, --transport http included: the docs show the URL with no query string and say nothing about a ?src=settings suffix. The first time a Lovable tool runs, Claude Code opens a browser window to log in to Lovable; /mcp then lists the lovable server. The server is available on all plans, enabled by default on Free, Pro and Business workspaces and disabled by default on Enterprise, where a workspace admin or owner can turn it on.
Read the costs before the login window opens. Lovable’s FAQ says “Standard Lovable credits apply to create_project and send_message calls. Other tools are free.” Access is wider than one project: “Scope is your full account, not one project”, and query_database “runs SQL with your full database permissions. Read, write, and schema changes.”
Because the server inherits your Lovable permissions exactly, connect it from a Lovable account that reaches only the projects and data the job needs, never from an owner account sitting on production data when a narrower one would do. How Claude Code itself scopes a server, and which tools you can switch off, is under MCP scopes and permissions in Claude Code.
How to check the setup holds
A Lovable app edited in Claude Code holds up when three things are true and shown: a pull request with a failing check cannot merge, a change that breaks a written rule fails in CI, and a fresh clone deploys with no step that needs Lovable.
Each check below can fail, and each leaves evidence to keep.
- 01 Open a pull request whose build fails and confirm it cannot merge, then open one that passes, and keep both CI results.
- 02 Ask Claude Code for a change that breaks a rule written in CLAUDE.md, such as editing a folder the file marks as protected, and confirm a CI check fails it.
- 03 Clone the repository fresh and deploy it to a staging copy with no step that needs Lovable.
- 04 After a week of running both tools, list who merged what into the synced branch.
The first check needs a required status check on the branch. GitHub offers protected branches on private repositories only with GitHub Pro, Team or Enterprise plans, and on public ones with Free, so on GitHub Free a private Lovable repository cannot block that merge, and check one fails. Once the synced branch is protected, GitHub can reject Lovable’s own pushes to it, and Lovable then pushes them to a branch named lovable-sync for you to review and merge. For the fourth check, Lovable’s commits show the lovable-dev[bot] author on GitHub, while raw git log prints an older name for the same account, gpt-engineer-app[bot]. The pipeline behind checks one to three is set out in CI CD best practices for one repo.
Checks like these are how the Production Hardening Sprint verifies three of its deliverables. Deliverable 7.3, pull-request CI, is verified by submitting failing and passing changes and retaining the CI results. Deliverable 10.8, AI repository guardrails, is verified by reviewing the guidance and demonstrating CI catching a representative forbidden regression; deliverable 7.11, independent repository and hosting, by deploying a fresh clone to staging through the pipeline with no step that depends on the generating tool.
Where the sprint does this
If the switch to Claude Code comes just before a launch, an investor review or a client handover, and the app has no checks yet, start with a free audit: a video call where we go over your setup with you and weigh up which checks matter first. The work itself is our Production Hardening Sprint, which makes a working Lovable app production ready through the published 123-point scope. That scope covers linting, type checks, builds and tests on every pull request (7.3); provides CLAUDE.md, AGENTS.md, Cursor rules or equivalents describing conventions and protected patterns, with CI checks for the enforceable rules (10.8); and keeps the app in a repository and on a hosting account you control, deployable through a documented pipeline, independent of the tool that generated it (7.11). At handover you receive guidance and automated checks for future AI-assisted changes. Your app’s current framework and hosting setup are our starting point .
Common questions about Claude Code for Lovable users
Can I use a Claude code just like a Claude chat?
Yes for the conversation: you type questions and requests the same way. The difference is that Claude Code works inside your project folder and can change files and run commands there; from v2.1.283, its interactive terminal sessions start in auto mode, where a classifier reviews actions instead of you and most edits go ahead without asking, unless your settings pick another mode.
Is it better to use a Claude code or chat?
For an app that lives in a repository, Claude Code is better, because it understands the entire codebase and can change it; for a question that touches no files, chat is enough. On Pro and Max plans one subscription covers both, and their usage limits are shared.
Can I transfer my Claude chat to Claude code?
Not directly: Anthropic’s Claude Code docs describe moving Claude Code sessions between the terminal, the desktop app and the web, but not importing a claude.ai chat (checked October 5, 2026). Write the decisions worth keeping into the project’s CLAUDE.md instead, since Claude Code loads it at the start of every session.
What is the best terminal to use for Claude code?
Any terminal you already use works, and Anthropic’s docs name no single best one. Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal and Windows Terminal handle Shift+Enter for a new line with no setup, while VS Code, Cursor and Zed need one /terminal-setup run. If you would rather not work in a terminal at all, the IDE extensions and the desktop app connect to the same underlying Claude Code engine.
Moving your live app's work into Claude Code?
Changing editors is the easy part; hosting, the backend and your users stay on the old setup until you move each one on purpose. In an audit, we talk through the switch with you and your team and point out what could break the live app. You leave knowing which safeguards to put in place first.
Book a free audit →
Free · 30 minutes · No code access needed