pi-anthropic-auth: Skill for Claude Code

.pi/skills/anthropic/SKILL.md

anthropic is a skill for Claude Code, Codex from gotgenes/pi-anthropic-auth. It costs 49 tokens per session (2,020 once invoked), scanned A, original, MIT.

A repository-specific workflow for making Anthropic Claude OAuth requests work with this project. OAuth is a login method that lets the project use an account without storing its password.

In plain words
What is it for?
Use it when Anthropic OAuth login succeeds but requests fail, especially while comparing request hooks, transport handling, and provider-specific fixes.
Why use it?
It helps diagnose request failures that can appear as usage-limit messages even when the underlying problem is how the request is shaped or sent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions AGENTS.md; mentions OpenCode.

This is gotgenes/pi-anthropic-auth's own configuration. It tells Claude Code and Codex how to work on pi-anthropic-auth itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pi-anthropic-auth configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/chris/development/pi/pi-anthropic-auth/src/index.ts.

Reuse

Borrowing it

Nothing to install: this file belongs to gotgenes/pi-anthropic-auth. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/gotgenes/pi-anthropic-auth/main/.pi/skills/anthropic/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/gotgenes/pi-anthropic-auth

Made for: Claude Code, Codex.

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 anthropic

README.md
[![agentmods](https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/anthropic/github.svg)](https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/anthropic)
Your own site
<a href="https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/anthropic"><img src="https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/anthropic/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 anthropic

Your own site · 80×15
<a href="https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/anthropic"><img src="https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/anthropic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,020 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.00049 $0.02020
Opus 5 $0.00024 $0.01010
Sonnet 5 $0.00010 $0.00404
Haiku 4.5 $0.00005 $0.00202

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

Security

Grade A, and why

anthropic 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 9d 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.

.pi/skills/anthropic/SKILL.md · 147 lines

How it starts

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

Anthropic OAuth Compatibility

Use When

  • Anthropic OAuth requests fail with You're out of extra usage.
  • Pi Anthropic OAuth works for login but fails for actual requests.
  • You need to compare Pi, OpenCode, and opencode-anthropic-auth behavior.
  • You need to decide whether a fix belongs in before_provider_request, the streamSimple transport wrapper, or a deeper override.

Core Lessons

  1. Treat Anthropic's You're out of extra usage. error as a possible disguised request rejection, not only a billing problem.
  2. Prefer the thinnest fix that works.
  3. Preserve Pi's built-in Anthropic behavior by default.
  4. Prefer request shaping before prompt rewriting.
  5. Avoid streamSimple unless hooks are clearly insufficient — they are insufficient for compaction and background-agent calls, which is why this repo wraps the transport (Issue #18).

Repo-Specific Findings

Confirmed Pi upstream behavior

  • Pi already handles Claude Code OAuth headers, Claude Code identity injection, native Anthropic OAuth login, and tool-name normalization.
  • Pi auth storage already refreshes OAuth tokens under a lock.

Confirmed local fixes

  • OAuth Anthropic payload shaping prepends an x-anthropic-billing-header system block.
  • The billing block must not add cache_control, or Anthropic can reject the request for exceeding the cache-control block limit.
  • Assistant message ordering must be normalized when Pi serializes [tool_use..., text] for Anthropic.
  • Pi's default system prompt can act as an Anthropic fingerprint and trigger disguised rejection errors.
  • Shaping runs in a thin streamSimple transport wrapper (delegating to Pi's built-in Anthropic transport, resolved from the installed pi-ai layout), gated on the sk-ant-oat token.
  • The wrapper covers the main loop and compaction — everything that dispatches through modelRuntime.
  • On pi >=0.80.8, agentLoop background agents and extensions calling pi-ai's compat.streamSimple directly are confirmed uncovered, and cannot be covered from this extension (Issue #46); see docs/architecture.md for why, and for the agent.streamFunction workaround.

Read the full file on GitHub · 147 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. 9d ago First seen · 147 lines · 49 tokens per session scan A b6f22c5f324d

Subscribe to this mod's changes

anthropic is a skill published in the GitHub repository gotgenes/pi-anthropic-auth (241 stars, last pushed 4d ago), licensed MIT. It adds 49 tokens to every session and 2,020 once invoked, about $0.0002 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

surf

Control Chrome browser via CLI for testing, automation, and debugging. Use when the user needs browser automation, screenshots, form filling, page inspection, network/CPU emulation, DevTools streaming, or AI queries via ChatGPT/Gemini/Perplexity/Grok/AI Studio.

w-winter/dot314 · 60 tokens

auth-patterns

Use when implementing authentication (JWT, sessions, OAuth), authorization (RBAC, ABAC), password hashing, MFA, or security best practices for backend services.

MadAppGang/claude-code · 36 tokens

watcha-oauth

A guide to adding Watcha sign-in to a website or mobile app through OAuth 2.0, a standard way for users to grant access without sharing their password.

LSTM-Kirigaya/jinhui-skills · 79 tokens

zhihu-oauth

A guide to adding Zhihu sign-in to a web application through OAuth 2.0, a standard way for users to grant another service limited access without sharing their password.

LSTM-Kirigaya/jinhui-skills · 67 tokens

n8n-integration-testing-patterns

API contract testing, authentication flows, rate limit handling, and error scenario coverage for n8n integrations with external services. Use when testing n8n node integrations.

summarybotng/summarybot-ng · 42 tokens

prisma-database-setup

Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".

KhaledSaeed18/node-express-boilerplate · 67 tokens