feat: v0.7.1 Claude extra usage spend tracking (alpha)#21
Merged
Conversation
Parse extra_usage object from /api/oauth/usage response to show dollar spend beyond the subscription cap, gated behind enable_alpha_features. Also parse seven_day_sonnet window and add credits unit to formatters. - providers/claude.py: parse extra_usage (is_enabled, monthly_limit, used_credits, utilization), seven_day_sonnet, seven_day_cowork windows. Extra Usage window with raw_value/raw_limit in dollars (cents/100). Alpha-gated with shared emit_alpha_warning() from config.py. - config.py: extract emit_alpha_warning() as shared utility - formatters: add "credits" unit to table_fmt.py and monitor_fmt.py (panel + compact) — displays as $X.XX, no percentage bar - providers/ollama.py: use shared emit_alpha_warning() from config.py - SPEC: close OQ-001, OQ-002, OQ-004, OQ-008 with research findings, update Section 3.1, tick off v0.7.1 checklist - 11 new tests, 469 total pass Closes #19 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
extra_usagefrom existing/api/oauth/usageresponse to show dollar spend beyond subscription cap, gated behindenable_alpha_featurescreditsunit in formatters — displays as$X.XXwith no currency qualifier (values are in user's billing currency, not necessarily USD)emit_alpha_warning()extracted toconfig.pyfor use by both Claude and Ollama providersCloses #19
Test plan
uv run pytest --ignore=tests/test_daemon.py)enable_alpha_features = true— verify Extra Usage window appears in--nowoutputseven_day_sonnet🤖 Generated with Claude Code