Claude Code GitHub CLI: Issues, PRs, and Reviews
Use GitHub CLI with Claude Code for gh issue, gh pr, pull request reviews, comments, labels, safe permissions, and repeatable repository workflows.
Claude Code GitHub CLI Guide
Claude Code can use GitHub CLI (gh) to read issues, inspect pull requests, create PRs, respond to review comments, and run auditable GitHub workflows from your terminal.
Quick Answer
Install and authenticate gh, then let Claude Code use narrow GitHub CLI commands for the task:
gh auth status
gh issue list
gh pr view --commentsGitHub CLI is often simpler than adding a GitHub MCP server when you only need visible, command-line operations such as issue triage, PR creation, release notes, or review follow-up.
Installing GitHub CLI
macOS
brew install ghUbuntu/Debian
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install ghWindows
winget install --id GitHub.cliConfigure Authentication
Login to GitHub
gh auth loginChoose authentication method:
- Login through browser
- Use Personal Access Token
Verify Configuration
gh auth status
gh api userUsage in Claude Code
Basic Operations
Claude can directly use gh commands:
Please use gh command to view current repository issuesClaude will execute:
gh issue listCreating Issues
Create a GitHub issue for the user login functionality bugClaude will execute:
gh issue create \
--title "User login functionality bug fix" \
--body "Detailed description of login issues..." \
--label "bug,priority-high"Pull Request Management
Create a Pull Request for the current branchClaude will execute:
gh pr create \
--title "Implement user authentication feature" \
--body "## Changes\n- Add login page\n- Implement JWT authentication\n- Add unit tests"Common Workflows
1. Issue-Driven Development
View issues labeled 'enhancement' and select one to start developmentClaude execution flow:
gh issue list --label enhancement- Analyze issue content
- Create feature branch
- Implement functionality
- Create Pull Request
2. Code Review Response
Check latest comments on my PR and handle feedbackClaude execution flow:
gh pr list --author @megh pr view <PR-ID> --comments- Analyze comment feedback
- Modify code
- Push updates
Permission Configuration
Allow gh commands in Claude Code:
{
"allowedTools": [
"Bash(gh:*)",
"Bash(gh issue:*)",
"Bash(gh pr:*)",
"Bash(gh repo:*)"
]
}Next: Bash Tools - Learn how to work with command-line tools.