feature: add /codex:usage command to show rate limits and account plan#103
Open
gignac-cha wants to merge 1 commit intoopenai:mainfrom
Open
feature: add /codex:usage command to show rate limits and account plan#103gignac-cha wants to merge 1 commit intoopenai:mainfrom
/codex:usage command to show rate limits and account plan#103gignac-cha wants to merge 1 commit intoopenai:mainfrom
Conversation
Add a new /codex:usage slash command that reads ~/.codex/auth.json and calls the Codex backend usage API to display rate limit status. - New command file: plugins/codex/commands/usage.md - New handler: handleUsage in codex-companion.mjs - New render function: renderUsageReport and formatUsageWindow in render.mjs - Update tests/commands.test.mjs to include usage.md - Add /codex:usage section to README.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
/codex:usageslash command that displays the current account's rate limit status~/.codex/auth.jsonand call the Codex backend usage API (/wham/usage) to fetch rate limitsplugins/codex/commands/usage.mdhandleUsageincodex-companion.mjsrenderUsageReportandformatUsageWindowinlib/render.mjstests/commands.test.mjsto includeusage.mdin the expected command list/codex:usagesection toREADME.mdProblem
There is currently no way to check Codex rate limits from within Claude Code. Users must switch to the Codex TUI and run
/statusto see how much of their 5h or weekly limit remains.Example output
Implementation notes
codex usagesubcommand, so the plugin reads~/.codex/auth.jsondirectly and calls the usage endpoint. The API path (/wham/usage) was identified from the open-source Codex CLI codebase.--jsonflag outputs the raw API response for structured consumption.Testing
usageandusage --jsonoutput manuallycommands.test.mjshardcoded list is updated)Fixes #102