Repository navigation
feat(usage): each bot's share of the weekly plan - #198
Merged
Merged
Conversation
…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
enabled auto-merge
October 5, 2026 16:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
rate_limit_eventgives the whole account'sutilizationin whole points, with no per-bot split.turn_costs, at API list prices. It is the growth of Claude Code'stotal_cost_usd, which adds up the whole process, per generation. This is exact per model, cache included.plan_readings.seven_daywindow between consecutive readings of the same week, over what the bots spent in between, over the last 35 days.BotTokens.planShare= cost × rate, ornullbefore the rate is known.App
Chief:
crew_rostergivesweek_plan_percentper 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.Manual with real Claude: after a few days of bot work, check that the shares add up close to the week's rise.