> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Base Code

> Connect an existing GitHub repository and work on it with AI in Base Code.

[Base Code](https://base44.com/base-code) gives your team a shared cloud environment for an existing codebase without setting up a local development environment. Use the AI chat to make changes on branches, preview your work, and open pull requests for review. GitHub stays the source of truth.

![Base Code making a change from the AI chat on a working branch, with the project files and the Preview updating](https://mintcdn.com/base44/14mHcwtsjgXgI4LR/images/base-code-hero-animated.gif?s=e70877ead77d357b9f715e8ee11adb45)

Using Base Code

> [!TIP]
>
> **Before you begin:**
>
> * Your project must be a web or full-stack project in a GitHub repository. In a monorepo, the project at the root of the repository must qualify, and a mobile app in a subfolder is fine.
> * If you build your app in Base44, keep building it in the app editor and sync it with a repository using the [GitHub integration](https://docs.base44.com/developers/app-code/local-development/github.md).
> * You need an Editor role or higher in the workspace.
> * You need to connect a GitHub account during setup.

***

## Setting up Base Code

Connect a GitHub repository to make changes with the AI chat in Base Code. If your GitHub account is already connected, continue to [choosing a repository](#choosing-a-repository).

### Connecting your GitHub account

Base Code works directly in your GitHub repositories, so it needs access to the ones you want to work on. Your account also needs write access to each repository. Without it, the project shows a **Read only** badge. You can discuss the project in the AI chat and switch branches, but you can't make changes or create a branch.

**To connect your account:**

1. Go to [Base Code](https://app.base44.com/base-code).
2. Click **Connect GitHub**.
3. Sign in to GitHub if prompted, then authorize **Base44 Builder**.
4. Select the GitHub account or organization, then follow the prompts to install or configure **Base44 Builder** and give it repository access.

> [accordion] Fix a read-only project
>
> **To connect your GitHub account from a project:**
>
> 1. Open the project.
> 2. Click **Connect account** in the **Connect your GitHub account** banner.
> 3. Authorize **Base44 Builder** on GitHub.
>
> If you see **GitHub write access required**, your account is connected but doesn't have write access. Ask a repository admin to grant it, then click **Recheck permissions**.

### Choosing a repository

Pick the codebase you want to work on, from your own repositories or a copy of one you can't push to.

> [tab] From your account
>
> **To choose a repository from your account:**
>
> 1. Click **View more** in [Base Code](https://app.base44.com/base-code).
> 2. Select a repository.
> 3. Keep the selected **Branch** or select another.
> 4. Click **Connect**.

> [tab] Paste a link
>
> **To choose a repository by pasting a link:**
>
> 1. Click **View more** in [Base Code](https://app.base44.com/base-code).
> 2. Click **Paste a link**.
> 3. Paste the GitHub repository URL.
> 4. Continue based on your access:
>    * **You have write access:** Keep or change the selected **Branch**, then click **Connect**.
>    * **You don't have write access:** Under **Your copy on GitHub**, keep or change the suggested name. Select **Fork (public)** and click **Fork and connect**, or select **Private copy** and click **Copy and connect**. Your pull requests target your fork or copy, not the original repository.

> [!TIP]
>
> **Other ways to open a repository:**
>
> * **Open a listed repository:** Select it on the Base Code page, then click **Open in Base**. It opens on its default branch.
> * **Connect another repository:** Click the repository drop-down in the sidebar, then click **Add repository**. On mobile, the repository drop-down on the Base Code page calls it **Add new repository**. Both open **Connect your repository**.

If you connected the default branch, Base Code commits any required setup changes to a setup branch. The AI chat then asks whether to open a pull request targeting the branch you connected. If you connected another branch, the setup changes go straight to that branch. To build on setup changes that aren't merged yet, [start your branch from the setup branch](#creating-branches).

If you can't connect your repository, choose what applies:

> [accordion] Find a missing repository
>
> If your repository isn't listed in **Connect your repository**, give Base44 access to it on GitHub.
>
> **To update repository access:**
>
> 1. Give **Base44 Builder** access to the repository on GitHub.
> 2. Reopen **Connect your repository** in Base Code.

> [accordion] Connect a repository from an unapproved organization
>
> If you see "Your workspace's GitHub policy doesn't allow this import", or Base44 says your repository isn't in an approved GitHub organization, your workspace doesn't allow repositories from that organization. Ask someone who [manages your workspace's GitHub organizations](#managing-github-organizations) to connect the organization and mark it **Allowed**, then try again.
>
> If you only have read access, [connect a fork or private copy](#paste-a-link) instead. When your workspace limits repositories to approved organizations, you need write access to a repository in one of them.

***

## Working on your project

Use the AI chat to make changes to your connected repository and test them in a development preview. As you chat, Base Code commits and pushes your changes to your working branch on GitHub.

> [!NOTE]
>
> **How your project runs in Base Code:**
>
> * Base Code provides a development preview, not production hosting. To release your changes or connect a custom domain, use your project's existing deployment process and hosting provider.
> * Your project keeps its own database, authentication and routing. Connecting a repository doesn't add Base44 entities, login or the SDK. To add a database, authentication or CI/CD, ask the AI chat to add it with your project's own stack, and [add any connection strings or API keys as secrets](#adding-secrets).
> * When you come back to Base Code, your project environment starts back up. If it needs rebuilding, Base Code uses the latest commit on your GitHub branch, so ask the AI chat to confirm your latest changes are on that branch before you leave.

### Making your first change

When you first connect a repository, the AI chat gets your project running before you start a branch, and shows each setup step as it goes.

Base Code starts a new branch from your first request and names it for you, so your change stays separate until you open a pull request.

**To make your first change:**

1. Go to [Base Code](https://app.base44.com/base-code).

2. (Optional) Select the branch to start from in the drop-down next to **Create new branch from**.

3. Describe the change you want to make in the prompt box. For example:

   ```text theme={null}
   Add a dark mode toggle to the settings page,
   and remember the choice between visits.
   ```

4. Click **Create branch** to open the new branch and start making changes.

   ![The Base Code home screen with a dark mode request in the prompt box and Create branch outlined](https://mintcdn.com/base44/Los6Grrnm9gT0VmU/images/base-code-first-change-create-branch.png?fit=max\&auto=format\&n=Los6Grrnm9gT0VmU\&q=85\&s=cb0545d17de7a364a275ef7a6ec5fad4)

   Creating your first branch

5. Review the change in **Preview** once it appears, then ask the AI chat for any adjustments.

   On desktop, a new branch opens with the AI chat filling the editor, and the preview appears once there's a change to show.

> [!NOTE]
>
> If a setup step fails, click **Fix setup** to have the AI find the cause and fix it.

### Reviewing your changes

Check exactly what changed before you ask anyone to review it.

**To review your changes:**

1. Open the changes you want to check:
   * **One reply's changes:** Use the file list below that reply in the AI chat.
   * **Every change on the branch:** Click **Create PR** in your app editor, or click the PR number if one already exists.
2. Click a file name to see its diff, with the lines added and removed.

### Reverting a file

Undo the changes you don't want in a file, with the revert saved as a new commit on your branch.

> [!WARNING]
>
> Reverting a file undoes all its committed changes on the branch, not just the changes from one reply.

**To revert a file:**

1. Open your branch in Base Code.
2. Find the file below the AI chat reply, or in the branch's file list from **Create PR** or its PR number.
3. Click the file to expand it, then click **Revert file**.
4. Check that the right file appears in **Revert branch changes?**, then click **Revert**.

### Adding Google Drive files

Give the AI chat a brief, spec or design from your Google Drive when you start a branch.

**To start a branch from a Google Drive file:**

1. Go to [Base Code](https://app.base44.com/base-code).
2. Click the **Add** icon  in the prompt box.
3. Click **Upload from Google Drive**.
4. If prompted, click **Connect Google Drive**, then allow access in Google.
5. Select one or more files from My Drive or a shared drive. You can choose Google Docs, Sheets and Slides, Word, Excel and PowerPoint files, PDFs, images, and text, CSV, HTML, XML and JSON files.
6. (Optional) Describe the change you want to make in the prompt box.
7. Click **Create branch**.

### Stopping the AI

Stop the AI chat while it's working, then send a new message to change direction.

**To stop the AI:**

1. Click the **Stop generating** icon  in the prompt box.
2. (Optional) Send a new message with what you want instead.

> [!NOTE]
>
> Changes already committed to your branch stay. Edits the AI hadn't committed yet are discarded. If you stop branch creation from the start screen, Base Code restores your prompt in the prompt box. It also removes the new branch from Base Code.

### Choosing the AI model

Base Code uses **Auto** by default to choose an AI model for each request. You can [pick a model yourself](https://docs.base44.com/Building-your-app/AI-chat-modes.md#choosing-your-model) when you want more control.

**To choose an AI model:**

1. Open your branch in Base Code.
2. Click the model at the bottom of the AI chat.
3. Select the model you want to work with.

> [!TIP]
>
> When you choose a model yourself, you can also set its [effort level](https://docs.base44.com/Building-your-app/AI-chat-modes.md#setting-the-effort-level) from the effort button next to the model. This works in the prompt box on the Base Code start screen too, and the level you pick applies to the task you start.

### Using repository skills

Teach the AI chat your team's workflows with skills stored in your repository. Each skill has a name, a description and instructions. The AI chat reads a skill when it fits your request. Skills apply to everyone working on the project, on every branch.

Base Code finds skills in these places, at the root of your repository or in a subfolder:

* **Skill folders:** A `SKILL.md` file in a folder under `.agents/skills`, `.claude/skills` or `.codex/skills`.
* **Claude Code commands:** Markdown files in `.claude/commands`.
* **Local plugins:** Skills from Claude Code or Codex plugins stored in your repository.

**To manage repository skills:**

1. Click **Dashboard** in your app editor.
2. Click **Repository skills**.
3. Choose what you want to do:
   * **Read a skill:** Click the skill to see its instructions.
   * **Turn a skill on or off:** Click the switch next to the skill. Skills are on by default, and only the app owner can turn them on or off.
   * **Show a new skill:** After you add a `SKILL.md` file to your repository, click **Refresh**.

> [!TIP]
>
> **Good to know:**
>
> * **Use a skill right away:** Type `/` in the AI chat, then select the skill.
> * **Workspace and personal skills:** The AI chat uses these too. When one shares a name with a repository skill, the repository skill is used, unless you pick a skill in the chat.

### Previewing monorepo apps

When your repository has several apps, such as a website and an API, each running app gets its own tab above the preview. Choose which apps run on each branch.

**To choose the apps that run on a branch:**

1. Open your branch in Base Code.
2. Click the **Apps** icon in the toolbar above the preview, or click **Add app** at the end of the tab row.
3. Select each app you want running in **Apps to run on this branch**.
4. Click **Done**.

Base Code automatically selects any apps your chosen apps depend on. At least one app keeps running, and on main the main project always runs. When you create a branch, you can also choose its apps from **Run** in the prompt box.

**To show 2 apps side by side:**

1. Open your branch in Base Code.
2. Click **Split view** at the end of the tab row.
3. Click **Show** or **Start** next to the app for the empty side.

> [!TIP]
>
> **Working with split view:**
>
> * Split view is available on desktop.
> * Hover over the joined tab to **Swap sides** or **Separate into two tabs**.
> * Click **Exit split view** to go back to one app per tab.

### Expanding the chat

Hide the preview so the AI chat fills the editor, then bring the preview back when you want to check your work. The chat returns to its regular width when you switch between Preview, Dashboard and Code, or open a different file.

> [!NOTE]
>
> Expanding the chat is available on desktop.

**To expand or shrink the chat:**

1. Open your branch in Base Code.
2. Click the **Expand chat** icon  in the toolbar above the AI chat.
3. Click the **Shrink chat** icon  to show the preview again.

![The AI chat filling the Base Code editor with the preview hidden and Shrink chat outlined](https://mintcdn.com/base44/yvpgZEWKWgzyTbGG/images/base-code-expanded-chat-shrink.png?fit=max\&auto=format\&n=yvpgZEWKWgzyTbGG\&q=85\&s=941d905dc17c0bd65d8789e026f7d069)

The expanded AI chat

***

## Managing branches

Each branch has its own development environment in Base Code. You can open a pull request for its changes.

### Creating branches

Start each new change on its own branch, from your default branch or from another branch you're working on. Base Code names the branch for you.

**To create a branch from the sidebar:**

1. Click **New branch** in the sidebar.
2. Select the starting branch from the drop-down next to **Create new branch**.
3. Describe your change in the AI chat, then click **Create**.

![The Base Code editor with the starting-branch drop-down outlined next to Create new branch](https://mintcdn.com/base44/P5G-k6yhz4jlye0S/images/base-code-sidebar-new-branch.png?fit=max\&auto=format\&n=P5G-k6yhz4jlye0S\&q=85\&s=5d71d93f47e45ac9dae9928e5e3378ef)

Starting a branch from the sidebar

### Working from the sidebar

See where each of your branches stands and go straight to the one that needs you.

**Your branches** in the sidebar lists the branches you created. Merged branches move to **Merged** at the bottom of the list, so you can still read their chats.

Each branch has a status icon. Hover over it to see the label, with the pull request number when there is one.

| What the icon shows | When you see it |
| - | - |
| Needs you | **Conflicts**, **Failed checks**, or **Changes requested** |
| On hold | **CI running** or **Review pending** |
| Nothing blocking | **Open** or **Approved** |
| Done | **Merged** |
| Not in review yet | **Draft**: you haven't opened a pull request for this branch, or the one you opened is still a draft on GitHub |

While the AI is building, the icon is replaced by **Working**, and by **Merging** while a merge runs. A dot on the right of a branch means the AI finished there and you haven't opened it since.

**To open a branch:**

1. Click the branch under **Your branches**.

### Organizing your branches

Keep the branches you're focused on within reach and bring the ones that need you to the top.

![The Base Code sidebar with a pinned branch at the top of Your branches and an automatic Open PR group below it](https://mintcdn.com/base44/Los6Grrnm9gT0VmU/images/base-code-sidebar-pinned-and-group.png?fit=max\&auto=format\&n=Los6Grrnm9gT0VmU\&q=85\&s=1761c8763a3511e21065a5bfc91c51f7)

Pinned and grouped branches

**To pin a branch:**

1. Hover over the branch in the sidebar, then click its options icon .
2. Click **Pin**.

Pinned branches sit at the top of **Your branches**, above your groups. To unpin one, click **Unpin** in the same menu.

**To group branches:**

1. Click the **New group** icon next to **Your branches**.
2. Enter a **Group name**, then click **Create group**.
3. Drag a branch onto the group, or click the branch's options icon , click **Move to group**, then select the group.

You can also:

* **Take a branch out of a group:** Drag it onto **Your branches**, or click its options icon , click **Move to group**, then click **Ungrouped**.
* **Rename or delete a group:** Click the group's options icon , then click **Rename group** or **Delete group**. When you delete a group, you can [archive](#archiving-a-branch) its branches along with it.
* **Reorder your groups:** Drag a group up or down the list.

The rest of your branches are grouped and sorted automatically. By default, they're grouped by status, with the branches that need you first, then open pull requests and drafts, and the newest branch at the top of each group.

**To group and sort branches:**

1. Click the **Sort branches** icon next to **Your branches**.
2. Select **Status**, **Last activity** or **None** under **Group by**.
3. Select **Date created** or **Name** under **Sort by**.

### Archiving a branch

Archive the branches you're not working on to keep your list short. An archived branch moves to **Archived** at the bottom of **Your branches**, out of its pin or group. Archiving only changes your own sidebar, and the branch, its chat and its GitHub branch stay as they are.

**To archive a branch:**

1. Hover over the branch in the sidebar, then click its options icon .
2. Click **Archive**.

> [!TIP]
>
> **Bringing a branch back:** Open the archived group, click the branch's options icon , then click **Unarchive**. The branch returns to your list, without its old pin or group.

### Removing a branch

Clear out branches you're done with. To keep a branch without it crowding your list, [archive it](#archiving-a-branch) instead.

**To remove a branch:**

1. Hover over the branch in the sidebar, then click its options icon .
2. Click **Remove branch**.
3. Confirm in the dialog:
   * **Remove:** Shown for a merged branch, or for a branch your teammates are also on. The branch leaves your list, and nothing is deleted. Your teammates keep it and its chat, and you can bring back a branch that isn't merged by sending a prompt on it again.
   * **Delete branch:** Shown for a branch that isn't merged and that no one else is on. The branch and its chat are deleted from Base Code for good. The branch and its commits stay on GitHub.

***

## Working with pull requests

Get your changes reviewed and merged through pull requests on GitHub.

Base Code always uses your own GitHub connection, whatever your workspace sets for its other apps. Your GitHub account needs to be connected and have write access to the repository. Base44 opens pull requests from your account. Each commit from the AI chat lists you as the author and `base44-builder[bot]` as co-author.

### Opening a pull request

After testing your changes, open a pull request for review.

Your pull request targets the branch your working branch was created from. The AI chat writes the title and description from your conversation and committed changes. After you open it, new changes on your working branch are added to it, and GitHub runs your repository's configured checks. Merge it on GitHub, or ask the AI chat to merge it.

**To open a pull request from your app editor:**

1. Open your branch in Base Code.
2. Click **Create PR** in your app editor.
3. Review the changed files in **Create pull request**.
4. Click **Continue in builder**.
5. Review and send the prefilled message in the AI chat.

> [!TIP]
>
> **If Base44 can't open your pull request:** Click **Review permissions on GitHub** when prompted. An owner of the GitHub account or organization that owns the repository needs to approve the access, then you can try again.

### Tracking your work

See where each of your tasks stands, from the changes Base Code is still making to the pull requests that are going live.

**Your work** on the Base Code start screen sorts your tasks into columns:

* **Base Code is working:** The AI is still making changes.
* **Needs you:** Base Code has a question, or the pull request has conflicts, failed checks or requested changes.
* **Ready for review:** The work is finished and nothing is blocking it.
* **Done:** Merged, answered and archived tasks.

**To track your work:**

1. Go to [Base Code](https://app.base44.com/base-code).
2. Under **Your work**, choose what you want to do:
   * **Open a task:** Click it to open its branch.
   * **Take the next step:** Click the action on a task, such as **Fix conflicts** or **Merge**.
   * **Find a task:** Search by its title in **Search your work**.
   * **Filter your tasks:** Use the filters for type, status and time. For example, filter by **Has a question** or **Failed checks**.
   * **Sort your tasks:** Select **Last updated** or **Date created**.
   * **See every pull request:** Click **See all pull requests** to open your repository's pull requests on GitHub.

### Resolving branch conflicts

If your pull request has conflicts, the AI chat can resolve them for you. Resolving conflicts merges the pull request's base branch into your working branch.

**To resolve conflicts:**

1. Open your branch in Base Code.
2. Click **Resolve conflicts** above the prompt box.
3. Review and test the changes the AI makes, especially where both branches changed the same feature.

### Answering review comments

Ask the AI chat to address the unresolved review threads on your pull request. It replies to each thread with what it changed. After pushing its changes, it resolves the threads it fixed.

**To answer review comments:**

1. Open your branch in Base Code.

2. Ask the AI chat to fix the comments on your pull request. For example:

   ```text theme={null}
   Fix the review comments on this pull request.
   ```

3. Review the changes and replies the AI chat reports.

> [!TIP]
>
> **Good to know:**
>
> * **Threads that need you:** When the AI doesn't make a change, or needs your decision, it replies on the thread with the reason, leaves the thread open and tells you which ones.
> * **Checking replies first:** Ask the AI chat to draft replies to your comments. It posts them only when you tell it to.

### Collaborating with teammates

Your team can contribute to the same project and review each other's changes through pull requests.

> [!NOTE]
>
> If a Base Code project is set to let [workspace members](https://docs.base44.com/Setting-up-your-app/Managing-access.md#choosing-who-can-collaborate) collaborate, anyone in your workspace can open it in the app editor and join without a separate invitation. Workspace guests still need an invite. To invite someone outside your workspace, [add them as a collaborator](https://docs.base44.com/Setting-up-your-app/Managing-access.md#working-with-collaborators) from the app editor.

***

## Adding secrets

Give your project the API keys and other credentials it needs without putting them in your repository.

The AI chat prompts you when a secret is required. Secrets are encrypted, shared across branches and kept when your environment rebuilds.

Changes and removals apply automatically to running branches. Inactive branches pick them up when you next open them.

**To add a secret:**

1. Click **Dashboard** in your app editor.
2. Click **Secrets**.
3. Click **Add Secret**.
4. Enter the **Secret Name** and **Secret Value**, then click **Add Secret**.

> [!TIP]
>
> **Adding secrets in bulk:** Click **Import .env**, then upload or paste your file. Each `KEY=VALUE` line becomes a secret. An existing secret with the same name is overwritten.

***

## Managing GitHub organizations

Connected organizations belong to your workspace, so apps keep syncing even if the person who connected one leaves. Anyone in the workspace can use an organization that's already connected. The **Choose how your team writes to GitHub** setting on this page doesn't apply to Base Code apps, which always use per-user connections.

**To add a GitHub organization:**

1. Go to your workspace settings.
2. Click **GitHub** under **Build tools**.
3. Click **Add organization** under **Connected organizations**.
4. Sign in to GitHub if prompted, then authorize **Base44 Builder**.
5. Choose the account or organization, then install **Base44 Builder**.

**To manage GitHub organizations:**

1. Go to your workspace settings.
2. Click **GitHub** under **Build tools**.
3. Choose what you want to do:
   * **Filter organizations:** Use the filter in **Connected organizations** to show **All**, **Active**, or **Disconnected** organizations.
   * **Make an organization available for new apps:** Owners and admins can use **Allowed** to control which organizations are available. Changing **Allowed** doesn't affect apps already using that organization.
   * **Disconnect an organization:** Click the **Actions** icon next to the organization, click **Disconnect organization**, then click **Disconnect**. Apps tied to that organization's workspace connection stop syncing with GitHub, and the confirmation lists them. **Base44 Builder** stays installed on GitHub, so you can reconnect the organization later.

> [!NOTE]
>
> You need a [**Builder plan**](https://base44.com/pricing) or higher to manage GitHub organizations. On an Enterprise plan (Business or Enterprise), owners and admins can also choose who can add organizations under **Who can connect organizations**. Otherwise, only owners and admins can add one.

***

## FAQs

> [accordion] Where can I learn about privacy and data use?
>
> Base44's [Privacy Policy](https://base44.com/privacy-policy) explains how personal information is collected and used. [Privacy and security](https://docs.base44.com/Community-and-support/Privacy-and-security.md) covers AI model training and your data controls.

> [accordion] How do I apply a coupon code?
>
> You can apply a coupon before or after connecting a repository.
>
> Each coupon code applies to up to 10 people in your workspace.
>
> **To apply a coupon:**
>
> 1. Go to [Base Code](https://app.base44.com/base-code).
> 2. Enter your coupon code:
>    * **Before connecting a repository:** Click **Have a coupon?** at the top right, then enter your code in the dialog.
>    * **After connecting a repository:** Enter your code in the field under **Have a coupon?**.
> 3. Click **Apply**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.