Skip to content

Customizable status line #17827

Closed
Closed

Description

@pkondaurov

Feature Request

Problem

Claude Code has a built-in customizable status line feature that allows users to display useful real-time information at the bottom of the terminal UI — token usage, model name, rate limits, context window, git branch, etc.

This is configured via a simple shell script hook in settings:

{
  "statusLine": {
    "type": "command",
    "command": "/bin/bash ~/.claude/statusline.sh",
    "padding": 0
  }
}

The script receives JSON context on stdin and returns formatted text. This is incredibly useful for power users who want to monitor their session at a glance.

Codex CLI currently has no equivalent mechanism. There's no way to display custom information in the TUI — no status line, no hooks, no plugin system for UI customization.

Proposed Solution

Add a statusLine (or similar) configuration option to ~/.codex/config.toml that allows running an external command and rendering its output in the Codex TUI (e.g., at the bottom of the screen).

Something like:

[status_line]
command = "/bin/bash ~/.codex/statusline.sh"
refresh_interval_secs = 10

The command would receive session context (model, token count, etc.) as JSON on stdin and return a single line of text (with ANSI colors) on stdout.

Use Cases

  • Display current model and token/context usage
  • Show API rate limit status and reset times
  • Display git branch and repo info
  • Show project-specific metadata
  • Integration with external monitoring tools

Why This Matters

For users who switch between Claude Code and Codex, the lack of a status line in Codex is a noticeable gap. The status line is a low-cost, high-value feature that significantly improves the interactive experience.

