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 flurdy/agent-skills --skill pi-spendgit clone --depth 1 https://github.com/flurdy/agent-skillsWrote 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/flurdy/agent-skills/pi-spend)<a href="https://agentmods.dev/skills/flurdy/agent-skills/pi-spend"><img src="https://agentmods.dev/badge/skills/flurdy/agent-skills/pi-spend.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.1 | $0.00040 | $0.01392 |
| Opus 5 | $0.00020 | $0.00696 |
| Sonnet 5 | $0.00008 | $0.00278 |
| Haiku 4.5 | $0.00004 | $0.00139 |
Grade A, and why
pi-spend 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 — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pi Spend
Answer "what have my metered models cost me lately" from Pi's own session telemetry. Periods are today, the current week (Monday start), the current calendar month, and all recorded history, all in the machine's local timezone.
Usage
/pi-spend # all four periods, every provider and model
/pi-spend --metered-only # show only responses classified as metered
/pi-spend --period today # single period; repeatable
/pi-spend --json # normalized schema v2 JSON
/pi-spend --billing-policy PATH # use another effective-dated local policy
/pi-spend --router-config PATH # explicit legacy current-policy projection
Resolve scripts/pi_spend.py relative to this SKILL.md and run it with the user's arguments:
/path/to/pi-spend/scripts/pi_spend.py --metered-only
Do not substitute ad-hoc transcript greps or provider billing calls for the collector.
Output contract
Paste the collector's complete stdout verbatim in a fenced code block, even when the tool card
already shows it. Do not summarize, reformat, or truncate the table. Use a json fence for --json
and a plain-text fence otherwise.
Analysis contract
After the verbatim block, add two to four bullets, at most 120 words:
- name the largest metered rows for the requested period and what drove them, distinguishing cache-read volume from fresh input;
- state the metered total separately from the subscription total, and never add them into one "spend" figure;
- call out the
unknownbilling class when present, since it means no valid interval covers that exact provider/model response rather than that the model is free; - call out
legacy-current-router-policyas a current-policy projection that may relabel history; and - mention responses that recorded no cost only when the collector reports some.
Never describe the output as an invoice, an account balance, or remaining credits.
Sources and authority
- Pi sessions:
~/.pi/agent/sessions/**/*.jsonl. Assistant messages carryprovider,model,usage, and a per-responseusage.costbreakdown. Responses are deduplicated byresponseId, so nested subagent run transcripts are counted once. - Billing class:
~/.pi/agent/pi-spend-billing-policy.json, using exact provider/model entries and the interval covering each response timestamp. Missing or invalid coverage reports asunknown; the collector does not guess from provider or model names.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · +51 lines 5570f2c9c122
- 8d ago First seen · 85 lines · 40 tokens per session scan A b12e064d0492
pi-spend is a skill published in the GitHub repository flurdy/agent-skills (9 stars, last pushed yesterday), licensed MIT. It adds 40 tokens to every session and 1,392 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-31.
Other skills, from other repositories
sector-rotation
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.