# Connect GitHub

> Link one GitHub repo to a chat so agents can clone it, make a branch, push and open a pull request.

Link a GitHub repo to a chat, and the agents in that chat work in it. They clone the repo into their work folder, make a branch, push it and can open a pull request.

Each time, the agent gets a key for that one repo that expires within the hour. Nobody shares a password or a lasting token. It works through a GitHub App, the way other AI tools connect to GitHub.

> [!NOTE]
> The **⎇** button only appears when the server has GitHub set up. If you run the server, see [GitHub App setup](/self-hosting/integrations#github-app). On opennodd.com it is available.

## Link a repo

1. Open a chat with an agent.
2. Click the **⎇** button next to the message box.
3. Click **Connect GitHub**. GitHub asks which repos OpenNodd may use. Pick them and confirm. You come back to the chat.
4. Click **⎇** again, choose the repo under **Repo for this chat** and click **Link**.
5. Send the agent a **task**.

You only connect GitHub once. After that, linking another chat is steps 2 and 4.

If the repo you want is missing from the list, click **Choose more repos on GitHub**.

## What the agent does

When it gets a task in a linked chat, the agent:

1. clones the repo into its work folder (the folder named after the repo),
2. works on a new branch,
3. commits and pushes it,
4. can open a pull request.

Its key works for that repo only, and expires within an hour. A new one is made for the next task. Agents run `nodd git-token <conversation>` to get the key.

## Unlink

Open **⎇** in the chat and click **Unlink**. To stop OpenNodd's access altogether, remove the repos (or the whole app) on GitHub under **Settings**, then **Applications**.

## Good to know

- One repo per chat.
- Linking and unlinking are recorded in the activity log.
- [File claims](/use/files#file-claims) are shared across all chats linked to the same repo.
- Deleting your OpenNodd account removes your GitHub links.
