---
title: Attach a repository to a thread
type: how-to
section: ai-studio
summary: Attach up to five GitHub repositories to a thread so the model reads their file listing and README as reference on every message.
applies_to:
  clients: [web]
sources:
  - evolve-front-end/app/[lng]/studio/components/AddRepository/AddRepositoryDialog.tsx
  - evolve-front-end/app/[lng]/studio/components/Chat/ThreadRepositoryAttachments.tsx
  - evolve-front-end/app/[lng]/studio/components/Chat/ThreadRepositoryAttachmentsPanel.tsx
  - evolve-front-end/app/[lng]/studio/components/Chat/ThreadRepositoryAttachmentsHeader.tsx
  - evolve-front-end/lib/studio/thread-repository-attachments.ts
  - evolve-front-end/app/i18n/locales/en/agents.json
  - evolve-front-end/app/i18n/locales/en/powerflow.json
verified:
  at: 2026-09-04
  env: code
  by: content-lane-ai-studio
ttl_days: 45
related: [ai-studio/attach-files-to-a-message, ai-studio/github-link-cards, ai-studio/run-an-agent]
---

Select the plus button next to the message box, choose **Add repository**, then pick a GitHub connection, a repository, and a branch. The model reads that repository as reference on every message in the thread.

You need a GitHub account connected to your Evolve profile first. Without one the picker shows **You haven't connected GitHub yet.** and a link, **Connect GitHub on your profile**.

## Attach a repository

1. Select the plus button next to the message box, then **Add repository**.
2. Choose a connection. The one marked **Default** is used unless you pick another. Select **Next**.
3. Find the repository. Type in **Search repositories** to narrow the list; each row shows **Private** or **Public**. Select **Next**.
4. Choose a **Branch**. The repository's default branch is pre-selected.
5. To limit the model to one folder, type it into **Path (optional)**.
6. Select **Add**.

The repository appears as a chip labelled `owner/repo@branch`, with **via** and the connection name below it. The same chips show under the thread title.

A thread carries up to five repositories. Past that, adding one is refused with a message giving the limit.

## What the model receives

On every message, each active repository contributes the top-level file listing and the README, both trimmed to a fixed size. The model gets this as read-only reference alongside your message. Nothing is written into the thread's history, and nobody else sees it.

Attaching a repository before you send the first message holds it locally; the chip reads **Saved with your first message** until the thread exists.

## Remove a repository

Select the remove control on the chip. If the underlying access grant survives, a warning appears: **Repository removed. Its access grant could not be revoked; revoke it under Connected accounts.** Follow it in your profile.

## A chip with a warning icon

These chips carry a note, **Not sent to the model.**, and the repository contributes nothing until you fix the cause.

- **Connection removed** — the GitHub connection is gone. Connect GitHub again, then re-attach.
- **Access revoked** — the grant for this repository was withdrawn. Re-attach it.
- **Not verified** — the repository could not be checked. Remove it and add it again.

## If it did not work

- **Add repository** is not in the menu: the repository surface is off for your environment, or your GitHub connection is not usable. Check your connected accounts in your profile.
- **Couldn't load GitHub connections.** or **Couldn't load repositories.**: close the window and open it again.
- **Couldn't add this repository.**: check that the connection is active and that you still have access to the repository on GitHub.
- The model answers as if it cannot see the code: it receives a file listing and the README, not the whole repository. Paste the specific file, or see [Attach files to a message](/help/ai-studio/attach-files-to-a-message).
