gh-fine-grained-pat

gh-fine-grained-pat is a skill for Claude Code from terrylica/cc-skills. It costs 96 tokens per session (1,932 once invoked), scanned B, original, MIT.

A browser-automation tool that creates, checks, lists, and revokes narrowly scoped GitHub personal access tokens. A personal access token is a password-like credential that programs use to access GitHub.

In plain words
What is it for?
Use it to make tokens for release tools, continuous-integration status reporting, read-only auditing, or account-specific access, and to rotate or revoke them.
Why use it?
GitHub does not provide an API for creating these fine-grained tokens, so repeated manual setup is difficult to reproduce and review. A declarative specification records the requested permissions and settings.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md.

Part of the gh-tools plugin — 6 skills shipped together , and of cc-skills

Good fit Use it to make tokens for release tools, continuous-integration status reporting, read-only auditing, or account-specific access, and to rotate or revoke them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/terrylica/cc-skills/gh-fine-grained-pat
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.

Any agent
npx skills add terrylica/cc-skills --skill gh-fine-grained-pat
Clone the repo
git clone --depth 1 https://github.com/terrylica/cc-skills

Made for: Claude Code.

Or install gh-tools, the plugin that ships this one along with the rest of its 6 skills.

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-fine-grained-pat

README.md
[![agentmods](https://agentmods.dev/badge/skills/terrylica/cc-skills/gh-fine-grained-pat/github.svg)](https://agentmods.dev/skills/terrylica/cc-skills/gh-fine-grained-pat)
Your own site
<a href="https://agentmods.dev/skills/terrylica/cc-skills/gh-fine-grained-pat"><img src="https://agentmods.dev/badge/skills/terrylica/cc-skills/gh-fine-grained-pat/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-fine-grained-pat

Your own site · 80×15
<a href="https://agentmods.dev/skills/terrylica/cc-skills/gh-fine-grained-pat"><img src="https://agentmods.dev/badge/skills/terrylica/cc-skills/gh-fine-grained-pat.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,932 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 3
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • medium Rogue Agent · line 3
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Prompt Injection · line 69
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Privilege Escalation · line 95
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
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.00096 $0.01932
Opus 5 $0.00048 $0.00966
Sonnet 5 $0.00019 $0.00386
Haiku 4.5 $0.00010 $0.00193

Measured 6d ago against content hash 201a177840db, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

gh-fine-grained-pat scanned grade B with 1 finding 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 6d ago.

The scan reads SKILL.md. This mod also ships 11 executable files (scripts/autosudo.mjs, scripts/browser.mjs, scripts/form.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

GitHub's **sudo mode** ("Confirm access") normally needs a human gesture. The engine can clear it autonomously using a self-custodied credential — see the [ADR](/docs/adr/2026-06-26-autonomous-github-web-auth-virtual-pas
plugins/gh-tools/skills/gh-fine-grained-pat/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-fine-grained-pat — declarative fine-grained PAT forge

GitHub exposes no API to create fine-grained PATs (community #148626) — the web UI is the only way. This skill drives that UI over the Chrome DevTools Protocol from a declarative JSON spec, so token creation is repeatable, reviewable, and anti-fragile instead of a hand-clicked one-off.

Self-Evolving Skill: This skill improves through use. GitHub's settings UI drifts — if a selector misses, the modal/picker/permission flow changed, or a permission's detail-page noun is wrong, fix scripts/, CLAUDE.md (selector map + noun map), or the spec immediately; don't defer. Only update for real, reproducible breakage.

When to use

  • Mint a scoped token (release bot, CI reporter, read-only auditor, account-scoped) for storage in the SCS vault.
  • Re-create / rotate a token from a checked-in spec.
  • List, verify (read back settings), or revoke fine-grained tokens.

Prerequisites

  • node (NOT bun — Bun's connectOverCDP times out) and playwright-core (already pinned at the repo root package.json).
  • Google Chrome at the standard macOS path.
  • A one-time GitHub login (persisted in a profile; see below).

One-time login (then fully automated)

A persistent Chrome profile holds the GitHub session cookie, so you log in once and every later run reuses it:

cd plugins/gh-tools/skills/gh-fine-grained-pat
node scripts/pat.mjs login      # opens Chrome; sign in (incl. 2FA); it auto-detects success
node scripts/pat.mjs doctor     # runtime + chrome + profile + auth health

The profile lives at ~/.local/share/gh-pat-automation/profile (override with GH_PAT_PROFILE_DIR). Treat it as sensitive — it can impersonate your GitHub session. It is outside the repo and never committed.

Create a token from a spec

# write the value to a 0600 file (default) — the value is NEVER printed to the terminal
node scripts/pat.mjs create specs/release-bot.json --out /tmp/.tok

# …or pipe it straight into the SCS vault (value passed in-process, never to chat)
node scripts/pat.mjs create specs/release-bot.json --vault cc-skills:gh.token

# rotate: revoke the same-named token, create a replacement, store it (sink required)
node scripts/pat.mjs rotate specs/release-bot.json --vault cc-skills:gh.token

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. 6d ago First seen · 118 lines · 96 tokens per session scan B 201a177840db

Subscribe to this mod's changes

gh-fine-grained-pat is a skill published in the GitHub repository terrylica/cc-skills (72 stars, last pushed yesterday), licensed MIT. It adds 96 tokens to every session and 1,932 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

core-workflow

Detailed development workflow patterns, checklists, and standards. Auto-loads for complex tasks, planning, debugging, testing, or when explicit patterns are needed. Contains session protocols, git conventions, security checklists, testing strategy, and communication standards.

travisjneuman/.claude · 53 tokens

auto-claude

Autonomous multi-agent coding with git worktree isolation, QA validation, and memory. Use for complex features requiring autonomous implementation.

travisjneuman/.claude · 30 tokens

debug-systematic

Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.

travisjneuman/.claude · 33 tokens

code-review-loop

Use when opening a PR for review or when receiving review feedback. Activate for keywords like "code review", "PR review", "request review", "review feedback", "address comments", "reviewer said". Covers both ends of the loop: preparing a reviewable PR and acting on feedback rigorously. Always engage with every…

duthaho/claudekit · 79 tokens

release-and-changelog

Use when cutting a release, bumping a version, or writing release notes. Activate for keywords like "release", "version bump", "changelog", "release notes", "tag", "publish", "ship a release", "v1.x", "v2.x". Enforces version hygiene: SemVer respect, changelog discipline, atomic commits, tagged release. Always reflect…

duthaho/claudekit · 99 tokens

wrap-up

End-of-session handler that first checks whether the current session's plan is actually complete. If complete: run a quick retrospective, emit a forward-looking follow-up prompt, and — in a git repository — refresh the repo and clean gone branches. If incomplete: skip cleanup and emit ready-to-paste resume prompts so…

dryvist/claude-code-plugins · 96 tokens