Skip to content

feat(usage): show and redeem Claude reset credits for hub accounts - #63

Merged
maschwenk merged 1 commit into
mainfrom
max/claude-pool-reset-credits
Nov 11, 2026
Merged

maschwenk merged 1 commit into
mainfrom
max/claude-pool-reset-credits

Conversation

@maschwenk

Copy link
Copy Markdown
Owner

claude pool accounts never showed reset credits in the usage panel. the hub read /api/oauth/usage with a claude-code/2.1.273 user agent, and claude only returns reset grants (cedar_ember) when you pass ?cedar_ember=1 with a current claude-cli/<version> (external, cli) agent. an old version gets ineligible_reason: "cli_version", anything else gets "surface"

what changed
• hub reads claude usage with ?cedar_ember=1 and the installed claude code version (highest enabled claude instance in the provider registry), then maps grants with the existing claudeResetCreditsToContract
• redeem works for claude hub accounts now: looks up the org from /api/oauth/profile, posts to /api/organizations/{org}/reset_rate_limits, then clears the hub cooldown like codex already does
• request id is a uuidv5 of account + grant so a retried click cant spend a grant twice

tradeoff: one request id per account + grant. every grant ive seen has resets_total: 1 so thats fine, but if claude ever packs 2 resets into one grant the second would come back already_used. native macos instances still skip reset credits (token lives in keychain), but the row merge already takes credits from the hub so pooled accounts are covered

live read of my pool on this branch: cathedral 2, max.f 2, maschwenk 4 (one full weekly reset each plus the fable launch resets)

Claude only returns reset grants (cedar_ember) to ?cedar_ember=1 with a
current claude-cli user agent, so the hub read never saw them. Send the
installed Claude Code version, map the grants, and redeem them through
the account's organization.
@maschwenk maschwenk added the coder-task-generated Created from a coding task label Nov 11, 2026
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 11, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Baseline: e1e9d5a · PR result: cd40a51 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@maschwenk
maschwenk marked this pull request as ready for review November 11, 2026 13:20
@maschwenk
maschwenk merged commit 76fa8f5 into main Nov 11, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coder-task-generated Created from a coding task size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant