Skip to content

Session Statistics Feature #10588

Closed
Closed

Description

@romitdasgupta

What variant of Codex are you using?

CLI

What feature would you like to see?

feat(tui): Add /stats command to display session statistics

Description

Problem

Users currently have no visibility into session performance metrics. There's
no way to see:

  • How many commands were executed and their success/failure rate
  • Which files were accessed or modified during the session
  • Token usage breakdown across turns
  • Time distribution between model inference and tool execution

Proposed Solution

Add a /stats slash command that displays a scrollable popup with session
statistics organized into sections:

Commands

  • Total executed, successful, failed counts
  • Success rate percentage
  • Total execution time

Files

  • Count of files modified and accessed
  • Top accessed files with frequency

Turns & Tokens

  • Current turn number
  • Total/input/output token counts
  • Per-turn token breakdown (last 5 turns)

Timing

  • Session duration
  • Model wait time (with percentage)
  • Tool execution time (with percentage)

Implementation Approach

  1. New SessionStats struct to track metrics throughout the session
  2. New StatsView popup with keyboard navigation (↑/↓/j/k scroll, Esc close)
  3. Integration points in ChatWidget to record events:
    • Turn start/end
    • Command execution results
    • File access via MCP tools
    • Patch applications (file modifications)

Scope

  • TUI only

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on Feb 4, 2026
  2. etraut-openai commented on Feb 4, 2026

    @etraut-openai
    Contributor

    Thanks for the suggestion. This information is available through OTel (open telemetry). It would be pretty easy to vibe code something that monitors OTel events and presents them in a manner of your liking.

  3. oxysoft commented on Mar 9, 2026

    @oxysoft

    Related broader status-surface direction: #14043\n\nThis issue asks for a dedicated /stats popup, which is the right near-term surface. Longer-term, a custom statusline/widget API could complement it by exposing compact live session-stat widgets (edited files, token/timing summaries, etc.) without needing a new built-in field every time.

  4. etraut-openai commented on May 10, 2026

    @etraut-openai
    Contributor

    This feature request hasn't received enough upvotes, so I'm going to close it.

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

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions