一键导入
cost-report
Weekly API cost report — computes dollar costs from token usage, flags anomalies, forecasts burn, and prescribes concrete optimizations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Weekly API cost report — computes dollar costs from token usage, flags anomalies, forecasts burn, and prescribes concrete optimizations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Audit every enabled skill's upstream file dependencies for staleness — flags chained skills about to consume yesterday's article or a long-dead topic file
Audit .github/workflows and composite actions with zizmor + actionlint, classify findings against the prior audit, auto-fix Critical/High regressions, and open a PR only when something actually changed.
Weekly partial-correlation of compute economics against a Hyperliquid macro basket — DePIN-token proxy track runs every week (n>180d), sweep-P&L track defers until n≥30 joined days
Score frontier LLMs (Claude, GPT, Gemini, DeepSeek, Grok) on a private compute-markets task corpus, track score deltas across releases, flag public-vs-private divergence
Save a note as one or more atomic notes under memory/notes/ (and optionally Supernotes). Splits bundled inputs into separate atomic files.
Regenerate notegraph.json + docs/notegraph.md + docs/notegraph.html from memory/ and docs/, PR + notify only when the graph changes
| name | cost-report |
| description | Weekly API cost report — computes dollar costs from token usage, flags anomalies, forecasts burn, and prescribes concrete optimizations |
| var | |
| tags | ["meta"] |
| version | 2.0.0 |
${var} — Number of days to cover (default: 7). Pass "30" for a monthly view.
Today is ${today}. Generate a cost report from Aeon's token usage data. The output must prescribe action, not just describe spend — every section either names an anomaly, forecasts risk, or recommends a concrete move.
First read aeon.yml and find the gateway.provider value. Use the matching table.
| Model | Input | Output | Cache Read | Cache Write |
|---|---|---|---|---|
| claude-opus-4-7 | $15.00 | $75.00 | $1.50 | $18.75 |
| claude-sonnet-4-6 | $3.00 | $15.00 | $0.30 | $3.75 |
| claude-haiku-4-5-20251001 | $0.80 | $4.00 | $0.08 | $1.00 |
| Model | Input | Output |
|---|---|---|
| claude-opus-4-7 | $5.00 | $25.00 |
| claude-sonnet-4-6 | $3.00 | $15.00 |
| claude-haiku-4-5-20251001 | $0.80 | $4.00 |
| gemini-3-pro | $1.25 | $10.00 |
| gemini-3-flash | $0.15 | $0.60 |
| gpt-5.2 | $2.50 | $10.00 |
| kimi-k2.5 | $1.00 | $4.00 |
| qwen3-coder | $0.50 | $2.00 |
Bankr does not expose cache read/write pricing separately. Treat cache columns as $0 for Bankr rows.
If a CSV row references a model not in the active table, treat it as an unknown model: price it at Opus rates (conservative), add it to the "Pricing drift" callout in the report so rates can be updated, and continue. Do not crash.
${var} is a positive integer (e.g. "30"), use that many days.CUTOFF_DATE = today − N days. All rows where date >= CUTOFF_DATE are in-window.2 × N days of history, also compute PRIOR_CUTOFF = today − 2N days for week-over-week.memory/token-usage.csvdate,skill,model,input_tokens,output_tokens,cache_read,cache_creationCOST_REPORT_SKIP: no token-usage.csv yet and stop (no notification).COST_REPORT_SKIP: no runs in last N days and stop.csv_malformed for the source-status footer.Compute every aggregate in steps 3 and 4 with node -e (or jq), not by hand. Reasoning through 100+ CSV rows step-by-step has timed out at the 30-minute job wall on Sonnet 4.6 — 2026-06-08 hit cf=3 consecutive failures, all ~29m+ wall time. The arithmetic is deterministic; do not spend inference tokens on it. Pipe memory/token-usage.csv through node -e to emit per-row costs, per-skill totals, per-model totals, and the (skill,model) µ/σ pairs as one JSON blob, then read the JSON back to build the report.
For each valid in-window row, look up the model's rates and calculate:
input_cost = input_tokens / 1e6 × rate_input
output_cost = output_tokens / 1e6 × rate_output
cache_read_cost = cache_read / 1e6 × rate_cache_read
cache_write_cost = cache_creation / 1e6 × rate_cache_write
row_cost = input_cost + output_cost + cache_read_cost + cache_write_cost
a. Total cost for the window (and break out input/output/cache_read/cache_write dollar shares).
b. Per-skill — top 10 by cost. Columns: Skill | Runs | Total Tokens | Cost | Avg Cost/Run.
c. Per-model — total runs, total tokens, total cost per model.
d. Week-over-week — only if ≥ 2N days of history. delta_pct = (this_window − prior_window) / prior_window.
Compose one sentence that captures the week. Pattern:
"Spent $X.XX across N runs ({{↑/↓ Y% WoW | no prior-week baseline}}); M anomalies flagged, projected monthly burn ~$Z.ZZ."
For each (skill, model) pair with ≥ 3 runs in-window:
row_cost.row_cost > µ + 2σ AND row_cost > $0.10 (ignore sub-cent noise).Output a table: Skill | Model | When | Run Cost | vs µ | Why (tokens_input / tokens_output / cache_write). If no anomalies, write "No anomalies." — do not omit the section.
daily_avg_cost = total_cost / Nprojected_monthly = daily_avg_cost × 30Scan the in-window data and produce up to 3 concrete recommendations. Each must name (i) a specific skill, (ii) a specific change, (iii) estimated weekly savings. Candidate patterns:
claude-opus-4-7, its median output_tokens / input_tokens ratio across runs is < 0.3, AND its avg run cost > $0.25. → Suggest Sonnet; savings = this_skill_cost × (1 − sonnet_rate_mix / opus_rate_mix).cache_read / (cache_read + input_tokens) ratio < 0.2 across runs AND avg run cost > $0.10. → "Add a stable prompt prefix so Claude Code can cache it — would move ~X% of input tokens to cache_read at 10× savings."aeon.yml sets a model: override for the skill but the CSV shows runs on a different model. → "Model override drift — aeon.yml says X, runs show Y."articles/ file, no notification). → "Possible no-op loop."If fewer than 3 candidates pass the filters, say so — do not pad. If zero candidates, write "No optimization levers found this week."
If any CSV row referenced a model not in the active pricing table, list those model names and the total tokens attributed to them. Note: "Add rates to skills/cost-report/SKILL.md." If all rows matched, omit this block.
Path: articles/cost-report-${today}.md. If the file already exists, overwrite it (idempotent).
# Aeon Cost Report — ${today}
*Period: last N days · gateway: {{direct|bankr}}*
> {{verdict line from 5a}}
## Anomalies
{{table from 5b, or "No anomalies."}}
## Burn forecast
- Daily avg: $X.XX
- 30-day projection: $X.XX {{⚠ burn-rate watch if >$50}}
## Optimization opportunities
1. **{{skill}}** — {{action}}. Est. savings: ~$X.XX/week.
2. ...
3. ...
{{or "No optimization levers found this week."}}
## Cost by Skill (Top 10)
| Skill | Runs | Tokens | Cost | Avg/Run |
|-------|------|--------|------|---------|
## Cost by Model
| Model | Runs | Tokens | Cost |
|-------|------|--------|------|
## Composition
- Input: $X.XX · Output: $X.XX · Cache read: $X.XX · Cache write: $X.XX
## Week-over-week
- This window: $X.XX · Prior window: $X.XX · Δ {{+/−}}X% {{or "no prior-week baseline"}}
## Pricing drift
{{list of unknown models, or omit if none}}
---
*Sources: token-usage.csv ({{ok|degraded: M malformed rows skipped}}) · aeon.yml ({{ok|missing}}) · pricing table last reviewed in SKILL.md.*
*Generated by Aeon cost-report skill.*
./notifyLead with the verdict, then the top 3 actions. Keep under ~15 lines.
*Cost Report — ${today} (last N days)*
{{verdict line from 5a}}
Top 3 by cost:
1. skill-a — $X.XX (N runs)
2. skill-b — $X.XX
3. skill-c — $X.XX
{{If any optimization opportunities:}}
Actions this week:
• {{skill}} → {{action}} (~$X.XX/wk)
• ...
{{If any anomalies:}} ⚠ M anomalies flagged — see report.
{{If pricing drift:}} ⚠ unknown models in CSV — see report.
30-day projection: $X.XX
Full: articles/cost-report-${today}.md
memory/logs/${today}.md## Cost Report
- Period: last N days (gateway: {{direct|bankr}})
- Total: $X.XX across N runs
- Verdict: {{copy verdict line}}
- Anomalies flagged: M
- Monthly projection: $X.XX
- Optimization suggestions: {{count}} ({{brief list}})
- Week-over-week: +/-X% (or "no baseline")
- Pricing drift: {{none | list of unknown models}}
- Source status: csv={{ok|degraded}}, aeon.yml={{ok|missing}}
- Article: articles/cost-report-${today}.md
- Notification sent via ./notify
No outbound network required — this skill only reads local files (memory/token-usage.csv, aeon.yml). If future versions pull the Anthropic Usage/Cost API, use WebFetch as the fallback for sandboxed curl, and cache results to .xai-cache/ via a pre-fetch script (see CLAUDE.md).
node -e or jq. See step 3.