switch-github-creds

A procedure for changing which logged-in GitHub account the command-line tool uses. GitHub is a code-hosting service, and the command-line tool can have several accounts configured.

In plain words
What is it for?
Use it to check the active account, select another logged-in account, and retry Git or GitHub operations with the correct permissions.
Why use it?
It helps resolve permission errors when the currently selected account cannot access a repository or perform an operation.

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/brianv1981/aim/switch-github-creds
Any agent
npx skills add BrianV1981/aim --skill switch-github-creds
Clone the repo
git clone --depth 1 https://github.com/BrianV1981/aim

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 333 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.00017 $0.00333
Opus 5 $0.00009 $0.00167
Sonnet 5 $0.00003 $0.00067
Haiku 4.5 $0.00002 $0.00033

Measured yesterday against content hash 31dc8b8653d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

switch-github-creds 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 yesterday.

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/switch-github-creds/SKILL.md · 32 lines

What it actually says

<activated_skill>

Skill: switch-github-creds

This skill explains how to switch the active GitHub credentials used by the gh CLI tool when you encounter 403 Forbidden errors or permission issues during git push or other GitHub API operations.

Context

When multiple GitHub accounts are logged in via the GitHub CLI, git commands (if configured to use the gh credential helper) and gh API commands will default to the active account. If you attempt to push to a repository that your active account does not have write access to, you will receive a 403 Forbidden error.

Workflow

  1. Check Current Status: Run gh auth status to see all logged-in accounts and identify which one is currently active.

  2. Identify the Correct Account: Determine the username of the account that has permissions to the target repository (e.g., BrianV1981).

  3. Switch the Active Account: Execute the following command to switch the active context to the correct user:

    gh auth switch -u <USERNAME>
    

    Example: gh auth switch -u BrianV1981

  4. Verify and Execute: After switching, you will see a success message (✓ Switched active account for github.com to <USERNAME>). You can now safely execute your git push origin main or other GitHub operations.

</activated_skill>

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. yesterday First seen · 32 lines · 17 tokens per session scan A 31dc8b8653d3

Subscribe to this mod's changes

switch-github-creds is a skill published in the GitHub repository BrianV1981/aim (13 stars, last pushed 19d ago), licensed MIT. It adds 17 tokens to every session and 333 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

excalidraw-diagram

Generate Excalidraw diagrams from text content. Supports three output modes - Obsidian (.md), Standard (.excalidraw), and Animated (.excalidraw with animation order). Triggers on "Excalidraw", "diagram", "standard excalidraw", "animate".

breferrari/obsidian-mind · 67 tokens

mermaid-visualizer

Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, create flowcharts, or make diagrams from text. Supports process flows, system architectures, comparisons, mindmaps, and more with built-in syntax error prevention.

breferrari/obsidian-mind · 57 tokens

qmd

Search the vault using QMD semantic search. Use PROACTIVELY before reading files. Preference order: (1) MCP tools — mcpqmdquery, mcpqmdget, mcpqmdmultiget, mcpqmdstatus — if they appear in your tool menu, use them first; (2) CLI qmd --index ... as fallback; (3) Grep/Glob only when QMD is not installed. Trigger…

breferrari/obsidian-mind · 142 tokens

obsidian-cli

Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their…

breferrari/obsidian-mind · 102 tokens

figure-remap

Extract single figures from PDF textbooks on-demand with built-in QC verification. Primary use: when writing/supplementing a note that needs an embedded figure (anatomy, classification, algorithm, imaging). Each call checks an existing fast-path crop, re-extracts from PDF if missing/wrong, retries with local-vision…

drpwchen/textbook-to-note · 126 tokens

gemini-best-practices

Review and fix Gemini API usage against Google's official best practices. Use when modifying src/core/gemini.ts, adding new API calls, or auditing Gemini integration quality.

takeshy/obsidian-gemini-helper · 40 tokens