Skip to content

feat: v0.7.1 Claude extra usage spend tracking (alpha)#21

Merged
danielithomas merged 1 commit into
mainfrom
feature/v0.7.1-claude-extra-usage
Apr 10, 2026
Merged

feat: v0.7.1 Claude extra usage spend tracking (alpha)#21
danielithomas merged 1 commit into
mainfrom
feature/v0.7.1-claude-extra-usage

Conversation

@danielithomas
Copy link
Copy Markdown
Owner

@danielithomas danielithomas commented Apr 10, 2026

Summary

  • Extra usage spend (alpha) — parses extra_usage from existing /api/oauth/usage response to show dollar spend beyond subscription cap, gated behind enable_alpha_features
  • Weekly Sonnet (7d) window — new per-model utilisation window discovered in current API response
  • credits unit in formatters — displays as $X.XX with no currency qualifier (values are in user's billing currency, not necessarily USD)
  • Shared alpha warningemit_alpha_warning() extracted to config.py for use by both Claude and Ollama providers
  • SPEC updates — OQ-001, OQ-002, OQ-004, OQ-008 closed with research findings; Section 3.1 updated with extra usage field documentation

Closes #19

Test plan

  • All 469 existing + new tests pass (uv run pytest --ignore=tests/test_daemon.py)
  • Manual test with enable_alpha_features = true — verify Extra Usage window appears in --now output
  • Manual test without alpha flag — verify Extra Usage window is absent
  • Verify Weekly Sonnet (7d) window appears when API returns seven_day_sonnet
  • Verify alpha warning printed to stderr on first invocation

🤖 Generated with Claude Code

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>
@danielithomas danielithomas merged commit 6800410 into main Apr 10, 2026
3 checks passed
@danielithomas danielithomas deleted the feature/v0.7.1-claude-extra-usage branch April 10, 2026 06:39
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.

v0.7.1: Enable Claude extra usage spend tracking (alpha feature)

1 participant