Render context and usage status-line percentages as compact bars

Open 💬 0 comments Opened Jun 12, 2026 by yapdianang

Problem

Codex currently supports configurable TUI status-line items via tui.status_line, but the renderer only displays each selected item as plain text. Claude Code exposes a statusLine.command hook, which lets tools like ctxline-claude render compact progress bars for context and usage limits.

For Codex users, the closest equivalent today renders as text, for example:

~ · gpt-5.5 xhigh · Context 31% used

This is useful, but it is less scannable than a compact footer like:

my-project ⎇ main │ gpt-5.5 · xhigh │ CTX ██░░░ 31% │ 5h ████░ 81% │ weekly ██░░░ 31%

Proposal

Add compact progress-bar rendering for percentage-like status-line items while preserving the existing tui.status_line configuration model:

  • context-used: render Context N% used as CTX <bar> N%
  • five-hour-limit / weekly-limit: render remaining-limit text as used-percent bars, e.g. 5h 19% left -> 5h ████░ 81%
  • Keep non-percentage status-line items as plain text.
  • Use existing status-line theme/color plumbing and fall back to dim styling when theme colors are disabled.

Implementation sketch

I put together a small proof-of-concept patch on a fork:

https://github.com/yapdianang/codex/tree/codex/ctxline-bars

Commit:

https://github.com/yapdianang/codex/commit/33d82b1

The patch is intentionally narrow: it only changes codex-rs/tui/src/bottom_pane/status_line_style.rs and adds renderer tests for context and limit bars.

Validation attempted

  • cargo fmt --package codex-tui -- tui/src/bottom_pane/status_line_style.rs completed.
  • A targeted cargo test -p codex-tui bottom_pane::status_line_style -- --nocapture build started and passed the initial missing-dependency blocker after installing pkg-config and libssl-dev, but the local VM ran out of disk space during the Codex workspace build before tests could finish.

Why this matters

This keeps Codex's existing native status-line configuration simple while making high-signal status information much easier to scan during long sessions.

View original on GitHub ↗