gh-scraper

gh-scraper is an agent for Claude Code from Borda/AI-Rig. It costs 82 tokens per session (4,245 once invoked), scanned A, original, Apache-2.0.

A data-collection agent that gathers REST and GraphQL information from a GitHub repository and writes the raw results as JSONL. JSONL is a text format with one JSON object per line.

In plain words
What is it for?
Use it as part of an OSS analysis workflow to fetch GitHub activity and repository information for a specified owner and repository.
Why use it?
It collects the repository data needed for later vitality scoring without mixing data collection with scoring or report writing.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the oss plugin — 3 skills, 4 agents shipped together

Good fit Use it as part of an OSS analysis workflow to fetch GitHub activity and repository information for a specified owner and repository.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Borda/AI-Rig
Claude Code
/plugin install oss

Made for: Claude Code.

Or install oss, the plugin that ships this one along with the rest of its 3 skills, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gh-scraper

README.md
[![agentmods](https://agentmods.dev/badge/agents/borda/ai-rig/gh-scraper/github.svg)](https://agentmods.dev/agents/borda/ai-rig/gh-scraper)
Your own site
<a href="https://agentmods.dev/agents/borda/ai-rig/gh-scraper"><img src="https://agentmods.dev/badge/agents/borda/ai-rig/gh-scraper/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gh-scraper

Your own site · 80×15
<a href="https://agentmods.dev/agents/borda/ai-rig/gh-scraper"><img src="https://agentmods.dev/badge/agents/borda/ai-rig/gh-scraper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,245 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00082 $0.04245
Opus 5.5 $0.00033 $0.01698
Sonnet 5.5 $0.00016 $0.00849
Haiku 4.5 $0.00008 $0.00424

Measured 18d ago against content hash 134033c98b13, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gh-scraper 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 18d 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.

plugins/cc_oss/agents/gh-scraper.md · 183 lines

How it starts

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

Data collection agent, /oss:analyse (vitality mode). Fetches required GitHub data (REST + GraphQL) in two sequential groups with parallel calls inside each, writes raw JSONL, returns path. Scoring: 3 parallel oss:repo-warden instances.

NOT for axis scoring — oss:repo-warden owns all axis scoring. NOT for report formatting, terminal summary, or adversarial review — /oss:analyse (vitality mode) Steps 4–7 own those.

The caller supplies session sentinels under ${TMPDIR:-/tmp}; Step 1 reads these values only, never shell-variable placeholders from the prompt:

  • analyse-gh-owner-${CSID} — GH_OWNER, GitHub owner or org
  • analyse-gh-repo-${CSID} — GH_REPO, GitHub repository name
  • vitality-data-file-${CSID} — DATA_FILE, output path for raw JSONL (one JSON object per line)

Prompt asks for anything but a GitHub fetch (code review, bug hunt, Q&A) → run nothing, return only {"status":"error","file":"","error":"out of scope: gh-scraper only fetches GitHub data"}. Missing, empty or unsubstituted sentinel values → Step 1 returns an error envelope before auth, API calls or output writes. Never review, probe or rewrite supplied code.

Step 1 — Setup

Load GH_OWNER, GH_REPO, DATA_FILE from the caller's session sentinels, then compute time anchors:

set -e
export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}"
export GH_HOST=github.com
DATA_FILE=""
SETUP_ERROR="setup failed — see stderr"
trap 'python -c '\''import json,sys; print(json.dumps({"status":"error","file":sys.argv[1],"error":sys.argv[2]}))'\'' "$DATA_FILE" "$SETUP_ERROR"' ERR
IFS= read -r GH_OWNER < "${TMPDIR:-/tmp}/analyse-gh-owner-${CSID}" 2>/dev/null || GH_OWNER=""
IFS= read -r GH_REPO < "${TMPDIR:-/tmp}/analyse-gh-repo-${CSID}" 2>/dev/null || GH_REPO=""
IFS= read -r DATA_FILE < "${TMPDIR:-/tmp}/vitality-data-file-${CSID}" 2>/dev/null || DATA_FILE=""
SETUP_ERROR="missing, empty or unsubstituted scrape sentinel — rerun /oss:analyse vitality"
[ -n "$GH_OWNER" ] && [ -n "$GH_REPO" ] && [ -n "$DATA_FILE" ] || { echo "[gh-scraper] ERROR: $SETUP_ERROR" >&2; false; }
case "$GH_OWNER/$GH_REPO/$DATA_FILE" in
    *'$'*|*'<'*|*'>'*) echo "[gh-scraper] ERROR: $SETUP_ERROR" >&2; false ;;
esac
SETUP_ERROR="setup failed — see stderr"
# cross-platform: macOS BSD vs GNU/Linux
if date -v-1d +%Y-%m-%d 2>/dev/null | grep -q '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'; then
    # BSD date (-v offset) — verify output shape, not just exit code
    CUTOFF_30D=$(date -u -v-30d +%Y-%m-%dT%H:%M:%SZ)    # timeout: 5000
    CUTOFF_90D=$(date -u -v-90d +%Y-%m-%dT%H:%M:%SZ)    # timeout: 5000
    CUTOFF_180D=$(date -u -v-180d +%Y-%m-%dT%H:%M:%SZ)  # timeout: 5000
    CUTOFF_3Y=$(date -u -v-1095d +%Y-%m-%d)              # timeout: 5000
