# Import from GitHub

Source: https://modulify.ai/docs/build/import-from-github

Bring a repository in as reference material for the AI to build from.

**Import from GitHub** reads a repository's files and hands them to the AI as reference for whatever you ask it to build next. It is not a migration and not a sync. Nothing is copied into your site automatically, editing the source repository afterward does not change your project, and Modulify never writes back to it.

## Where to find it

**Import from GitHub** sits in the **+** menu next to the chat box, both on the prompt that starts a new site and inside an already open project's chat.

## Pick a repository

:::steps
### Open the import dialog

Click **+**, then **Import from GitHub**. The dialog reads `Pick a repository connected to Modulify. We read its files and use them as reference for whatever you ask us to build.`

### Point it at a repository

Pick one from the **Repository** dropdown, or use **Or paste a public repository URL** to import any public repository by address, no connection required.

With no GitHub account connected yet, the dropdown is replaced by **No GitHub accounts**, `Connect a GitHub account to import repositories.`, and a **Connect GitHub account** button.

### Confirm you have the rights to use it

Check **I own this repository, or I have permission to use its content**, then **Confirm**.
::::

Starting a new site, the confirmed repository shows as a pill above the prompt box, which you can still edit or remove until you send the message that creates the site. Inside an existing project's chat, it is attached immediately with a **Repository imported** toast, `Mention it in your next message and the AI will read it.`

## Not every repository can be picked from the list

Pasting a public repository's URL works for anyone, on any plan.

Picking a repository from the dropdown needs its GitHub account connected to your workspace first, and connecting a new GitHub account requires a paid plan. Only accounts that are connected and verified show up. See [Plans](/docs/plans/plans) and [Move your code to GitHub](/docs/editor/move-code-to-github) for connecting and verifying an account. On the Free plan, paste the repository's public URL instead.

:::note
A private repository can be read only through a GitHub account that is connected and verified in the same workspace as the site. That applies both to picking it from the list and to pasting its URL. Anything else, including a private repository of an account connected to a different workspace, answers `That repository could not be read!`, exactly as for a repository that does not exist.
:::

The repository is read with the access of the workspace the site is in now, so after a site moves to another workspace a private repository is read only if that workspace has its account connected.

## If GitHub cannot be reached

When GitHub does not answer, the check stops with `GitHub could not be reached, so that repository was not checked. Try again in a moment!` Nothing is attached, so try again once GitHub responds.

Inside a project, a repository that could not be read because GitHub was unreachable is not marked as read. It is read again with the next message you send.

## What gets read

Only files that look like source, not binaries. Images, fonts, lockfiles, and anything inside `node_modules`, `.git`, `dist`, `build`, `.next`, `.turbo`, `.vercel`, `coverage`, `out`, `vendor` or `.cache` are skipped.

A read is capped at 40 files and 200KB combined, and a single file over 40KB is skipped. A repository past those limits is read partially rather than refused.

## It can look at more than the first read

That cap only limits what lands automatically in the message right after the import. Beyond that, the AI can look further into the repository itself, listing its full file tree or reading a specific file it did not already get, whenever it decides it needs to. You do not have to reattach the repository for this, just ask for whatever you need and it goes and reads it.

## Reattach if it forgets

The repository is read once, for the message that follows the import. If a long conversation later gets summarized and the AI no longer seems to remember it, open **+**, **Import from GitHub**, and pick the same repository again. It gets read again for your next message.

## Next

- [Attachments and context](/docs/build/attachments) covers files, images and page references.
- [Move your code to GitHub](/docs/editor/move-code-to-github) is the opposite direction: sending your site's own code out to your GitHub.