codex - 💡(How to fix) Fix Show remaining Codex credits / usage in the CLI statusline [3 comments, 4 participants]

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…
GitHub stats
openai/codex#19555Fetched 2026-04-26 05:15:09
View on GitHub
Comments
3
Participants
4
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3unlabeled ×2

Root Cause

For long agentic coding sessions, remaining usage is operationally important. It affects whether a user should:

  • continue with the current model or switch to a cheaper/smaller one
  • enable or avoid fast mode
  • compact/reset context before continuing
  • pause work before hitting a limit mid-task
  • buy credits or wait for included usage to reset

This is especially important because Codex usage varies heavily with task size, context size, model choice, fast mode, and long-running agent workflows.

Code Example

status_line = [
  "model-with-reasoning",
  "codex-credits-remaining",
  "codex-usage-remaining",
  "context-remaining",
  "current-dir",
]

---

gpt-5.4 high · Credits $12.40 · Context 72% left · ~/repo

---

gpt-5.4 high · Codex usage 63% left · Credits $12.40 · ~/repo
RAW_BUFFERClick to expand / collapse

Feature request

Please add a Codex CLI statusline field that shows remaining Codex plan usage / credit balance, similar to how Claude Code surfaces remaining usage directly in the terminal.

Today the CLI can show useful local/session state such as model, reasoning level, current directory, git branch, and context remaining. However, remaining Codex usage or credits are not available as a first-class statusline item. Users have to leave the terminal and open Codex Settings → Usage / Credits to understand whether they are close to a plan or purchased-credit limit.

Why this matters

For long agentic coding sessions, remaining usage is operationally important. It affects whether a user should:

  • continue with the current model or switch to a cheaper/smaller one
  • enable or avoid fast mode
  • compact/reset context before continuing
  • pause work before hitting a limit mid-task
  • buy credits or wait for included usage to reset

This is especially important because Codex usage varies heavily with task size, context size, model choice, fast mode, and long-running agent workflows.

Suggested statusline fields

Add one or more selectable /statusline fields, for example:

status_line = [
  "model-with-reasoning",
  "codex-credits-remaining",
  "codex-usage-remaining",
  "context-remaining",
  "current-dir",
]

Possible rendered examples:

gpt-5.4 high · Credits $12.40 · Context 72% left · ~/repo

or

gpt-5.4 high · Codex usage 63% left · Credits $12.40 · ~/repo

Notes

  • If exact usage cannot be fetched cheaply or reliably, a stale/last-known value with a timestamp would still be useful.
  • If there are separate windows/limits, showing the most constraining limit first would be helpful.
  • If an organization/workspace has no credit data available, the field could be omitted or show usage unavailable.
  • This is related to broader usage/limits visibility requests such as #15281, but specifically asks for a statusline field so users can monitor budget without leaving the CLI.

Comparison

Claude Code surfaces remaining usage in the terminal. Codex should have comparable terminal-native budget visibility.

extent analysis

TL;DR

Add a Codex CLI statusline field to display remaining Codex plan usage or credit balance.

Guidance

  • Consider implementing a /statusline field, such as "codex-credits-remaining" or "codex-usage-remaining", to display the remaining usage or credit balance.
  • If exact usage cannot be fetched reliably, a stale/last-known value with a timestamp could be used as a fallback.
  • When displaying multiple limits, prioritize showing the most constraining limit first.
  • Handle cases where credit data is unavailable, such as omitting the field or displaying "usage unavailable".

Example

status_line = [
  "model-with-reasoning",
  "codex-credits-remaining",
  "context-remaining",
  "current-dir",
]

Notes

This feature request is specific to adding a statusline field for remaining Codex usage or credits, and does not imply changes to the underlying usage tracking or billing system.

Recommendation

Apply workaround: Implement a custom statusline field to display remaining Codex usage or credits, as this would provide users with the desired visibility into their budget without leaving the 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