Logo
ClawHub Skills Lib
HomeCategoriesUse CasesTrendingBlog
HomeCategoriesUse CasesTrendingBlog
ClawHub Skills Lib
ClawHub Skills Lib

Browse 20,000+ community-built AI agent skills for OpenClaw. Updated daily from clawhub.ai.

Explore

  • Home
  • Trending
  • Use Cases
  • Blog

Categories

  • Development
  • AI & Agents
  • Productivity
  • Communication
  • Data & Research
  • Business
  • Platforms
  • Lifestyle
  • Education
  • Design

Use Cases

  • Security Auditing
  • Workflow Automation
  • Finance & Fintech
  • MCP Integration
  • Crypto Trading
  • Web3 & DeFi
  • Data Analysis
  • Social Media
  • 中文平台技能
  • All Use Cases →
© 2026 ClawHub Skills Lib. All rights reserved.Built with Next.js · Supabase · Prisma
Home/Blog/GitHub Skill: Let Claude Drive gh CLI for Issues, PRs, and CI Runs
skill-spotlightgit-vcsgithubclawhubopenclawgh-clisteipetedevops

GitHub Skill: Let Claude Drive gh CLI for Issues, PRs, and CI Runs

March 9, 2026·6 min read

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 login

Once 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-failed

The --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/repo

PR 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/repo

Advanced 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,assignees

The 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/55

How to Install

clawhub install github

Comparison: github skill vs Alternatives

Taskgithub skillManual gh commandsGitHub 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

  1. Always use --repo flag — Even when you're in the right git directory. This prevents gh from picking up the wrong repo and makes the command explicit.

  2. --log-failed is 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.

  3. Pipe --json output 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.

  4. gh api for anything not in subcommands — GitHub's API surface is much larger than what gh pr, gh issue, and gh run expose. For repository stats, team membership, deployment history — reach for gh api.

  5. Combine with jq for filtering — The --jq flag on gh api and the ability to pipe --json output to jq makes GitHub data as queryable as a database. Learn the basics of jq selectors and you can extract almost anything.


Considerations

  • gh must be installed and authenticated — This skill provides the instructions, not the CLI. If gh isn't set up, the commands won't run.
  • Rate limits apply — gh api calls count against GitHub's API rate limits. For high-frequency automation, check your remaining limits with gh api rate_limit.
  • Organization repos need extra permissions — Some org-level operations require elevated permissions. gh auth status will 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 gh CLI doesn't expose, you'll need gh api or 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

← Back to Blog