This guide walks you through integrating Claude with GitHub on both Windows and Linux systems.
Prerequisites
- Claude account
- GitHub account
- Visual Studio Code (VSCode) installed
- Administrator access to your system
Windows Setup
Step 1: Add Claude Code for VSCode
- Open Visual Studio Code
- Go to the Extensions marketplace (Ctrl + Shift + X)
- Search for “Claude Code”
- Click on the official Claude Code extension by Anthropic
- Click “Install” and wait for the installation to complete
- Once installed, you should see the Claude Code icon in the activity sidebar
Step 2: Install Claude CLI
- Open PowerShell as Administrator
- Run the following command to install Claude CLI via npm:
npm install -g @anthropic-ai/claude-cliIf you don’t have npm installed, first install Node.js from nodejs.org
- Verify the installation by running:
claude --version
Step 3: Install GitHub CLI
- Download the GitHub CLI installer from cli.github.com
- Run the installer and follow the on-screen prompts
- Alternatively, if you have Chocolatey installed, run:
choco install gh - Verify the installation:
gh --version
Step 4: Login to GitHub via CLI
- Open PowerShell
- Run the authentication command:
gh auth login - Follow the prompts:
- Choose GitHub.com when asked which Git service
- Choose HTTPS for the protocol
- Authenticate with your browser when prompted
- Authorize the GitHub CLI to access your account
- Verify authentication was successful:
gh auth status
Step 5: Open Claude and Install GitHub App
- Open Claude in your browser or Claude desktop application
- Navigate to the integrations or settings section
- Look for the GitHub integration option
- Click “Install GitHub App” or “Connect to GitHub”
- You’ll be redirected to GitHub to authorize the Claude app
- Review the permissions and click “Authorize”
- Return to Claude and confirm the connection is successful
Linux Setup
Step 1: Add Claude Code for VSCode
- Open Visual Studio Code
- Go to the Extensions marketplace (Ctrl + Shift + X)
- Search for “Claude Code”
- Click on the official Claude Code extension by Anthropic
- Click “Install” and wait for the installation to complete
- Once installed, you should see the Claude Code icon in the activity sidebar
Step 2: Install Claude CLI
- Open Terminal
- Ensure npm is installed. If not, install Node.js:
sudo apt update sudo apt install nodejs npmOr for other distributions, use your package manager (yum, pacman, etc.)
- Install Claude CLI globally:
sudo npm install -g @anthropic-ai/claude-cli - Verify the installation:
claude --version
Step 3: Install GitHub CLI
- Add the GitHub CLI repository to your system:
# For Ubuntu/Debian sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 sudo apt-add-repository https://cli.github.com/packages sudo apt update sudo apt install ghOr for other distributions:
# For Fedora/RHEL sudo dnf install gh # For Arch sudo pacman -S github-cli - Verify the installation:
gh --version
Step 4: Login to GitHub via CLI
- Open Terminal
- Run the authentication command:
gh auth login - Follow the prompts:
- Choose GitHub.com when asked which Git service
- Choose HTTPS for the protocol (or SSH if preferred)
- Select “Login with a web browser” when prompted
- Your browser will open for authorization
- Authorize the GitHub CLI to access your account
- Verify authentication was successful:
gh auth status
Step 5: Open Claude and Install GitHub App
- Open Claude in your browser or Claude desktop application
- Navigate to the integrations or settings section
- Look for the GitHub integration option
- Click “Install GitHub App” or “Connect to GitHub”
- You’ll be redirected to GitHub to authorize the Claude app
- Review the permissions and click “Authorize”
- Return to Claude and confirm the connection is successful
Troubleshooting
Claude CLI not found after installation:
- Ensure your terminal has been restarted after installation
- Check that npm is in your PATH
- Try reinstalling:
npm install -g @anthropic-ai/claude-cli
GitHub CLI authentication fails:
- Verify your GitHub credentials are correct
- Check your internet connection
- Ensure pop-ups are not blocked in your browser
- Try again with:
gh auth logoutfollowed bygh auth login
GitHub App won’t connect in Claude:
- Clear your browser cache and cookies
- Try using a different browser
- Ensure you’re using an updated version of Claude
- Check that you have proper permissions on your GitHub account
Next Steps
Once integration is complete, you can:
- Use Claude to help analyze and work with your GitHub repositories
- Leverage Claude Code in VSCode for AI-assisted development
- Use Claude CLI for command-line interactions
- Automate workflows between Claude and GitHub


