gh

A set of instructions for using GitHub's command-line tool, which lets developers manage repositories from a terminal. It covers pull requests, issues, searches, checks, and GitHub API requests.

In plain words
What is it for?
Use it to inspect pull requests and issues, search repositories and code, review automated checks, and perform repository operations.
Why use it?
It gives an agent consistent commands for inspecting and automating GitHub work instead of relying on browser pages or guesswork.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/adampoit/ai/gh
Any agent
npx skills add adampoit/ai --skill gh
Clone the repo
git clone --depth 1 https://github.com/adampoit/ai

Made for: Claude Code, Codex.

Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 738 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00051 $0.00738
Opus 5 $0.00026 $0.00369
Sonnet 5 $0.00010 $0.00148
Haiku 4.5 $0.00005 $0.00074

Measured 2d ago against content hash 5e1c97386ad4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gh scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/gh/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gh

Use gh for GitHub-related tasks.

gh pr view 123 --json number,title,body,commits,files,headRefName,url

Inspect PRs And Issues

View one PR as JSON:

gh pr view 123 --json number,title,body,commits,files,headRefName,url

List open PRs:

gh pr list --state open --json number,title,headRefName,url

View one issue as JSON:

gh issue view 456 --json number,title,body,comments,url

Search GitHub

Prefer gh search for code/repo/issue/PR discovery.

Code search:

gh search code "TODO repo:owner/repo path:src" --limit 20

Repository search:

gh search repos "topic:cli language:go" --limit 20 --json name,description,url

Issue search:

gh search issues "repo:owner/repo is:issue is:open label:bug" --limit 50 --json number,title,url,state,updatedAt

PR search:

gh search prs "repo:owner/repo is:pr is:open author:alice" --limit 50 --json number,title,url,state,updatedAt

Search tips:

  • Use qualifiers to reduce noise: repo:, path:, language:, is:open, author:, label:
  • Start broad, then refine filters
  • Combine with local search (rg) in checked-out repos when validating context

Checks And CI

View checks for a PR branch:

gh pr checks 123

View run details with links:

gh run list --limit 20

API And Automation

Use gh api when subcommands do not expose required fields.

gh api repos/:owner/:repo/pulls --method POST -f title='My PR' -f head='feature-branch' -f base='main'

Prefer machine-readable output for automation:

  • Use --json where available
  • Use gh api output with jq for deterministic extraction of fields like number, title, body, and url

URL Handling

When the user provides a GitHub URL, parse owner/repo/number and fetch details with gh commands instead of browser scraping.

Examples:

  • PR URL -> gh pr view <number> --repo <owner>/<repo> ...
  • Issue URL -> gh issue view <number> --repo <owner>/<repo> ...

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 118 lines · 51 tokens per session scan A 5e1c97386ad4

Subscribe to this mod's changes

gh is a skill published in the GitHub repository adampoit/ai (2 stars, last pushed 8d ago), licensed MIT. It adds 51 tokens to every session and 738 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.