Skip to content

Claude: surface per-model weekly quota carve-outs (Fable 5) from limits[] — port of steipete/CodexBar#1851 #166

Description

@sakurastudio365

Summary

The Claude provider does not surface per-model weekly quota carve-outs (e.g. Fable 5 on Max plans). The Claude desktop app shows a separate "Fable" weekly bar, but Win-CodexBar only shows Session + Weekly (all models).

Upstream macOS CodexBar already implemented this: steipete#1851 ("Claude: surface per-model weekly quota carve-outs (e.g. Fable 5) from limits[]"), with ClaudeScopedWeeklyLimitMapper.swift and follow-ups (steipete#1837, steipete#1887). It would be great to port that to the Rust providers.

Why the current parsers miss it

Anthropic now returns model-scoped weekly limits only in the newer limits array of GET https://api.anthropic.com/api/oauth/usage. The legacy fields stay null, and both providers/claude/oauth/mod.rs (OAuthUsageResponse) and providers/claude/web_api.rs only deserialize the legacy seven_day_* fields, so the scoped window is dropped.

Real response from a Max 5x account today (values rounded, identifiers removed):

{
  "five_hour":  { "utilization": 5.0,  "resets_at": "2026-07-11T14:30:00+00:00" },
  "seven_day":  { "utilization": 6.0,  "resets_at": "2026-07-16T10:00:00+00:00" },
  "seven_day_opus": null,
  "seven_day_sonnet": null,
  "limits": [
    { "kind": "session",       "group": "session", "percent": 5, "resets_at": "...", "scope": null },
    { "kind": "weekly_all",    "group": "weekly",  "percent": 6, "resets_at": "...", "scope": null },
    { "kind": "weekly_scoped", "group": "weekly",  "percent": 7, "resets_at": "...",
      "scope": { "model": { "id": null, "display_name": "Fable" }, "surface": null },
      "is_active": true }
  ]
}

Suggested behavior (matching upstream)

Parse limits[], and for each kind == "weekly_scoped" entry with a scope.model.display_name, push a NamedRateWindow into extra_rate_windows (e.g. id claude-weekly-scoped-fable, title Fable) so it renders like the existing scoped windows the CLI source already produces. The CLI-source parser (extract_cli_scoped_weekly_limits) already handles arbitrary model names generically — the OAuth/web sources just need the same data from limits[].

Happy to test a build on Windows 11 — this machine reproduces it consistently. Thanks for the great app!

Environment: Win-CodexBar 0.41.3 (winget), Windows 11 Pro, Claude Max 5x, source = oauth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions