Summary
codeburn is great at showing where AI spend goes, but it stops at observation. I would like it to help me ACT on spend: set a budget and get told when I am over it. I have this implemented and validated against my own usage, and I am filing first to align on the UX and scope before the PR lands.
There is no spend-budget feature today (context-budget.ts is the model context window, unrelated).
Proposed UX
Set a budget per cadence, in your display currency:
codeburn budget --monthly 100 # also --weekly / --daily
codeburn budget --list
codeburn budget --remove monthly
Two ways it surfaces:
-
In overview, a single line under the totals, only when the period matches a configured budget (today -> daily, last-7-days -> weekly, this-month -> monthly):
Monthly budget: €67.40 of €100.00 (67%) projected €98.20 by month end
colored green under 80%, amber from 80%, red at 100%+. The projection is a simple linear run-rate for the in-progress period.
-
codeburn budget --check for scripting: it prints each configured budget's status and exits non-zero if any is over budget, so you can wire it into a shell prompt, a pre-commit, or a cron/CI step and get a real alert without codeburn shipping any cross-platform notification machinery.
codeburn budget --check || notify-send "Over AI budget"
Design notes (where I would value your steer)
- No notification daemon. The alert mechanism is the
--check exit code, which keeps the feature small and composable and leaves the choice of how to be notified to the user. Happy to revisit if you would rather it integrate elsewhere (e.g. the menubar).
- Budgets are in the display currency (the one
currency sets and overview shows), compared against converted spend.
- The overview budget line is suppressed when a filter is active (
--provider / --project / --exclude), because a global budget next to a filtered subset would be misleading.
- Period windows match
overview exactly: budget --check reuses the same date-range helper per cadence, so the numbers you see in overview and in --check agree.
- Default behavior is unchanged: with no budget configured,
overview output and every other command are byte-for-byte identical.
If this UX looks right I will open the PR (one new src/budget.ts, a budget command, and an overview line, with unit/CLI/render tests). Glad to adjust naming, thresholds, or where it surfaces.
Summary
codeburn is great at showing where AI spend goes, but it stops at observation. I would like it to help me ACT on spend: set a budget and get told when I am over it. I have this implemented and validated against my own usage, and I am filing first to align on the UX and scope before the PR lands.
There is no spend-budget feature today (
context-budget.tsis the model context window, unrelated).Proposed UX
Set a budget per cadence, in your display currency:
codeburn budget --monthly 100 # also --weekly / --daily codeburn budget --list codeburn budget --remove monthlyTwo ways it surfaces:
In
overview, a single line under the totals, only when the period matches a configured budget (today -> daily, last-7-days -> weekly, this-month -> monthly):colored green under 80%, amber from 80%, red at 100%+. The projection is a simple linear run-rate for the in-progress period.
codeburn budget --checkfor scripting: it prints each configured budget's status and exits non-zero if any is over budget, so you can wire it into a shell prompt, a pre-commit, or a cron/CI step and get a real alert without codeburn shipping any cross-platform notification machinery.Design notes (where I would value your steer)
--checkexit code, which keeps the feature small and composable and leaves the choice of how to be notified to the user. Happy to revisit if you would rather it integrate elsewhere (e.g. the menubar).currencysets andoverviewshows), compared against converted spend.--provider/--project/--exclude), because a global budget next to a filtered subset would be misleading.overviewexactly:budget --checkreuses the same date-range helper per cadence, so the numbers you see inoverviewand in--checkagree.overviewoutput and every other command are byte-for-byte identical.If this UX looks right I will open the PR (one new
src/budget.ts, abudgetcommand, and an overview line, with unit/CLI/render tests). Glad to adjust naming, thresholds, or where it surfaces.