Skip to content

feat: add live-refreshing usage-limits view to watch command - #18

Merged
coldhighsun merged 1 commit into
mainfrom
feat/usage-limits-view
Sep 14, 2026
Merged

feat: add live-refreshing usage-limits view to watch command#18
coldhighsun merged 1 commit into
mainfrom
feat/usage-limits-view

Conversation

@coldhighsun

Copy link
Copy Markdown
Owner

Summary

  • Approximate Claude Pro/Max's "Current Session" (rolling 5-hour window) and "This Week" usage panels from local session transcripts, since the real reset anchors and quotas live only on the Anthropic account and can't be read locally.
  • SessionBlockBuilder derives the current 5-hour block via ccusage-style idle-gap detection, or pins it to a user-supplied --session-anchor that rolls forward to the current period on each read; the weekly window falls back to a rolling 7-day estimate, or pins to a --week-anchor day/time.
  • watch now defaults its --view to limits; --session-anchor/--week-anchor are parsed, persisted to %LOCALAPPDATA%/aimon/limits-settings.json, and prompted for interactively when missing and the terminal is interactive.

Test plan

  • dotnet build AIUsageMonitor.slnx
  • dotnet test AIUsageMonitor.slnx (50/50 passing)
  • Manual CLI verification: aimon watch (default limits view), --session-anchor/--week-anchor parsing, persistence to limits-settings.json, and error messages for invalid anchor formats

Approximate Claude Pro/Max's "Current Session" (rolling 5-hour window)
and "This Week" usage panels from local session transcripts, since the
real reset anchors and quotas live only on the Anthropic account and
cannot be read locally.

- SessionBlockBuilder derives the current 5-hour block via ccusage-style
  gap detection, or pins it to a user-supplied --session-anchor that
  rolls forward to the current period on each read.
- Weekly window falls back to a rolling 7-day estimate, or pins to a
  --week-anchor day/time.
- `watch` now defaults its --view to `limits`; --session-anchor/
  --week-anchor are parsed, persisted to
  %LOCALAPPDATA%/aimon/limits-settings.json, and prompted for
  interactively when missing and the terminal is interactive.
@coldhighsun
coldhighsun merged commit 2ba076c into main Sep 14, 2026
4 checks passed
@coldhighsun
coldhighsun deleted the feat/usage-limits-view branch September 14, 2026 10:18
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