feat: Codex and Claude Code usage stats — Settings → Usage page and composer context popover - #323
Merged
Merged
Conversation
Tryanks
enabled auto-merge (squash)
September 4, 2026 21:03
Tryanks
disabled auto-merge
September 4, 2026 21:09
…idersStatus usage fields
…efresh on startup and after turns
Tryanks
force-pushed
the
feat/usage-stats
branch
from
September 4, 2026 21:12
d4d4fc6 to
17746ab
Compare
Tryanks
enabled auto-merge (squash)
September 4, 2026 21:12
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
Adds account usage / rate-limit visibility for Codex and Claude Code, following t3code's approach (ask the provider CLIs; never touch their OAuth tokens):
codex app-server→account/rateLimits/read;claude -p --input-format stream-json→get_usagecontrol request. Normalized into presentation-freetcode_core::usage::{ProviderUsage, UsageWindow}(5h / weekly / model-scoped windows, plan, reset time). Fetched on startup, after each completed turn (throttled to 2 min), and on demand viaCommand::RefreshProviderUsage; flows through the existingProvidersStatussnapshot.Weekly · Fablewindow.Verification
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace— all green.provider_usage::tests::live_provider_usagepasses.TCODE_DATA_DIR): Settings → Usage and both provider popovers render the expected rows; no layout defects.Not exercised: amber/red bar states (usage stayed below 75% during verification), Linux/Windows.