Configuration

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 --comments

GitHub 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 gh

Ubuntu/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 gh

Windows

winget install --id GitHub.cli

Configure Authentication

Login to GitHub

gh auth login

Choose authentication method:

  • Login through browser
  • Use Personal Access Token

Verify Configuration

gh auth status
gh api user

Usage in Claude Code

Basic Operations

Claude can directly use gh commands:

Please use gh command to view current repository issues

Claude will execute:

gh issue list

Creating Issues

Create a GitHub issue for the user login functionality bug

Claude 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 branch

Claude 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 development

Claude execution flow:

  1. gh issue list --label enhancement
  2. Analyze issue content
  3. Create feature branch
  4. Implement functionality
  5. Create Pull Request

2. Code Review Response

Check latest comments on my PR and handle feedback

Claude execution flow:

  1. gh pr list --author @me
  2. gh pr view <PR-ID> --comments
  3. Analyze comment feedback
  4. Modify code
  5. 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.