Summary
Add predictive alerts that warn users when they are on track to hit a provider usage limit before the next reset. This builds on the existing pace indicator and usage-history data to turn raw numbers into actionable warnings.
Why
Right now users can see current usage and a pace indicator, but they have to do the math themselves to understand whether they will run out of quota before it resets. A simple projection removes the guesswork and prevents unexpected cutoffs in the middle of work.
How it should work
-
Projection source
- Use the existing per-metric
used/limit values from the latest probe.
- Use the existing
pace data (or derive velocity from usage-history.json snapshots).
- Use
resetsAt / periodDurationMs from the progress line to know the time window.
-
Prediction calculation
- Compute average consumption per hour over the last N snapshots (e.g. last 24h or since reset, whichever is shorter).
- Extrapolate to
resetsAt.
- If projected
used >= limit, calculate the estimated depletion time.
-
Alert thresholds
- Predict depletion within 24 hours → warning notification.
- Predict depletion within 4 hours → critical notification.
- Optional per-provider setting to disable or change thresholds.
-
Notification content examples
- "Claude session: at current pace you will hit the limit around 18:00 today."
- "Cursor credits: projected to run out in ~3 hours."
- "Codex weekly: on track to exceed the limit by tomorrow morning."
-
Where to surface
- OS notification (will require adding the Tauri notification plugin).
- Inline warning badge on the provider card in the panel.
- Optional "Predictions" section in provider detail.
-
Dampening / noise control
- Send at most one alert per provider per metric per day.
- Re-check only after each successful probe or when pace changes significantly.
- Do not alert if usage is flat or data is insufficient (<3 snapshots).
UI / settings
- Add a global toggle: "Predictive alerts" in Settings.
- Add per-provider toggles in provider settings or context menu.
- Allow choosing thresholds: 24h / 12h / 4h / 1h before depletion.
Acceptance criteria
Related code / files
- Pace indicator:
src/components/provider-card.tsx
- Usage history storage:
src-tauri/src/local_http_api/usage_history.rs
- Plugin runtime output (progress lines):
src-tauri/src/plugin_engine/runtime.rs
- Settings persistence:
src/lib/settings.ts
- Notifications would need Tauri
notification plugin.
Mock alert message
Claude session limit expected today
At your current pace the session quota will be used around 18:00, before the daily reset at 21:00.
[Open OpenUsage] [Dismiss]
Summary
Add predictive alerts that warn users when they are on track to hit a provider usage limit before the next reset. This builds on the existing pace indicator and usage-history data to turn raw numbers into actionable warnings.
Why
Right now users can see current usage and a pace indicator, but they have to do the math themselves to understand whether they will run out of quota before it resets. A simple projection removes the guesswork and prevents unexpected cutoffs in the middle of work.
How it should work
Projection source
used/limitvalues from the latest probe.pacedata (or derive velocity fromusage-history.jsonsnapshots).resetsAt/periodDurationMsfrom the progress line to know the time window.Prediction calculation
resetsAt.used>=limit, calculate the estimated depletion time.Alert thresholds
Notification content examples
Where to surface
Dampening / noise control
UI / settings
Acceptance criteria
Related code / files
src/components/provider-card.tsxsrc-tauri/src/local_http_api/usage_history.rssrc-tauri/src/plugin_engine/runtime.rssrc/lib/settings.tsnotificationplugin.Mock alert message