Skip to content

feat(usage): each bot's share of the weekly plan - #198

Merged
httpsphl merged 1 commit into
mainfrom
feat/plan-share
Oct 5, 2026
Merged

httpsphl merged 1 commit into
mainfrom
feat/plan-share

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 5, 2026

Copy link
Copy Markdown
Owner

The owner wants to know how much of the weekly plan each bot uses ("Atendente: 0.4%"), more than how many tokens.

How it is measured

  • Anthropic publishes no plan sizes. The plan's rate_limit_event gives the whole account's utilization in whole points, with no per-bot split.
  • The cost of each turn goes to turn_costs, at API list prices. It is the growth of Claude Code's total_cost_usd, which adds up the whole process, per generation. This is exact per model, cache included.
  • Every new reading of a plan window goes to plan_readings.
  • Rate: the rises of the seven_day window between consecutive readings of the same week, over what the bots spent in between, over the last 35 days.
    • A rise with no bot cost in between is left out, as outside use.
    • With fewer than 2 points of rise there is no rate yet.
  • Per bot: BotTokens.planShare = cost × rate, or null before the rate is known.

App

  • The usage dialog becomes "Use by bot": "≈ 0.5% of the week" per bot, with the tokens on the line below and a total.
  • A note says it is an estimate and that use outside Botloft pushes it up. Before there is a rate, the tokens show with a note that the share comes later.
  • New "Last hour" period.

Chief: crew_roster gives week_plan_percent per bot over the last 7 days, and the chief's rules point to it for cost (see #197).

Migration 0023. Spec 8.7.

Tests:

  • tests/plan_share.rs: learned from a 3-point rise over a $1 turn, then the share and the roster.
  • Store tests for costs and readings, and the cost meter.
  • App tests for the share, the period, the note before learning, and the percentage format.

Manual with real Claude: after a few days of bot work, check that the shares add up close to the week's rise.

…an's rise

Anthropic publishes no plan sizes and the plan's usage comes for the
whole account, in whole points. So the daemon keeps what each turn cost
at API list prices (the growth of Claude Code's process total) and each
new reading of the plan's windows, and learns the weekly share per
dollar from how the seven-day window rose while the bots worked; a rise
with no bot cost in between is left out as someone else's use. Each
bot's share is its cost times that. The usage dialog shows '~0.4% of the
week' per bot with the tokens beside it and a last-hour period; the
roster gives the chief week_plan_percent. Spec 8.7.
@httpsphl
httpsphl enabled auto-merge October 5, 2026 16:56
@httpsphl
httpsphl merged commit 3719d2e into main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant