---
name: trial-costs
description: Sum agent-trial spend ($) from TB3 PR comments and Modal compute spend. Reports totals by kind (/run vs /cheat) and provider (anthropic, openai, ...), top-spender PRs, per-task latest trial cost, and daily Modal billing. Use when the user asks how much was spent on agent trials, cost breakdown by provider, PR-level spend, or Modal usage.
allowed-tools: Bash
---

Run the trial-costs tool and summarize the output for the user.

Default invocation (last 7 days):
```
uv run tools/trial-costs/trial_costs.py
```

Flags:
- `--days N` — change window (default 7)
- `--since YYYY-MM-DD` — explicit start date
- `--top-threshold N` — top-spender PR threshold in dollars (default 100)
- `--no-modal` — skip the Modal billing report at the end

Pass through whatever window the user asked for. If they didn't specify, default to 7 days.

After running, summarize for the user:
- Grand total and split by `/run` vs `/cheat`
- Per-provider totals
- Top-spender PRs above the threshold (with titles)
- Per-task latest `/run` trial cost table (one row per PR)

Keep the summary tight — the script already prints formatted tables; don't re-format them all, just lift the key numbers and mention any notable patterns (e.g. one PR responsible for a large fraction).