Activity

  1. added
    enhancement
    CLI
    TUI
    config
    on Apr 14, 2026
  2. github-actions commented on Apr 14, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. etraut-openai commented on Apr 14, 2026

    @etraut-openai
    Contributor

    Have you tried the /statusline command? It's a little less flexible than an arbitrary script, but it's much easier to configure. Does this meet your needs?

  4. removed
    CLI
    on Apr 14, 2026
  5. joshka commented on Apr 15, 2026

    @joshka

    I'd like to be able to see my jj-vcs status (change id etc.) in the status line.
    It's likely not a small task to invest in making jj a core part of the product, but allowing a hook like this seems like a reasonable compromise #16921 seems like they have a good solution to this with a proposed PR ready to review

  6. dlwss commented on Apr 15, 2026

    @dlwss

    Have you tried the /statusline command? It's a little less flexible than an arbitrary script, but it's much easier to configure. Does this meet your needs?

    The current exposed features have significantly enhanced the functionality, and they can meet the needs of most users in various scenarios. However, I still hope to be able to add an extension point similar to the Statusline of CC CLI. It can store some user-defined data. If it can be made available, I would be very grateful.

  7. jage9 commented on Apr 16, 2026

    @jage9

    Found this while researching this exact idea.
    /statusline is actually a decent compromise, though I would still like to have control over the wording and order for conciseness.
    For example, I have my Claude one at
    5H: 96% | 7D: 100% | context: 89% | Sonnet 4.6
    Since I use a screen reader, being able to set the order is important to me.

  8. YitzhakMizrahi commented on Apr 24, 2026

    @YitzhakMizrahi

    The built-in /statusline command is useful, but it does not fully cover the use case of a dynamically refreshed status provider. The gap I am running into is less "show one more built-in field" and more "let the user define what the statusline and/or terminal title should say while a session is running."

    Useful shape:

    • A configurable command or template that receives current session context, such as model, cwd, repo/branch, approval mode, sandbox mode, turn state, and token/context usage when available.
    • Automatic refresh on a timer and on relevant session events, rather than requiring manual updates.
    • Separate control for the visible statusline/footer and the terminal/window title.
    • User-defined ordering, visibility, and formatting, which helps both compact multiplexer panes and accessibility workflows.
    • Safe failure behavior: if the command times out or exits nonzero, keep the previous value or render nothing, but do not block the TUI.

    This would make /statusline a good default for most users while still giving power users a narrow extension point for project-specific or workflow-specific context.

  9. RoggeOhta commented on Apr 27, 2026

    @RoggeOhta

    Adding another +1 for command-driven customization specifically, not just selecting built-in /statusline fields.

    The current /statusline is useful, but the gap vs Claude Code is the extension point: let users run a command/script, pass Codex session context as JSON on stdin, and render stdout with safe timeout/failure behavior.

    Use cases:

    • Show project-specific info that Codex will never know as built-in fields, e.g. jj change id, k8s context, CI/deploy status, ticket id, custom quota/spend.
    • Preserve a compact house style across tmux/zellij panes.
    • Support accessibility by controlling exact wording/order rather than choosing from fixed labels.

    A built-in /statusline default and an opt-in command provider could coexist: default remains simple, power users get a narrow, predictable extension hook.

  10. akamalov commented on Apr 27, 2026

    @akamalov

    +1

  11. changed the title [-]Feature request: customizable status line (like Claude Code)[/-] [+]Customizable status line[/+] on Apr 28, 2026
  12. SakaZulu commented on Apr 28, 2026

    @SakaZulu

    Thanks, I noticed #17827 is very closely related.

    I am fine with this issue being treated as a duplicate if that helps tracking. The main point I wanted to emphasize is the same as the later comments in #17827: the built-in /statusline picker is useful, but the missing piece is a command-driven extension point.

    For my use case, the important part is not just adding more built-in fields. It is allowing a user-provided command to receive Codex session context as JSON on stdin and render stdout back into the TUI, preserving ANSI colors and custom formatting, with timeout/failure safeguards.

    That would let the built-in /statusline remain the simple default while enabling advanced users and community tools to build richer status lines.

  13. 61 remaining items

  14. sgeos commented on Sep 28, 2026

    @sgeos

    Adding a concrete migration case from Claude Code to Codex CLI 0.158.0 on macOS. We configured the existing native status fields successfully, but could not reproduce three useful aspects of our status display through supported configuration.

    Our Claude setup has a global renderer and an optional, version-controlled project script that contributes continuous integration and local verification-gate status. An illustrative display is below. All percentages in this example mean used capacity.

    ▰▰▰▰▰▰▰▰▰▱ 90% used · 5h 23% used · 7d 80% used · <model> · <project> (<branch>) · CI <state>
    

    The closest native Codex configuration we installed is below.

    [tui]
    status_line = ["context-used", "five-hour-limit", "weekly-limit", "model-with-reasoning", "context-window-size", "project-name", "git-branch", "permissions", "approval-mode"]

    The remaining gaps are these.

    • Consistent percentage direction. Context has used and remaining variants, but the five-hour and weekly fields expose remaining capacity. We want all three to count upward toward exhaustion. The transformation is simply used = 100 - remaining, but we found no supported field or formatting expression for it. Native used variants, or a used/remaining preference with explicit labels, would address this independently of a custom renderer.
    • Presentation control. We cannot reproduce the compact context bar, custom labels and separators, or usage-based color thresholds. Numeric values should remain visible so meaning does not depend on color.
    • Global configuration with project contributions. We want one global layout that optionally incorporates a trusted project command's output, such as continuous integration state and a long-running local verification gate. Projects without a contributor should retain the normal global layout. A composable custom segment would be sufficient, without replacing every native field.

    For an external-command extension, useful properties would include documented session data on standard input, bounded output, a hard timeout, asynchronous refresh, explicit handling of unavailable or stale data, and user approval before executing repository-provided commands. A failed status helper should not stall the terminal interface or imply a successful gate.

    This is specifically about extending the existing /statusline feature. It is not a report that Codex lacks a status line. We verified that the configuration loads, but did not independently verify its live rendering. The requested used/remaining preference also goes beyond the labeling concern discussed in #24274.

  15. GreatV commented on Sep 30, 2026

    @GreatV

    Adding a concrete use case from running Codex CLI and Claude Code side by side, on long agentic sessions where both run in adjacent tmux panes.

    On the Claude Code side, a small status-line script shows, on one or more rows depending on terminal width:

    Opus 5.5 high | 128 tok/s ttft 3.2s | in 1234.2M | out 1.7M | ctx 462.2k (12%) | 5h 76%→09-30 14:13 | 7d 19%→10-03 09:06
    

    With Codex 0.159.x I configured the native items (model-with-reasoning, five-hour-limit, weekly-limit, total-input-tokens, total-output-tokens), but four things can't be reproduced:

    1. Throughput. There is no tokens-per-second or time-to-first-token item. On long runs this is the quickest signal of whether a session is making progress, is stalled, or is in a long reasoning phase. The only workaround today is watching total-output-tokens and estimating by hand.
    2. Reset times next to the limits. I want "remaining %" plus "resets at" in one compact segment, which relates to Allow compact formatting for rate-limit status-line items #41739.
    3. Width-aware wrapping. When the pane is narrow, the line should wrap at segment boundaries onto a second row instead of being truncated.
    4. Consistent formatting across tools. Same field order, separators and colors as the other agent's status line, so the panes can be compared at a glance.

    A command-backed status line would cover all four, as proposed in this issue: run a user command on each refresh, pass session JSON on stdin, and render its stdout, with multiple lines allowed. The JSON fields that would make this work:

    • model, reasoning_effort, service_tier / fast mode
    • token counters: input, cached input, output (per turn and total)
    • per-turn timing (start, first token, end), or a precomputed output tokens/s
    • rate limits: five_hour and weekly, each with used_percent and resets_at
    • context window: used and remaining
    • terminal width, e.g. a COLUMNS env var, since tput cols can't see the TTY from a subprocess

    If a full command hook is out of scope for now, a built-in output-tokens-per-second item plus reset-time variants of the limit items would already help.

  16. adrijshikhar commented on Oct 1, 2026

    @adrijshikhar

    For anyone looking for a customizable statusline for OpenAI Codex CLI today, we built cxstatusline.

    It provides an interactive terminal configurator and resolves several of the current CLI limitations:

    • 1–3 Configurable Rows: Solves horizontal truncation with responsive multi-line layouts.
    • Throughput & Reset Timers: Live tokens/s, session duration, and 5-hour/weekly quota countdowns (e.g. 5h 82% ↻ 3h 12m).
    • Custom Shell Commands: Run external scripts or project-specific checks as statusline widgets.
    • Powerline Themes & Colors: Built-in separators (arrows, angled, curved, flame) and ANSI palettes.
    • Safe & Fully Reversible: Uses verified prebuilts with atomic symlinks; run cxstatusline revert to cleanly return to stock Codex at any time.

    You can preview and test layouts directly in the browser:
    👉 Web Playground: https://cxstatusline.adrijshikhar.dev
    📦 GitHub Repo: https://github.com/adrijshikhar/cxstatusline

    npm install -g cxstatusline
    cxstatusline install
  17. chilango74 commented on Oct 8, 2026

    @chilango74

    Adding a concrete implementation experience to the request for a built-in output-tokens-per-second status item, including the use cases above and #5390.

    We implemented a small TUI-only patch against Codex CLI 0.161.0 that adds an optional output-speed item to /statusline and [tui].status_line, rendered as 42.5 t/s. It uses the native status-line renderer and runtime token-usage events, with no external process or session-log polling.

    The metric has a specific limitation: it measures output-token delta divided by the wall-clock duration of the latest completed live turn, including reasoning, tool execution, waiting and approvals within that turn. It is an end-to-end turn average, not live streaming throughput. Idle time between turns is excluded. The previous value remains visible until another valid turn completes; interrupted turns and replayed history do not replace it. If a resumed thread has no reliable counter baseline, the first turn is skipped rather than counting historical output. Late usage updates use the already recorded completion time.

    The patch includes arithmetic tests and TUI lifecycle tests covering late usage, interruption, replay, missing baselines and counter resets. It is a starting point for a native item, but live generation TPS would require a different measurement window and reliable streaming token counts. The metric name and description should make that distinction explicit.

    We have now reverted to stock Codex because maintaining a patched binary across regular CLI updates is too costly. An upstream optional status item would let users observe speed while keeping normal updates.

    We understand that the current contribution policy does not accept external PRs. We can share the patch and tests as technical reference material for the team; if maintainers explicitly invite a contribution, we would be willing to adapt it to the agreed semantics and prepare a focused PR. Would a completed-turn average be useful as an initial native item, or should this target live streaming TPS from the outset?

  18. fraga commented on Oct 16, 2026

    @fraga

    Adding implementation findings for the command-driven renderer requested here. My use case is a compact, Claude-style display with custom labels and consumed-usage bars for context, 5-hour and weekly limits, plus available cost and reset times. The built-in picker supplies useful fields, but cannot reuse an existing script or control that presentation.

    I prototyped this against main at 6b991972c5, using a separate opt-in table so the existing built-in item list keeps its current meaning:

    [tui.status_line_command]
    command = "python3 /absolute/path/to/statusline.py"
    refresh_interval = 1
    padding = 0
    timeout_ms = 1000

    Implementation findings that may help define a supported interface:

    • Send session JSON on stdin and capture stdout as styled text. Common Claude-compatible fields cover model/effort, live context usage, available rate-limit windows with Unix reset timestamps, and terminal size. Unavailable cost and timing values need an explicit missing/null contract.
    • Keep live context counters separate from cumulative session totals. For the common context percentage field, use input tokens divided by the full model context window; cached reads are a breakdown of input, not additional input to count twice.
    • Run on the TUI host even when the app server is remote. Executable settings should come from host config layers; project layers must not register commands before or after the trust prompt. The prototype has a regression test for this boundary.
    • Debounce session changes, refresh while idle when requested, cancel superseded executions, and discard results owned by an old conversation. A short timeout and bounded stdout keep slow or failing scripts from blocking the UI. The prototype uses a 1 s default, 64 KiB stdout cap, and 16 output rows; Unix cancellation covers the shell process group.
    • Reserve multiline footer rows through the existing layout, including inline transcript mode, so script output cannot overwrite the input or footer controls.

    Targeted Linux validation passes: 106 status-line tests, 39 footer/layout tests, 1 config test, and 8 Python renderer tests. A PTY smoke test verified styled multiline output, stdin JSON, and idle redraw. These are targeted results, not a full-CI or cross-platform pass: pinned-toolchain CI, the dedicated argument-comment lint, and macOS/Windows checks remain outstanding. Local Clippy with Rust 1.99 also encounters an existing error in unchanged layout code; the repo pins Rust 1.95.

    Sharing these findings as technical reference under the contribution policy. A documented command hook would let users keep their preferred display while continuing to use normal Codex updates.

  19. iscarelli commented on Oct 18, 2026

    @iscarelli

    Concrete proposal: two-line, script-backed status area with Windows support

    Adding a concrete use case to this feature request, observed with Codex CLI 0.163.0 on Windows. The native /statusline picker cannot express the layout and derived metrics below. I would like an opt-in external renderer, without maintaining a custom Codex build.

    Command interface

    Run a user-configured command, send a documented, versioned JSON snapshot on stdin, and render its UTF-8 stdout as a status area supporting at least two explicit lines, Unicode blocks, and ANSI colors. Refresh asynchronously on relevant state changes, terminal resize, and a configurable interval so reset countdowns can update while idle. Use a timeout and prevent overlapping executions.

    One possible configuration, proposed rather than an existing setting:

    [tui.status_line_command]
    argv = ["py", "-X", "utf8", "C:/tools/codex-statusline.py"]
    refresh_interval_ms = 1000
    timeout_ms = 500
    max_lines = 2

    Proposed stdin data

    The following is an illustrative schema, not a report of an existing payload. Field names can follow Codex conventions:

    {
      "schema_version": 1,
      "workspace": {"current_dir": "C:/work/project", "git_branch": "main"},
      "model": {"id": "active-model-id", "display_name": "Active Model", "provider_id": "active-provider"},
      "execution": {"mode": "default", "approval_policy": "on-request", "sandbox_mode": "workspace-write"},
      "context": {
        "total_input_tokens": 450000,
        "total_output_tokens": 12000,
        "used_tokens": 80000,
        "window_tokens": 300000
      },
      "rate_limits": {
        "active_bucket_id": "active-model-bucket",
        "buckets": [{
          "id": "active-model-bucket",
          "provider_id": "active-provider",
          "model_ids": ["active-model-id"],
          "five_hour": {"used_percent": 7, "reset_after_seconds": 8400},
          "weekly": {"used_percent": 37, "reset_after_seconds": 280800}
        }]
      },
      "terminal": {"columns": 220, "status_area_columns": 218}
    }
    • Distinguish cumulative input/output counters from current context occupancy; cumulative token spend must not be presented as the current context size after repeated turns or compaction.
    • Expose the active Codex execution/collaboration mode using its actual semantics, with approval policy and sandbox mode separately where applicable.
    • Support available native and third-party model/provider quota buckets and identify which bucket applies to the active model. Missing provider data or an unsupported window must be explicitly unavailable/null, never assumed to mean 0% used. Do not assume every provider has five-hour and weekly windows.
    • Document whether reset values are seconds remaining or Unix timestamps, and their units. Include a snapshot timestamp if countdowns need a reference.
    • Provide the actual usable status-area width, excluding TUI padding/borders, as well as terminal width. No credentials or conversation text are needed.

    Desired two-line layout

    Left side of line 1:

    [project] (main) ctx:[███░░░░░░░] 80k/300k
    

    Right side of that same line, aligned to the usable right edge:

    5h:[█░░░░░░░░░] 7% ↺ 2h20m wk:[████░░░░░░] 37% ↺ 3d6h free:63% 3.3d → 19%/d [Active Model]
    

    Line 2, colored according to the active mode:

      ⏵⏵ [mode] on
    

    The renderer could append the actual mode-switch shortcut when available; shortcuts and mode names should reflect Codex, rather than being copied from another CLI.

    The script would implement a Dracula-style palette, 10-cell bars, a configurable fixed context target (e.g. 300k), and an orange [Compact!] hint at or above 160k current context tokens. This would be a user-defined hint, independent of Codex's automatic compaction policy. Weekly pacing is derived as free_percent / days_until_reset, with defined behavior when the reset is due or data is unavailable. Narrow terminals should have documented clipping/reflow behavior.

    Windows and rendering requirements

    With stdout captured through a pipe, shutil.get_terminal_size() can fall back to 80 columns. A Windows helper can try opening CONOUT$ and calling GetConsoleScreenBufferInfo through ctypes; the visible window width (srWindow.Right - srWindow.Left + 1) matters when the backing buffer is wider. This fallback is unavailable when there is no attached console, so passing the usable width from the TUI is preferable.

    Please document UTF-8 stdin/stdout behavior for Python and batch wrappers, preserve symbols such as █, ░, ⏵, and ↺, and measure display-cell width without counting ANSI color sequences. Restrict supported ANSI to safe styling, with no arbitrary cursor movement. Helper failure or timeout should leave the TUI responsive, with a documented fallback and diagnostics outside the status text.

    Acceptance criteria

    • A configured external command receives the documented JSON snapshot through stdin and produces two styled status rows through stdout.
    • Model, context, quota, mode, and resize changes reach the renderer; countdowns refresh while idle.
    • A renderer can align left and right segments at multiple Windows terminal widths with stdout piped, without relying on an 80-column fallback.
    • Unicode and ANSI styling render correctly, and narrow-width behavior is documented.
    • Missing quota data, absent console access, malformed output, nonzero exit, and timeout do not stall or corrupt the TUI.
    • Existing native tui.status_line configuration remains available.
  20. scottlz0310-user commented on Oct 27, 2026

    @scottlz0310-user

    I maintain agent-statusline, which uses a shared renderer with custom status-line commands in Claude Code, GitHub Copilot CLI, and Antigravity CLI. Each client passes session JSON to the command.

    I understand that Codex's /statusline already lets users select and reorder built-in items such as model, context, and usage limits. The remaining gap is an official extension point for connecting an arbitrary renderer. As a result, the same tool cannot currently provide a status line in Codex, and users cannot share their preferred layout or project-specific information across these CLIs.

    This is a concrete interoperability issue for existing tools. If Codex exposed a way to pass documented JSON to an explicitly configured command and render its output in the TUI, while retaining the built-in status line, users could reuse the status-line ecosystem without requiring Codex to add a built-in item for every use case. The data contract should clearly describe which values Codex can provide, with cost and quota fields optional when unavailable.

    Once this extension point is stable, I would like to add a Codex adapter to agent-statusline so the same renderer can work there too.

  21. ryoppippi commented on Nov 15, 2026

    @ryoppippi

    Note

    🤖 GPT-6.1 Sol responding on behalf of ryoppippi

    Adding a ccusage integration use case and a source-level status question.

    We would like ccusage codex statusline to display locally calculated session/daily token usage and estimated API-equivalent cost inside the native Codex CLI footer. Selecting built-in fields does not provide an extension point for that calculation. A documented MCP provider interface would work for this use case; it does not have to be a shell-command hook.

    I checked the latest stable tag, rust-v0.169.0, and main at ee344ca9458351a6ea102795fa73110ad3ede5dc. The recent MCP work looks relevant:

    On the inspected main, ResolvedStatuslineProvider is still marked as staged/dead code, and its lookup/read callers appear to be tests. The provider-setting persistence function similarly refers to an upcoming picker. I could not identify a production provider refresh/read/render loop or a documented resource-response contract.

    Is this integration still intentionally staged? If it is already usable, could you point to the supported version and setup? Otherwise, a documented provider advertisement, state payload, resource response format, and refresh/failure behavior would let ccusage implement against the intended interface once it is available.

    This is a feature/integration request based on source inspection, not a claim that the existing built-in /statusline is broken. I have not patched/rebuilt Codex or verified the MCP provider on screen.

  22. etraut-openai commented on Nov 21, 2026

    @etraut-openai
    Contributor

    Custom status lines are available to try in Codex CLI 0.171.0!

    1. Open /experimental, enable Custom status line, and restart the CLI.
    2. Open /statusline and select Create a custom status line. Describe what you’d like to see, and Codex can help build it. If you already have a provider installed, select Choose a status line provider.

    For anyone maintaining a tool like ccusage, the MCP provider interface is ready to try in this release. Codex sends the provider a snapshot of the displayed thread, including the model, working directory, and available usage data. The provider can combine that with its own data and return plain text or styled content. Codex refreshes the footer automatically.

    If you already have a status line script, you can wrap it in a stdio MCP provider. The provider guide documents discovery, rendering, and refresh behavior, with a working Python example and TypeScript definitions for the input and output.

  23. iscarelli commented on Nov 22, 2026

    @iscarelli

    Tested the new MCP statusline provider on Codex CLI 0.171.0 on Windows, following the bundled create-statusline guide. I can now reproduce most of the status display I use in Claude Code without maintaining a patched Codex binary. Thanks for shipping this!

    The screenshot shows directory and Git branch/dirty state, a 10-cell context bar with current-context tokens, 5-hour and weekly consumed-usage bars, reset countdowns, remaining weekly allowance with hourly/daily pacing, model, and the current approval mode (Approve for me here).

    Custom MCP statusline on Windows

    A few findings from this test:

    • Explicit row.props.gap kept adjacent groups separated; relying on leading/trailing spaces in separate text nodes made the initial version look cramped.
    • Structured colors and row.props.background work. However, the background only covers rendered content/gaps and stops before the footer's right edge, as shown above.
    • The footer disappeared once during testing. We moved Git/console queries into background workers to keep resource reads responsive; it appeared to work again after restarting. We have not isolated an upstream cause, so this is not a confirmed Codex bug.

    The remaining request is a supported way to fill the available footer width with a row background, handled by the TUI so it follows resizing and wrapping. The published snapshot does not expose the actual usable footer width. Querying the Windows console width is only an approximation and does not reliably account for TUI padding or side panels. A fill/stretch option or a footer-background setting would avoid padding tricks. Optional vertical spacing above the custom footer would also help separate it from the composer.

    This is a live Windows rendering test, not a full cross-platform or resize-matrix validation. The custom provider passed 10 local checks covering MCP stdio, context/quota calculations, missing data, Git state, approval labels, spacing, configuration preservation and nonblocking OS queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIconfigenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions