Show session compaction count in Codex CLI TUI

Open 💬 3 comments Opened Jun 1, 2026 by nicelight

What variant of Codex are you using?

Codex CLI

What feature would you like to see?

### Proposal

Show how many times the current Codex CLI session has been compacted.

Example UI:

  • hidden when 0
  • compacted 1x / compacted 2x in the TUI status area after compaction occurs

### Motivation

Context compaction is an important session lifecycle event. When a long-running session has been compacted one
or more times, users may want to know that because it affects debugging, continuity, and the decision whether
to continue the current session or start a fresh one.

This is especially useful for long coding sessions where behavior changes after several compactions and the
user needs a simple signal that the session history has been summarized.

### Proposed behavior

  • Track a compaction_count for the active session.
  • Increment it only after a successful compaction.
  • Preserve it across resume if session metadata already supports that cleanly.
  • Display it unobtrusively in the TUI, preferably hidden at zero.
  • Do not change model prompts, API payloads, or session behavior beyond the visible indicator.

### Prior art

I am running a locally patched Codex CLI with this behavior, and it has been useful as a lightweight context-
health/debugging indicator.

### Acceptance criteria

  • A user can see whether the current session has been compacted.
  • The indicator does not add noise for new/short sessions.
  • The feature works across normal interactive sessions and resumed sessions if feasible.

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