Query and search GitHub issues using gh CLI with web fallback. Supports filtering by labels, state, assignees, and full-text search. Use when troubleshooting errors, checking if an issue is already reported, or finding workarounds.
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
references/gh-cli-guide.mdreferences/query-patterns.mdreferences/web-fallback.mdQuery and search GitHub issues for troubleshooting, bug tracking, and finding workarounds. Supports gh CLI with automatic web fallback.
This skill provides comprehensive guidance for querying GitHub issues from any repository. It prioritizes the GitHub CLI (gh) for fast, reliable access with automatic fallback to web-based methods when gh is unavailable.
Core value: Quickly find relevant issues when troubleshooting errors, checking if bugs are already reported, or discovering workarounds for known problems.
This skill should be used when:
Trigger keywords: github issues, search issues, find issue, bug report, issue lookup, gh issue, troubleshoot, workaround, known issue
Recommended (not required):
gh auth login for private reposThe skill works without gh by falling back to web-based methods.
# Check if gh is available
gh --version
# Search for issues by keyword
gh issue list --repo owner/repo --search "keyword" --state all
# Filter by label
gh issue list --repo owner/repo --label "bug" --state open
# View specific issue
gh issue view 11984 --repo owner/repo
# Search with multiple terms
gh issue list --repo owner/repo --search "error message here" --limit 20
When gh is unavailable, use WebSearch or WebFetch:
# Search via web (using WebSearch tool)
Search: "site:github.com/owner/repo/issues keyword"
# Direct URL pattern
https://github.com/owner/repo/issues?q=keyword
Search issues by keywords, matching title and body text.
gh CLI:
# Basic keyword search (all states)
gh issue list --repo anthropics/claude-code --search "path doubling" --state all
# Open issues only
gh issue list --repo anthropics/claude-code --search "path doubling" --state open
# Closed issues only
gh issue list --repo anthropics/claude-code --search "path doubling" --state closed
For detailed query syntax: See references/query-patterns.md
Narrow results using repository labels.
# Single label
gh issue list --repo owner/repo --label "bug"
# Multiple labels (AND)
gh issue list --repo owner/repo --label "bug" --label "high-priority"
# Common label patterns
gh issue list --repo owner/repo --label "enhancement" --state open
gh issue list --repo owner/repo --label "documentation"
Find issues by who created or is assigned to them.
# By assignee
gh issue list --repo owner/repo --assignee username
# By author
gh issue list --repo owner/repo --author username
# Combined filters
gh issue list --repo owner/repo --author username --state closed
Get full issue content including description and comments.
# View issue (opens in terminal)
gh issue view 11984 --repo anthropics/claude-code
# View with comments
gh issue view 11984 --repo anthropics/claude-code --comments
# JSON output for parsing
gh issue view 11984 --repo anthropics/claude-code --json title,body,comments
When gh CLI is unavailable, fall back to web-based methods.
Detection:
# Check if gh is available
if command -v gh &> /dev/null; then
echo "gh available"
else
echo "falling back to web"
fi
Web methods (in order of preference):
site:github.com/owner/repo/issues keywordhttps://github.com/owner/repo/issues?q=keywordFor detailed fallback guidance: See references/web-fallback.md
The skill supports three output formats:
One line per issue, good for scanning:
#11984 [open] Path doubling in PowerShell hooks (bug, hooks)
#11523 [closed] Fix memory leak in long sessions (bug, fixed)
#10892 [open] Add custom status line support (enhancement)
Markdown table format for structured display:
| # | State | Title | Labels |
|---|-------|-------|--------|
| 11984 | open | Path doubling in PowerShell hooks | bug, hooks |
| 11523 | closed | Fix memory leak in long sessions | bug, fixed |
Full information for deep investigation:
### #11984 - Path doubling in PowerShell hooks
**State:** open | **Labels:** bug, hooks | **Created:** 2024-12-01
**URL:** https://github.com/anthropics/claude-code/issues/11984
When using cd && in PowerShell, paths get doubled...
# Example: Troubleshoot a specific error
gh issue list --repo anthropics/claude-code --search "ENOENT" --state all --limit 10
# Search before reporting
gh issue list --repo owner/repo --search "feature not working" --state all
# Find workarounds
gh issue list --repo owner/repo --search "workaround" --state closed --label "bug"
Error: gh: command not found
Solution: Install GitHub CLI from https://cli.github.com/
- macOS: brew install gh
- Windows: winget install --id GitHub.cli
- Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md
Alternatively, falling back to web-based search...
Error: gh requires authentication
Solution: Run `gh auth login` and follow the prompts.
For public repos, web fallback can be used without authentication.
Error: API rate limit exceeded
Solution: Wait 60 seconds before retrying.
Authenticated requests have higher limits (5000/hour vs 60/hour).
No issues found matching "very specific query"
Suggestions:
- Try broader search terms
- Remove filters (state, label)
- Check spelling
- Search closed issues too (--state all)
Detailed Guides:
Related Agents:
Query: "Search for issues about hooks in the Claude Code repo"
Expected Behavior:
gh issue list --repo anthropics/claude-code --search "hooks" --state allQuery: "I'm getting a path doubling error in PowerShell. Is this a known issue?"
Expected Behavior:
Query: "Search for issues but gh isn't installed"
Expected Behavior:
site:github.com/owner/repo/issuesDate: 2025-12-05 Model: claude-opus-4-5-20251101
Audit Status: NEW - Pending initial audit