GitHub Skill: Let Claude Drive gh CLI for Issues, PRs, and CI Runs
28,000+ downloads and 92 stars — github by @steipete is the skill for wiring Claude into your GitHub workflow. It's not a GitHub MCP server or an OAuth integration — it's a focused set of instructions for using the gh CLI, the official GitHub command-line tool, to handle the GitHub tasks that come up constantly in development sessions.
The Problem It Solves
Every developer who works in GitHub knows these situations: a PR has failing checks and you need to see which step failed. You want to list open issues and filter by label. You're in the middle of a coding session and need a quick CI status without switching to the browser.
The gh CLI can handle all of this. But you don't always have the exact command syntax memorized. And you can't just tell Claude "check CI on PR 55" without giving it a clear recipe for how to do that reliably.
github gives Claude that recipe. The right flags, the right output format, the right patterns for common GitHub tasks — without Claude having to figure out the gh API surface from scratch each time.
Prerequisites
The gh CLI must be installed and authenticated:
# Install
brew install gh
# Authenticate
gh auth loginOnce authenticated, Claude can run any gh command in your terminal session.
Core Workflows
Checking Pull Requests
# Check CI status on a PR
gh pr checks 55 --repo owner/repo
# View recent workflow runs
gh run list --repo owner/repo --limit 10
# See which steps failed
gh run view <run-id> --repo owner/repo
# View logs for failed steps only
gh run view <run-id> --repo owner/repo --log-failedThe --log-failed flag is the practical one — instead of scrolling through thousands of log lines, it jumps straight to what actually broke.
Issues
# List open issues with JSON output
gh issue list --repo owner/repo --json number,title,labels
# Filter and format with jq
gh issue list --repo owner/repo --json number,title \
--jq '.[] | "\(.number): \(.title)"'
# View a specific issue
gh issue view 123 --repo owner/repoPR Operations
# List PRs with reviewers
gh pr list --repo owner/repo --json number,title,reviewRequests
# Check a specific PR
gh pr view 55 --repo owner/repo
# Check PR diff
gh pr diff 55 --repo owner/repoAdvanced API Queries
The gh api command gives access to everything in the GitHub REST API, not just what the convenience subcommands expose:
# Get PR details with specific fields
gh api repos/owner/repo/pulls/55 \
--jq '.title, .state, .user.login'
# Get all open PRs for a user
gh api repos/owner/repo/pulls \
--jq '.[] | select(.user.login == "username") | .title'
# Check rate limit status
gh api rate_limit --jq '.rate'
# Repository statistics
gh api repos/owner/repo \
--jq '{stars: .stargazers_count, forks: .forks_count, issues: .open_issues_count}'The --jq flag lets you filter on the server side, reducing output to just what you need.
JSON Output Pattern
Every major gh command supports --json for structured output. This is what makes the skill useful for automation and for passing data back into Claude's context:
# Get PR list as JSON for Claude to analyze
gh pr list --repo owner/repo --json number,title,state,createdAt
# Get issue labels and assignees
gh issue list --repo owner/repo --json number,title,labels,assigneesThe output is standard JSON, which Claude can then analyze, filter, or pass to other commands.
Working Outside a Git Directory
The --repo owner/repo flag is required whenever you're not inside the relevant git repository. The skill makes this explicit to avoid the common error where gh tries to infer the repo from the current directory and gets it wrong.
# Always works regardless of current directory
gh issue list --repo my-org/my-project
# Or use full URLs
gh pr view https://github.com/my-org/my-project/pull/55How to Install
clawhub install githubComparison: github skill vs Alternatives
| Task | github skill | Manual gh commands | GitHub web UI |
|---|---|---|---|
| Check CI status | ✅ Claude handles syntax | ✅ but memorize flags | ✅ but requires browser |
| Filter issues/PRs | ✅ with jq piping | ⚠️ need jq knowledge | ⚠️ limited filters |
| Log-failed step | ✅ --log-failed pattern | ✅ if you know the flag | ❌ manual scrolling |
| Batch operations | ✅ scriptable | ✅ | ❌ |
| Works in session | ✅ | ✅ | ❌ requires context switch |
Practical Tips
-
Always use
--repoflag — Even when you're in the right git directory. This preventsghfrom picking up the wrong repo and makes the command explicit. -
--log-failedis the most useful flag — For any CI debugging session, this is the one that saves the most time. Don't look at full logs; start with failed steps. -
Pipe
--jsonoutput to Claude — When you need Claude to analyze PR activity, issue patterns, or CI failure rates, get JSON output first, then ask Claude to interpret it. -
gh apifor anything not in subcommands — GitHub's API surface is much larger than whatgh pr,gh issue, andgh runexpose. For repository stats, team membership, deployment history — reach forgh api. -
Combine with
jqfor filtering — The--jqflag ongh apiand the ability to pipe--jsonoutput tojqmakes GitHub data as queryable as a database. Learn the basics ofjqselectors and you can extract almost anything.
Considerations
ghmust be installed and authenticated — This skill provides the instructions, not the CLI. Ifghisn't set up, the commands won't run.- Rate limits apply —
gh apicalls count against GitHub's API rate limits. For high-frequency automation, check your remaining limits withgh api rate_limit. - Organization repos need extra permissions — Some org-level operations require elevated permissions.
gh auth statuswill show what scopes your current token has. - This is a thin wrapper — The skill provides usage patterns, not a new abstraction layer. If you need something the
ghCLI doesn't expose, you'll needgh apior the GitHub REST/GraphQL API directly.
The Bigger Picture
The GitHub skill represents a simple but effective pattern: instead of building a custom GitHub integration, it teaches Claude to use the tool that already exists. gh is maintained by GitHub, works with all repositories, and covers 90% of what developers need during a session.
With 28,000+ downloads, it's become a default part of development sessions for ClawHub users — the difference between having to context-switch to the browser and keeping the entire workflow in the terminal.
View the skill on ClawHub: github