/ccam-cost-guard:spend-forecastfrom ccam-cost-guard
Forecasts Claude Code spend to week/month-end by extrapolating daily session trends from the Agent Monitor dashboard. Uses moving averages of daily spend times days remaining added to spend-to-date.
Ships in ccam-cost-guard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Project where Claude Code spend will end up by the close of the current week or month.
The user provides: $ARGUMENTS
This is the forecast horizon — "week", "month", or a specific date. Default to
month (calendar month-end) when nothing is given, and state the horizon you used.
| Endpoint | Returns |
|---|---|
GET /api/analytics | { total_cost, tokens (effective totals, baselines pre-summed), daily_sessions (365d: [{ date, count }]), daily_events, overview, ... } — daily_sessions is the trend the forecast extrapolates |
GET /api/pricing/cost | { total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] } — authoritative spend-to-date and avg cost-per-session input |
GET /api/sessions?limit=200 | Session list with inline cost and started_at — group by day for a sharper daily-spend curve than the count-based approximation |
Spend has no native per-day field, so build a daily-spend series and extrapolate:
total_cost from /api/pricing/cost.total_cost / total_session_count.daily_spend[d] ≈ daily_sessions[d].count × avg_cost_per_session. For a sharper curve, instead sum inline session cost grouped by DATE(started_at).avg_daily_spend = mean(daily_spend over the trailing 7 days). Also compute a 14-day average to gauge whether the trend is accelerating (▲) or cooling (▼).projected_total = spend_to_date_this_period + (avg_daily_spend × days_remaining).Spend-to-date this period: when the trend covers more than the current period, restrict the spend-to-date term to sessions whose
started_atfalls inside the current week/month so the projection isn't inflated by older spend.
total_cost, session count, avg cost/session, and how much falls inside the current period.
The 7-day and 14-day moving averages of daily spend, with a ▲/▼ accelerating-vs-cooling read. Show the last 7 days as a compact table (date, sessions, est. spend).
avg_daily_spend × days_remaining and the resulting projected_total for the horizon. State the days-remaining count explicitly.
If the user mentions a budget, show projected vs. budget, the over/under delta, and the date the budget is projected to be crossed (days_to_budget = (budget − spend_to_date) / avg_daily_spend).
Note that the forecast assumes the recent daily pace holds, that daily spend is approximated from session counts unless an inline-cost curve was used, and call out any low-data horizons (e.g. fewer than 7 active days).
Markdown with the trend table and the projection. Currency as USD to 4 decimal places; show moving averages and the projected total prominently. Deltas with ▲/▼.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/budget-setDefine a spend budget for Claude Code and, optionally, create a cost alert rule that fires when usage crosses the limit, via POST /api/alerts/rules on the Agent Monitor dashboard. Reads current spend from /api/pricing/cost to size the budget sensibly and explains every rule field before writing. Use when setting a spend limit or wiring up a budget guardrail.
/cost-alertReview the configured cost alert rules and the alerts currently fired on the Agent Monitor dashboard, then explain exactly what tripped and why. Uses /api/alerts (fired feed) and /api/alerts/rules (definitions). Use when checking spend alerts or asking why a cost alarm went off.
/5 plugins ship this exact skill · first indexed Aug 10, 2026
npx claudepluginhub hoangsonww/claude-code-agent-monitor --plugin ccam-cost-guardOther plugins' skills for the same job