codex - 💡(How to fix) Fix Expose rate-limit reset times, balance, plan as status_line tokens

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The CLI status_line exposes five-hour-limit and weekly-limit as percentages only. The underlying rate-limit data is richer — account/rateLimits/read returns resetsAt, windowDurationMins, credits.balance, planType — but those fields aren't reachable via status_line tokens.

Root Cause

The CLI status_line exposes five-hour-limit and weekly-limit as percentages only. The underlying rate-limit data is richer — account/rateLimits/read returns resetsAt, windowDurationMins, credits.balance, planType — but those fields aren't reachable via status_line tokens.

Fix Action

Workaround

Spawn codex app-server from outside, JSON-RPC handshake, call account/rateLimits/read, parse, render. Works but adds ~3-5s subprocess startup per query and requires users to build their own caching layer. The data is already there inside the running CLI; surfacing it as a token is a small change.

Code Example

... · 5h 80% @11:36pm · weekly 83% @5/27 5:40am · ...

---

{
  "rateLimits": {
    "limitId": "codex",
    "primary": { "usedPercent": 25, "windowDurationMins": 300, "resetsAt": 1779459394 },
    "secondary": { "usedPercent": 18, "windowDurationMins": 10080, "resetsAt": 1779826837 },
    "credits": { "hasCredits": true, "unlimited": false, "balance": "766.76..." },
    "planType": "prolite",
    "rateLimitReachedType": null
  },
  "rateLimitsByLimitId": { ... }
}

---

status_line = ["model-with-reasoning", "codex-version", "context-remaining",
               "five-hour-limit", "five-hour-limit-reset",
               "weekly-limit", "weekly-limit-reset",
               "credits-balance", "project", "git-branch"]

---

gpt-5.5 high · 0.133.0 · Context 28% left · 5h 25% @11:36pm · weekly 18% @5/27 5:40am · $766.76 · self-service-workbench · main
RAW_BUFFERClick to expand / collapse

Summary

The CLI status_line exposes five-hour-limit and weekly-limit as percentages only. The underlying rate-limit data is richer — account/rateLimits/read returns resetsAt, windowDurationMins, credits.balance, planType — but those fields aren't reachable via status_line tokens.

Missing tokens (as of 0.133.0)

  1. five-hour-limit-reset — formatted local time of primary.resetsAt
  2. weekly-limit-reset — formatted local time of secondary.resetsAt
  3. credits-balancecredits.balance (e.g. $766.76) when credits.hasCredits && !credits.unlimited
  4. plan-typeplanType (e.g. prolite)
  5. (optional) rate-limit-window-primary / -secondarywindowDurationMins formatted

Use case

Mirrors Claude Code's statusline which shows percentage + reset time. Without reset times the bare percentage is hard to act on — "5h 80%" doesn't tell you whether you have 10 minutes or 3 hours of breathing room. With it:

... · 5h 80% @11:36pm · weekly 83% @5/27 5:40am · ...

Workaround

Spawn codex app-server from outside, JSON-RPC handshake, call account/rateLimits/read, parse, render. Works but adds ~3-5s subprocess startup per query and requires users to build their own caching layer. The data is already there inside the running CLI; surfacing it as a token is a small change.

Verified data shape (0.133.0)

account/rateLimits/read returns:

{
  "rateLimits": {
    "limitId": "codex",
    "primary": { "usedPercent": 25, "windowDurationMins": 300, "resetsAt": 1779459394 },
    "secondary": { "usedPercent": 18, "windowDurationMins": 10080, "resetsAt": 1779826837 },
    "credits": { "hasCredits": true, "unlimited": false, "balance": "766.76..." },
    "planType": "prolite",
    "rateLimitReachedType": null
  },
  "rateLimitsByLimitId": { ... }
}

Acceptance

Adding these to the existing config:

status_line = ["model-with-reasoning", "codex-version", "context-remaining",
               "five-hour-limit", "five-hour-limit-reset",
               "weekly-limit", "weekly-limit-reset",
               "credits-balance", "project", "git-branch"]

Produces:

gpt-5.5 high · 0.133.0 · Context 28% left · 5h 25% @11:36pm · weekly 18% @5/27 5:40am · $766.76 · self-service-workbench · main

Thanks for the great CLI.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING