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.
npx skills add jamestexas/agents --skill gh-token-rotategit clone --depth 1 https://github.com/jamestexas/agentsWrote 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.
[](https://agentmods.dev/skills/jamestexas/agents/gh-token-rotate)<a href="https://agentmods.dev/skills/jamestexas/agents/gh-token-rotate"><img src="https://agentmods.dev/badge/skills/jamestexas/agents/gh-token-rotate/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.
<a href="https://agentmods.dev/skills/jamestexas/agents/gh-token-rotate"><img src="https://agentmods.dev/badge/skills/jamestexas/agents/gh-token-rotate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00101 | $0.00947 |
| Opus 5.5 | $0.00040 | $0.00379 |
| Sonnet 5.5 | $0.00020 | $0.00189 |
| Haiku 4.5 | $0.00010 | $0.00095 |
Grade A, and why
gh-token-rotate 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 24d 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.
How it starts
The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
gh-token-rotate — rotate the PAT without it ever touching disk or history
A GitHub PAT expires on a schedule, and the failure it produces names neither the token nor the fix:
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/<owner>/<repo>.git/'
gh auth status is the one that says it plainly — The token in keyring is invalid.
The token lives in the macOS keychain under the service name gh-pat, and is
piped from there straight into gh. It is never echoed, never pasted into a
prompt, and never written to a dotfile or an export line.
Procedure
-
Regenerate at https://github.com/settings/tokens. Scopes that this setup actually uses:
repo,read:org,workflow.gh auth statusprints the granted scopes, so compare against that rather than guessing. -
Store it, pasting at the prompt rather than on the command line —
-wwith no value prompts twice and echoes nothing, so the token never enters shell history:security add-generic-password -U -a "$USER" -s gh-pat -w-Uupdates the existing item in place, so rotation reuses one keychain entry instead of accumulating one per rotation. -
Load it into
gh— the pipe is the point: the secret goes keychain →ghwithout a stop in a variable, a file, or the scrollback:security find-generic-password -a "$USER" -s gh-pat -w \ | gh auth login --hostname github.com --git-protocol https --with-token \ && gh auth setup-git -
Verify:
gh auth statusshould report the account logged in via(keyring)and list the scopes. Then the failinggit pushjust works — no new remote, no re-clone.
Two things that silently defeat this
GH_TOKEN/GITHUB_TOKENin the environment outrank the keyring.ghuses the variable and never consults the stored credential, so a stale one exported in a shell profile produces the same auth failure immediately after a successful rotation. Check before diagnosing anything else.
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.
- 24d ago First seen · 92 lines · 101 tokens per session scan A e8a0c2a5d2e0
gh-token-rotate is a skill published in the GitHub repository jamestexas/agents (2 stars, last pushed today), licensed Apache-2.0. It adds 101 tokens to every session and 947 once invoked, about $0.0004 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-11-07.
gh-token-rotate compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| gh-token-rotatejamestexas/agents | Skill | 2 | today | Apache-2.0 | A | 101 | Claude Code |
| commit-messageskyegomez/swarms | Skill | 7.4k | today | Apache-2.0 | A | 23 | Claude Code, Codex |
| git-guardrails-claude-codevinvcn/mattpocock-skills-zh-CN | Skill | 6.2k | yesterday | MIT | B | 68 | Claude Code, Codex |
| changelog-genlaolaoshiren/claude-code-skills-zh | Skill | 928 | yesterday | MIT | A | 88 | Claude Code |
| setup-pre-commitdevcxl/mattpocock-skills-zh | Skill | 568 | today | MIT | A | 70 | Claude Code, Codex |
| release-versionvnotex/vnote | Skill | 13k | yesterday | LGPL-3.0 | A | 86 | Claude Code, Codex |
| artifact-metadatajmagly/aiwg | Skill | 233 | today | MIT | A | 21 | Claude Code, Codex |