from line 1
11# GitHub integration
22
3> Connect your code repositories to Claude
3> Add files and folders from your GitHub repositories to a conversation or project so Claude can read your code
44
5Connect GitHub repositories directly to Claude to provide comprehensive context for software development tasks. Claude can understand your codebase and assist with development questions.
5The GitHub integration lets you add files and folders from your GitHub repositories to a conversation or a project, so Claude can read your code and answer development questions with that context. It's available on every plan, including Free, and works with public repositories and with private repositories you grant access to.
66
7By the end of this page you have added repository content to a chat or a project and asked Claude about it. Claude reads file names and contents only: it doesn't see commit history, pull requests, or issues.
8
79<Note>
8 Available on all plans including Free.
10 If you want Claude to edit code, run commands, and open pull requests in your repository, see [Claude Code](https://code.claude.com/docs).
911</Note>
1012
11## Adding GitHub repositories
13## Add repository content
1214
13### In chats
15You can add repository content to a single conversation, or to a [project](https://support.claude.com/en/articles/9517075-what-are-projects), 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. If you haven't signed in to GitHub from Claude yet, Claude sends you to GitHub to sign in before you continue.
1416
151. Click the "+" button in the lower left corner of the chat interface
162. Select "Add from GitHub" from the dropdown menu
173. Use the file browser to select specific files and folders
184. When sending your message, Claude accesses and processes the selected content
17<Tabs>
18 <Tab title="In a chat">
19 <Steps>
20 <Step title="Open the add menu">
21 In the conversation, select **+** at the lower left of the message box.
22 </Step>
1923
20### In projects
24 <Step title="Choose GitHub">
25 Select **Add from GitHub**.
26 </Step>
2127
221. Click the "+" button in your project knowledge section
232. Select "GitHub" from the dropdown
243. Search accessible repositories or paste a repository URL
254. Use the file browser to select specific files and folders
265. Your selected content is added to project knowledge
28 <Step title="Select files and folders">
29 Use the file browser to select the files and folders you want Claude to read.
30 </Step>
2731
28**Keeping content current:**
32 <Step title="Send your message">
33 Write your question and send it. Claude reads and processes the selected content when you send the message.
34 </Step>
35 </Steps>
36 </Tab>
2937
30* Use the "Sync" icon to ensure you're working with the latest codebase
31* Use the "Configure files" icon to modify which files Claude analyzes
38 <Tab title="In a project">
39 You can add repository content only to a private project, one you haven't shared with other people. In a shared project, the **GitHub** option is dimmed and shows **Only accessible from private projects**.
3240
33<Note>
34 If you're not authenticated with GitHub, you'll be redirected to authenticate before using the integration.
35</Note>
41 <Steps>
42 <Step title="Open project knowledge">
43 Open the project and, in its project knowledge section, select **+**.
44 </Step>
3645
37## Connecting to private repositories
46 <Step title="Choose GitHub">
47 Select **GitHub**.
48 </Step>
3849
39If you see a warning after entering a valid URL, you're likely attempting to connect to a private repository.
50 <Step title="Pick a repository">
51 Search the repositories you have access to, or paste a repository URL.
52 </Step>
4053
41Follow the link to the GitHub App where you can:
54 <Step title="Select files and folders">
55 Use the file browser to select the files and folders you want Claude to read.
56 </Step>
57 </Steps>
4258
43* **Grant access yourself**: Choose between allowing Claude access to all repos or specific ones
44* **Request access**: GitHub organization administrators receive an email notification. Once approved, you can sync and access the repository
59 The selected content is added to the project's knowledge.
60 </Tab>
61</Tabs>
4562
46## Best practices
63## Connect a private repository
4764
481. **Start small**: Begin with a small codebase subset to understand how Claude interprets your code
492. **Iterate and refine**: Ask follow-up questions if initial responses need clarification
503. **Combine with human expertise**: Use Claude's insights as a starting point for team discussion
514. **Thoughtful file selection**: Include key files central to your task while staying within token limits
525. **Regular updates**: Refresh GitHub sync periodically, especially before new analysis or major repo changes
65If a warning appears after you enter a valid repository URL, the repository is most likely private and Claude doesn't have access to it yet. Follow the link in the warning to the Claude GitHub App, where you have two options:
5366
54## What information is retrieved
67* **Grant access yourself**: allow Claude access to all of your repositories or only to specific ones
68* **Request access**: your GitHub organization's administrators receive an email notification. Once they approve, you can sync and add the repository
5569
56| Retrieved | Not Retrieved |
70## Try the connector
71
72After you add repository content, ask Claude something that depends on the code you selected. For example, ask Claude:
73
74* Explain how request authentication works in these files
75* Where is the retry logic, and what happens when it gives up?
76
77Claude answers from the names and contents of the files you selected on the branch you chose. It doesn't see commit history, pull requests, issues, or repository metadata; [Review what Claude retrieves from GitHub](#review-what-claude-retrieves-from-github) has the full list.
78
79## Keep repository content current
80
81After you add a repository, use these controls in your project knowledge to keep its content current and scoped to what you need:
82
83* **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
84* **Change the selection**: select **Configure files** to change which files and folders Claude reads
85* **Multiple repositories**: you can add several repositories for broader context, as long as the selected content fits within Claude's context window
86* **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
87
88## Review what Claude retrieves from GitHub
89
90The table lists what the integration reads from a repository and what it leaves out.
91
92| Retrieved | Not retrieved |
5793| -------------- | ------------------- |
5894| File names | Commit history |
5995| File contents | Pull requests |
from line 96
6096| Branch content | Issues |
6197| | Repository metadata |
6298
63## Frequently asked questions
99## Best practices
64100
65<AccordionGroup>
66 <Accordion title="What if my repository updates after adding it?">
67 Click "Sync now" to fetch the latest changes from your repository.
68 </Accordion>
101These habits help Claude give useful answers about a codebase:
69102
70 <Accordion title="Can I add multiple repositories?">
71 Yes, add multiple repositories to provide comprehensive context, provided they fit within Claude's context window.
72 </Accordion>
103* **Start small**: begin with a small subset of the codebase to see how Claude interprets your code
104* **Select files thoughtfully**: include the files central to your task while staying within token limits
105* **Iterate and refine**: ask follow-up questions when an initial response needs clarification
106* **Combine with human expertise**: treat Claude's analysis as a starting point for team discussion
107* **Sync regularly**: refresh the GitHub sync periodically, especially before a new analysis or after major repository changes
73108
74 <Accordion title="What happens if I lose repository access?">
75 You won't be able to view its contents in projects where it was previously added. The repository preview is removed, but conversation history remains.
76 </Accordion>
77</AccordionGroup>
109## Next steps
110
111* [Get started with connectors](/docs/connectors/getting-started): set up another connector and use it in conversations
112* [Connectors directory](/docs/connectors/directory): browse verified and community integrations
78113
No line in this hunk matches that.