--- To connect Claude (Anthropic's AI) to a GitHub repository, you'll need to use the official GitHub integration available in Claude.ai. This allows you to add repos to your chats or projects for code analysis, editing suggestions, or other development tasks. Note that you must have a Claude.ai account (Pro version recommended for full features), and be the repo owner or have admin access on GitHub. ### Prerequisites - Authenticate with GitHub in Claude: If not already done, go to Claude.ai settings > Integrations > GitHub, and click "Connect." This will redirect you to GitHub to authorize the Claude app. - Install the Claude GitHub App if needed: Visit [https://github.com/apps/claude-for-github](https://github.com/apps/claude-for-github) (or similar, as it's sometimes listed as "Claude"), select your account/organization, and grant access to specific repos. This ensures Claude can read/write contents, issues, and pull requests as required. If repos don't appear after connecting (a common issue), revisit the app installation page at [https://github.com/apps/claude-for-github/installations/select_target] to explicitly select and grant access to all or specific repositories. Claude may limit visibility to certain repos based on size, privacy, or age, but this step often resolves it. ### Adding a Repo to a Claude Chat 1. Open Claude.ai and start a new chat. 2. Click the "+" button in the lower left corner of the chat interface. 3. Select "Add from GitHub" from the dropdown. 4. Search for your accessible repositories or paste the full repo URL (e.g., https://github.com/username/repo-name). 5. Use the file browser to select specific files, folders, or the entire repo to add to the chat context. ### Adding a Repo to a Claude Project 1. In Claude.ai, navigate to your project (or create a new one). 2. In the upper right corner of the "Project Knowledge" section, click the "+" button. 3. Select "GitHub" from the dropdown. 4. Search through your accessible repos or paste the repo URL. 5. Browse and select the files/folders to include. Once added, you can interact with the repo in Claude—e.g., ask it to review code, generate workflows, or suggest fixes. For advanced automation, consider setting up the Claude GitHub Action in your repo's workflows to run Claude on issues or PRs automatically. To do this: - Install the app as above. - Add secrets (like your Anthropic API key) to your GitHub repo settings. - Copy a sample workflow YAML from examples (e.g., claude.yml) into .github/workflows/. If you're using the Claude desktop app or CLI, some setups involve additional commands like `/install-github-app` for guided installation. For troubleshooting, check Claude's help center or GitHub app permissions. --- ``` Can I create a Github repository from Claude Code? ``` No, you cannot create a new GitHub repository directly from Claude Code or the Claude AI interface. The GitHub integration is designed for connecting and working with existing repositories—such as adding them to chats or projects for code analysis, suggestions, or automation via GitHub Actions—but it doesn't include features for creating new repos. You'll need to create the repository on GitHub.com first (e.g., via their web interface, CLI, or API), then follow the integration steps to link it to Claude for further use. ---