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 agentmods add instructions/gotgenes/pi-anthropic-auth/agents-mdgit clone --depth 1 https://github.com/gotgenes/pi-anthropic-authWrote 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/instructions/gotgenes/pi-anthropic-auth/agents-md)<a href="https://agentmods.dev/instructions/gotgenes/pi-anthropic-auth/agents-md"><img src="https://agentmods.dev/badge/instructions/gotgenes/pi-anthropic-auth/agents-md.svg" alt="Measured on agentmods" 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 | $0.07847 | $0.07847 |
| Opus 5 | $0.03923 | $0.03923 |
| Sonnet 5 | $0.01569 | $0.01569 |
| Haiku 4.5 | $0.00785 | $0.00785 |
Grade A, and why
pi-anthropic-auth AGENTS.md 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 today.
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 — 554 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS Guide: pi-anthropic-auth
This file contains shared context for agents working in this repository. Keep it focused on information that multiple agents need: repository purpose, current architecture, constraints, commands, and known gotchas. Do not turn this into a task log.
Project-level reusable workflows belong in .pi/skills/, reusable slash-command flows in .pi/prompts/, and custom subagents in .pi/agents/.
This repo includes repo-specific skills (Anthropic OAuth debugging, Pi CLI repro, frontmatter) plus a shared workflow toolkit (code design, testing, fallow, improvement discovery, pre-completion, and others) kept in parity with ~/development/pi/pi-packages/.
Project
Overview
pi-anthropic-auth is a small pnpm-based Pi package.
Its purpose is to minimally override Pi's built-in anthropic provider to improve Claude Pro/Max OAuth compatibility without breaking Pi's normal Anthropic API-key behavior.
The design intent is explicitly minimal. Prefer wrapping or extending Pi's existing Anthropic behavior over replacing it wholesale.
Primary Goal
Preserve all of Pi's normal Anthropic UX while adding only the compatibility layers Pi still appears to be missing for Claude Pro/Max OAuth.
That means preserving:
- Built-in provider name:
anthropic - Built-in model list
- Normal Anthropic API-key behavior
- Native
/login anthropicUX
Current Status
The current implementation does the following:
- Re-registers the built-in
anthropicprovider with a thinstreamSimpletransport wrapper (login and refresh are delegated to Pi's built-inanthropicOAuth) - Wraps Pi's built-in Anthropic transport to shape OAuth requests on every call path that reaches
provider-composer(main loop and compaction; notagentLoopbackground agents — see Issue #46) - Prepends an Anthropic billing/content-consistency header block to
system[] - Sanitizes Pi's default preamble by anchor during the same shaping pass — removing the Pi identity, custom-tool filler, and Pi documentation paragraphs and replacing only the identity with a minimal neutral prompt — while preserving tool snippets, guidelines, and appended extension content
- Gates all shaping on the
sk-ant-oatOAuth access-token prefix, so API-key and non-Anthropic requests pass through untouched
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.
- today Changed · +62 lines · +1,313 tokens per session 3c0ac52e4f94
- 5d ago First seen · 492 lines · 6,534 tokens per session scan A 9214bd533bcb
pi-anthropic-auth AGENTS.md is an instructions file published in the GitHub repository gotgenes/pi-anthropic-auth (232 stars, last pushed today), licensed MIT. It adds 7,847 tokens to every session, about $0.0392 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.
Other instructions, from other repositories
pi-agent-browser-native AGENTS.md
AGENTS.md instructions for fitchmultz/pi-agent-browser-native, covering pi-agent-browser-native, product-specific guidance, documentation placement, upstream capability baseline and command reference and tool result categories.
pi-codex-goal AGENTS.md
Instructions for fitchmultz/pi-codex-goal, covering pi-codex-goal — agent notes, local pi install policy, verify before finishing and layout.
pi-commandcode-provider AGENTS.md
AGENTS.md instructions for patlux/pi-commandcode-provider, a project described as: pi custom provider for the Command Code API — 18 models including Claude, GPT, DeepSeek, Kimi, GLM, MiniMax, and Qwen.
pi-fancy-footer AGENTS.md
Instructions for mavam/pi-fancy-footer, covering pi-fancy-footer, setup, development and release engineering.
pi-tools AGENTS.md
AGENTS.md instructions for joelhooks/pi-tools: This repo uses pi-notes for durable project memory and local review surfaces.
pi-tools CLAUDE.md
Claude Code instructions for joelhooks/pi-tools: This repo has pi-notes installed. Use the repo Brain as the durable source of project knowledge.