plugins/utils/skills/cost-history/SKILL.md
Show cost trends across multiple workflow sessions, surfacing expensive operations, spending patterns, and outliers
npx skillsauth add jmagly/aiwg cost-historyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You show cost trends across multiple workflow sessions. You read historical cost records from .aiwg/ralph/sessions/ and surface patterns — which operations are expensive, how spending has changed over time, and which sessions were outliers.
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
| Pattern | Example | Action |
|---------|---------|--------|
| Full history | "show cost history" | aiwg cost-history |
| Recent sessions | "last 5 sessions" | aiwg cost-history --last 5 |
| Time window | "costs this week" | aiwg cost-history --since 7d |
| Trend summary | "are my costs trending up" | aiwg cost-history --trend |
| Sorted by cost | "most expensive sessions" | aiwg cost-history --sort cost |
When triggered:
Determine scope:
--last N: most recent N sessions--since <duration>: sessions within the time window (e.g., 7d, 30d, 2026-03-01)Read session records:
.aiwg/ralph/sessions/*/metrics.json — per-session cost records.aiwg/ralph/cost-tracking.json — aggregated history indexCompute trend data:
Run the command:
# All sessions, newest first
aiwg cost-history
# Most recent 10 sessions
aiwg cost-history --last 10
# Sessions in the past 30 days
aiwg cost-history --since 30d
# Trend analysis
aiwg cost-history --trend
# Sorted by cost descending
aiwg cost-history --sort cost
# JSON output
aiwg cost-history --json
Cost History (12 sessions)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Date Session Tokens Cost Status
────────── ────────────────────────── ──────── ────── ──────
2026-04-01 sdlc-review-143022 61,250 $0.18 green
2026-03-31 greenfield-092211 94,800 $0.28 green
2026-03-30 security-review-174503 118,400 $0.36 yellow
2026-03-28 api-development-110022 52,100 $0.15 green
2026-03-26 full-stack-iteration-3 201,700 $0.61 red *outlier
...
Totals (12 sessions)
Total tokens: 842,100
Total cost: $2.54
Avg/session: $0.21
7-session rolling average: $0.23
Trend: stable (±8% over last 7 sessions)
--trend)Cost Trend — Last 7 Sessions
Session 6 (oldest): $0.28
Session 5: $0.22
Session 4: $0.36
Session 3: $0.15
Session 2: $0.61 ← outlier (full-stack-iteration-3)
Session 1: $0.18
Current avg: $0.23
Direction: stable
Outliers: 1 (full-stack-iteration-3 — 2.6x average)
Sessions are color-coded by tokens/line ratio against the MetaGPT 124 tokens/line benchmark (REF-013):
| Status | Tokens/Line | Meaning | |--------|-------------|---------| | green | ≤ 124 | At or below MetaGPT benchmark | | yellow | 125–150 | Above benchmark, acceptable | | red | > 150 | Significantly above benchmark — review recommended |
User: "Show cost history"
Action:
aiwg cost-history
Response: Full session history table with totals, rolling average, and trend direction.
User: "What did the last 3 sessions cost?"
Extraction: --last 3
Action:
aiwg cost-history --last 3
Response:
Cost History (last 3 sessions)
Date Session Tokens Cost
────────── ─────────────────────── ─────── ────
2026-04-01 sdlc-review-143022 61,250 $0.18
2026-03-31 greenfield-092211 94,800 $0.28
2026-03-30 security-review-174503 118,400 $0.36
Total: $0.82 over 3 sessions (avg: $0.27)
User: "Which sessions were most expensive?"
Action:
aiwg cost-history --sort cost
Response: History table sorted by cost descending, with outlier flag on sessions more than 2x the rolling average.
If a time window is ambiguous:
data-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.