If you want Claude to edit code, run commands, and open pull requests in your repository, see Claude Code.
Add repository content
You can add repository content to a single conversation, or to a project, a workspace in Claude where a set of chats share the same background documents. Choose the tab below for where you want the content available.- In a chat
- In a project
In a chat, the Add from GitHub option appears only after your GitHub account is connected to Claude. To connect your GitHub account, follow these steps:
- Go to Customize > Connectors.
- Select GitHub Integration.
- Select Connect.
1
Open the add menu
In the conversation, select + at the lower left of the message box.
2
Choose GitHub
Select Add from GitHub.
3
Pick a repository
Search the repositories you have access to, or paste a repository URL.
4
Add the repository
Select Add repository. Claude adds the repository’s URL to your message.
5
Send your message
Send your question.
Grant Claude access to a private repository
When you pick a private repository that Claude doesn’t have access to yet, or paste its URL, the Add content from GitHub dialog shows Claude cannot access that resource. If you know that it exists, you may first need to grant or request access here. The here link in that message opens the Claude GitHub App installation page on GitHub, where you have two options:- Grant access yourself: allow Claude access to all of your repositories or only to specific ones
- Request access: for a repository owned by a GitHub organization you don’t administer, ask for access. The organization’s administrators receive an email notification from GitHub.
Try the connector
After you add repository content, ask Claude something that depends on the code you added. For example, ask Claude:- Explain how request authentication works in this repository
- Where is the retry logic, and what happens when it gives up?
Keep repository content current
After you add a repository to a project, use these controls in your project knowledge to keep its content current:- Sync: select Sync now on the repository in your project knowledge to fetch the latest changes, especially before a new analysis or after major changes to the repository
- Multiple repositories: you can add several repositories for broader context, as long as the selected content fits within Claude’s context window
- Lost access: if you lose access to a repository, you can no longer view its contents in projects where it was added. The repository preview is removed, but your conversation history remains
Change which files Claude reads in a project
You can change which files and folders Claude reads from a repository you already added to a project.- Open the project.
- In your project knowledge, select the repository.
- Select the files and folders you want Claude to read.
- Select Update.
Review what Claude retrieves from GitHub
The table lists what the integration reads from a repository and what it leaves out.Best practices
These habits help when you add repository content to a project:- Start small: begin with a small subset of the codebase to see how Claude interprets your code
- Select files thoughtfully: include the files central to your task while staying within token limits
- Iterate and refine: ask follow-up questions when an initial response needs clarification
- Combine with human expertise: treat Claude’s analysis as a starting point for team discussion
- Sync regularly: refresh the GitHub sync periodically, especially before a new analysis or after major repository changes
Troubleshooting
The GitHub integration is built into Claude and managed from Customize > Connectors, where it’s listed as GitHub Integration under Your connectors whether or not you’ve connected it.Add from GitHub doesn’t appear in a chat
The + menu in a chat shows Add from GitHub only after your GitHub account is connected to Claude. Go to Customize > Connectors, select GitHub Integration under Your connectors, and select the Connect button. Then open the + menu in the chat again. On Team and Enterprise plans, GitHub Integration appears in Customize > Connectors only while GitHub is turned on for your organization. If it isn’t listed there, ask someone who manages your organization’s settings to turn it on in Organization settings > Connectors.Claude cannot access that resource
Claude couldn’t reach the repository you picked or pasted. If the repository exists, it’s most likely private and Claude doesn’t have access to it yet. Follow Grant Claude access to a private repository, then pick the repository again.Next steps
- Get started with connectors: set up another connector and use it in conversations
- Connectors directory: browse verified and community integrations