codex - 💡(How to fix) Fix Add TUI usage status line items for context and token usage [5 comments, 3 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#21324Fetched 2026-05-07 03:41:55
View on GitHub
Comments
5
Participants
3
Timeline
11
Reactions
0
Author
Timeline (top)
commented ×5labeled ×5closed ×1

I implemented a local branch that adds Codex TUI status line items for context/token usage.

Compare URL: https://github.com/openai/codex/compare/main...wruty:codex:add-tui-usage-status-line-items?expand=1

Root Cause

Local build verification was required because global Codex v0.128.0 does not include these new status line items.

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

Persistent TUI footer/status line items that show context usage and token usage with progress bars and percentages.

Additional information

Summary

I implemented a local branch that adds Codex TUI status line items for context/token usage.

Compare URL: https://github.com/openai/codex/compare/main...wruty:codex:add-tui-usage-status-line-items?expand=1

Motivation

It would be useful for Codex CLI users to see context usage and token usage persistently in the TUI footer/status line, similar in spirit to Claude Code status line tools.

This helps users understand how close they are to context or token limits while Codex is open.

Implemented locally

  • Added TUI status line items for context/token usage.
  • Added progress-bar display for context usage and token usage.
  • Added compact usage-bars summary item.
  • Documented usage in docs/config.md.
  • Updated config schema.
  • Fixed Windows-specific TUI test expectation failures.

Added status line items

  • context-usage-bar
  • context-usage-percent
  • context-used-tokens
  • context-window-tokens
  • token-usage-bar
  • token-usage-percent
  • token-used
  • token-limit
  • usage-bars

Behavior

  • Context usage uses real context token count and model context window.
  • Token usage is displayed only when a reliable internal token limit is available.
  • Unknown, invalid, or zero max values are rendered as unknown instead of guessed.
  • This does not represent API billing tokens.

Manual local TUI check

Local build verification was required because global Codex v0.128.0 does not include these new status line items.

Confirmed with local build:

  • OpenAI Codex v0.0.0 was launched from codex-rs\target\debug\codex.exe.
  • No "Ignored invalid status line items" warning appeared.
  • The footer/status line rendered: Ctx [----------] unknown · Tok [----------] unknown · Ctx unknown unknown/unknown | Tok unknown unknown/unknown

Recommended config: [tui] status_line = ["usage-bars"]

Progress-bar item check: [tui] status_line = ["context-usage-bar", "token-usage-bar", "usage-bars"]

Tests

  • git diff --check: passed
  • cargo fmt --all: passed; emitted an existing stable warning for imports_granularity = Item
  • cargo test -p codex-tui compose_agents_summary -- --nocapture: passed
  • cargo test -p codex-tui usage_bar -- --nocapture: passed
  • cargo check -p codex-tui --message-format short: passed
  • cargo clippy -p codex-tui --all-targets -- -D warnings: passed
  • cargo test -p codex-tui: passed; 2100 passed; 0 failed; 5 ignored

Note

I could not open a pull request because the repository currently limits pull request creation to collaborators.

The compare URL above contains the implemented local branch.

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

codex - 💡(How to fix) Fix Add TUI usage status line items for context and token usage [5 comments, 3 participants]