else
    CUTOFF_30D=$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%SZ)    # timeout: 5000
    CUTOFF_90D=$(date -u -d '90 days ago' +%Y-%m-%dT%H:%M:%SZ)    # timeout: 5000
    CUTOFF_180D=$(date -u -d '180 days ago' +%Y-%m-%dT%H:%M:%SZ)  # timeout: 5000
    CUTOFF_3Y=$(date -u -d '1095 days ago' +%Y-%m-%d)             # timeout: 5000
fi

# auth preflight — fail fast before any API calls
gh auth status --hostname github.com 2>/dev/null || { SETUP_ERROR="not authenticated — run gh auth login --hostname github.com"; echo "[gh-scraper] ERROR: $SETUP_ERROR" >&2; false; }  # timeout: 6000

# rate-limit preflight — warn if <80 calls remain (~80 needed for full scrape)
for BUCKET in core search graphql; do
    case "$BUCKET" in
        core) RATE_REMAINING=$(gh api rate_limit --jq '.resources.core.remaining' 2>/dev/null || echo unknown) ;;  # timeout: 6000
        search) RATE_REMAINING=$(gh api rate_limit --jq '.resources.search.remaining' 2>/dev/null || echo unknown) ;;  # timeout: 6000
        graphql) RATE_REMAINING=$(gh api rate_limit --jq '.resources.graphql.remaining' 2>/dev/null || echo unknown) ;;  # timeout: 6000
    esac
    RATE_MIN=80
    [ "$BUCKET" = search ] && RATE_MIN=10
    case "$RATE_REMAINING" in
        ''|*[!0-9]*) ;;
        *)
            if [ "$RATE_REMAINING" -lt "$RATE_MIN" ]; then
                RATE_RESET=$(gh api rate_limit --jq ".resources.$BUCKET.reset | todate" 2>/dev/null || echo 'unknown time')
                echo "[gh-scraper] WARN: only $RATE_REMAINING $BUCKET API budget remaining — results may be incomplete; reset at $RATE_RESET"  # timeout: 6000
            fi
            ;;
    esac
done

# DATA_FILE set by caller — do NOT inject PID suffix; breaks handoff (vitality.md reads original path)
echo "[gh-scraper] analysing $GH_OWNER/$GH_REPO"  # timeout: 5000
mkdir -p "$(dirname "$DATA_FILE")"  # timeout: 5000
# fresh snapshot per run: Group 2 appends, Step 4 merges Group 1 in — no stale same-day record survives
printf '' > "$DATA_FILE"
# persist across Bash calls — Check 41: fresh shell per call; trailing \n required, `read` fails without it
printf '%s\n' "$GH_OWNER" > "${TMPDIR:-/tmp}/gh-scraper-owner-${CSID}"
printf '%s\n' "$GH_REPO" > "${TMPDIR:-/tmp}/gh-scraper-repo-${CSID}"
printf '%s\n' "$DATA_FILE" > "${TMPDIR:-/tmp}/gh-scraper-data-file-${CSID}"
# keyed to DATA_FILE stem — runs for different repos share the directory
printf '%s\n' "${DATA_FILE%.jsonl}.group1" > "${TMPDIR:-/tmp}/gh-scraper-group1-dir-${CSID}"
printf '%s\n' "$CUTOFF_3Y"   > "${TMPDIR:-/tmp}/gh-scraper-cutoff-3y-${CSID}"
printf '%s\n' "$CUTOFF_30D"  > "${TMPDIR:-/tmp}/gh-scraper-cutoff-30d-${CSID}"
printf '%s\n' "$CUTOFF_90D"  > "${TMPDIR:-/tmp}/gh-scraper-cutoff-90d-${CSID}"
printf '%s\n' "$CUTOFF_180D" > "${TMPDIR:-/tmp}/gh-scraper-cutoff-180d-${CSID}"

Read the full file on GitHub · 183 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. 18d ago Changed · +30 lines · +5 tokens per session 134033c98b13
  2. 1mo ago Changed · -19 lines b0a645d4ef6f
  3. 1mo ago Changed · +7 lines ea62bb6aab5b
  4. 2mo ago Changed e48152defe0e
  5. 3mo ago First seen · 165 lines · 77 tokens per session scan A d0bebae23717

Subscribe to this mod's changes

gh-scraper is an agent published in the GitHub repository Borda/AI-Rig (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 82 tokens to every session and 4,245 once invoked, about $0.0003 per session on Opus 5.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-30.

Related

gh-scraper compared with agents from other repositories

gh-scraper next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
gh-scraperBorda/AI-RigAgent31yesterdayApache-2.0A82Claude Code
budget-sentinelhoangsonww/Claude-Code-Agent-MonitorAgent1.2kyesterdayMITA116Claude Code
token-economisthoangsonww/Claude-Code-Agent-MonitorAgent1.2kyesterdayMITA110Claude Code
trend-forecasterhoangsonww/Claude-Code-Agent-MonitorAgent1.2kyesterdayMITA82Claude Code
mcp-reviewerhoangsonww/Claude-Code-Agent-MonitorAgent1.2kyesterdayMITA21Claude Code
pipeline-auto-brainkardebadas/claude-pluginAgent315d agoApache-2.0A73Claude Code
bug-investigatorkardebadas/claude-pluginAgent315d agoApache-2.0A46Claude Code