pi-anthropic-auth: Skill for Claude Code

.pi/skills/pi-extension-lifecycle/SKILL.md

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

A reference guide to the Pi coding agent's turn and tool-execution lifecycle. It explains the order in which messages, model responses, extension events, and tool calls happen.

In plain words
What is it for?
Use it when designing extension event handlers, deciding when to flush or notify, intercepting tool calls, or reasoning about what the agent sees between turns.
Why use it?
It removes uncertainty about when an extension can inspect, change, block, or react to agent activity. This helps avoid timing bugs in extensions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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 →

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/pi-extension-lifecycle/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 pi-extension-lifecycle

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/pi-extension-lifecycle"><img src="https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/pi-extension-lifecycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,731 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00040 $0.02731
Opus 5.5 $0.00016 $0.01092
Sonnet 5.5 $0.00008 $0.00546
Haiku 4.5 $0.00004 $0.00273

Measured 1mo ago against content hash 84add1f7a2f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pi-extension-lifecycle 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 1mo 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/pi-extension-lifecycle/SKILL.md · 265 lines

How it starts

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

Pi Extension Lifecycle Reference

Agent loop structure (from source)

Source: packages/agent/src/agent-loop.ts in pi-mono.

agent_start
│
▼
OUTER LOOP ─────────────────────────────────────────────────
│ INNER LOOP (while hasMoreToolCalls || pendingMessages)
│ │
│ │  turn_start
│ │      │
│ │      ▼
│ │  Process pendingMessages
│ │  (steering messages from previous turn are injected
│ │   as user/custom messages BEFORE the LLM call)
│ │      │
│ │      ▼
│ │  context event (extensions can modify messages)
│ │  before_provider_request
│ │      │
│ │      ▼
│ │  ┄┄┄ LLM generates response ┄┄┄
│ │      │
│ │      ▼
│ │  after_provider_response
│ │  message_start → message_update(s) → message_end
│ │      │
│ │      ▼
│ │  Extract tool calls from assistant message
│ │      │
│ │      ▼
│ │  Execute tool calls SEQUENTIALLY:
│ │  ┌──────────────────────────────────────────────┐
│ │  │ For each tool call:                          │
│ │  │   tool_execution_start                       │
│ │  │   tool_call (beforeToolCall)                  │
│ │  │     → can BLOCK (returns error to agent)     │
│ │  │     → can MODIFY input (mutate event.input)  │
│ │  │     → handler is AWAITED before tool runs    │
│ │  │   ┄┄┄ tool executes ┄┄┄                      │
│ │  │   tool_execution_end                         │
│ │  │   tool_result (afterToolCall)                 │
│ │  │     → can MODIFY result content/details      │
│ │  │     → handler is AWAITED                     │
│ │  └──────────────────────────────────────────────┘
│ │      │
│ │      ▼
│ │  turn_end  ← AWAITED before next turn_start
│ │      │
│ │      ▼
│ │  shouldStopAfterTurn? (not used by coding-agent)
│ │      │
│ │      ▼
│ │  pendingMessages = getSteeringMessages()
│ │      │
│ │  └── loop back if hasMoreToolCalls || pendingMessages
│ │
│ ▼
│ followUpMessages = getFollowUpMessages()
│ if followUp messages → pendingMessages = followUp, continue outer loop
│ else → break
│
└───────────────────────────────────────────────────────────
│
▼
agent_end

Read the full file on GitHub · 265 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. 1mo ago Changed · -4 lines · -30 tokens per session 84add1f7a2f0
  2. 2mo ago First seen · 269 lines · 70 tokens per session scan A 29a9719e46e8

Subscribe to this mod's changes

pi-extension-lifecycle is a skill published in the GitHub repository gotgenes/pi-anthropic-auth (426 stars, last pushed 13d ago), licensed MIT. It adds 40 tokens to every session and 2,731 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories