Repository navigation
feat(claude): show banked limit resets and expiry dates - #4
Merged
Merged
Conversation
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
Verified data source and safety
GET https://api.anthropic.com/api/oauth/usage?cedar_ember=1&skip_spend=1, discovered in the installed Claude Code 2.1.319 bundle. The usage-client User-Agent is required; without it, the response is ineligible with reasonsurface.Fields:
cedar_ember.eligible,grants[].resets_left,ends_at,starts_at,type,gives_back_weekly,clears, andpaused.gives_back_weekly: truetakes precedence overtype: fulland uses the neutral New-model label; Fable is used only when the API explicitly names it.The client uses GET for status and a separate POST route for redemption. No redemption route was called or implemented. External credentials are never refreshed or written. All probes were GET; a guarded live CLI check additionally rejected any non-GET fetch. Details and fixture provenance:
docs/claude-limit-resets.md.Live worktree output
Validation
bun test: 785 passed, 0 failed (20 more tests for the review fixes).bun run preflight: passed on the clean committed tree.bun run release:pack: passed,lib/andweb/included.git diff --check: passed.node ./shuvquota.js claude work --compact --no-color): real grants and expiry dates confirmed.No merge requested; main checkout left untouched.
Review fixes
Each requested fix is a separate commit, with a full
bun testpass before committing:5246599— Cache successful reset reads for 15 minutes per SHA-256 token hash; honor reset 429 cooldowns/Retry-After and primary usage cooldowns.3f355d1— Five-second optional reset HTTP timeout, preserving ordinary usage on abort.27c5d61— Centralized User-Agent; lazy cached shell-freeclaude --versiondetection with 1.5-second timeout, fallback/minimum 2.1.319. Documented stale-UA blank sections.335e1a1— 24-hour reset clocks usinghourCycle: "h23", including midnight.18f58e4— Count future grants; preserve safestartsAtand show “from ”.239f5ca— Count unclassifiable grants under Other; neutral New-model labels unless the API explicitly names Fable. Includes an untyped future grant test.0d09391— Invalid display zones retry with local time.a3ec130— README says “Pacific time (the renderer's display time zone)”.c3993d0— Footer/help/docs use “Up next” for upcoming quota resets.Final local validation: 785 passed, 0 failed; clean-tree
bun run preflight,bun run release:pack, andgit diff --checkall passed. Zero runtime dependencies retained.Final real-account worktree check:
node --import <GET-only-guard> ./shuvquota.js claude work --compact --no-color(the worktree'ssqentry point). Exactly two GETs to Claude usage; the guard rejects all other methods/endpoints. The live output above is current; Fable is explicitly named by this account's API response. No credentials refreshed and no reset applied or redeemed.CI verified green at
c3993d0: test and both Socket Security checks passed. PR remains open; do not merge.