Add optional dynamic conversation titles via a model rename capability

Open 💬 4 comments Opened Mar 9, 2026 by oxysoft
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

Codex should optionally expose a model-usable tool/capability for dynamically renaming the current conversation as the work evolves.

Problem

Static or one-time titles are often insufficient once a session changes direction. Even with manual rename support, the title can drift out of sync with the actual work unless the user keeps updating it themselves.

Requested behavior

  • add an optional capability/tool that allows the model to rename the current conversation/thread
  • expose it as a user-controlled feature, for example "Dynamic Conversation Title"
  • allow prompting/guidance that encourages the model to keep the title aligned with the current work as the task evolves
  • keep manual rename available and let the user override the dynamic title at any time

Why this is useful

  • long sessions often change scope or become more specific over time
  • dynamic titles would improve resume/search/navigation across many threads
  • it reduces the need for the user to manually keep titles synchronized with the actual work

Suggested UX / policy direction

  • off by default or clearly opt-in
  • model updates title only when the conversation meaningfully changes
  • avoid noisy micro-renames on every tiny turn
  • title changes should be visible/auditable in the UI

Success criteria

  • a session can keep a useful current title without manual renaming every time the scope shifts
  • the feature is controllable by the user
  • manual rename and dynamic rename coexist cleanly
  • title changes improve session navigation rather than creating churn

Related context

  • #9471
  • #4163

This request was suggested in the discussion on #9471 as a separate feature request.

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 5 months ago

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

  • #13990

Powered by Codex Action

zxfxpower · 2 months ago

I’d like to add a concrete CLI/TUI use case for this.

I use long-running Codex CLI sessions where the actual task often becomes clearer only after several turns. A helper can infer a better title from the conversation and persist it to local session metadata, but without a first-class current-thread rename capability it still cannot reliably update the active TUI state. In practice, the workaround is to copy /rename <title> to the clipboard and ask the user to paste it, or wait until the session is exited and resumed before the title is visible everywhere.

An opt-in dynamic title capability would solve this cleanly if it provides:

  • a current-thread-scoped rename action/tool that the model can invoke only when enabled
  • immediate TUI refresh, including the statusline and resume/history surfaces
  • clear user control: off by default, manual rename always wins, and title changes are visible/auditable
  • rate limiting or semantic-change gating so the model does not rename on every small turn
  • consistent persistence across the existing title stores, so session_index, SQLite-backed metadata, resume picker, and app/CLI surfaces do not drift

This is closely related to #15444, but the dynamic-title version is useful when the user does not want to keep manually issuing /rename after the session scope evolves. The key requirement from the CLI side is not only persistence, but a supported way for the current TUI session to be notified and refreshed.

sunnykaibai · 28 days ago

I now have a working, zero-model-cost workaround for the CLI/TUI version of this problem.

This does not replace the requested native capability: it changes the terminal window/tab title, not the persisted Codex thread name used by /resume, search, or other surfaces. Still, it may be useful both as an immediate workaround and as implementation evidence for separating a stable task label from live activity state.

The result looks like:

● Optimize Codex terminal tabs
○ Optimize Codex terminal tabs

How it works

It uses the existing Codex lifecycle hooks:

  • UserPromptSubmit: derive a short deterministic task label, persist it per session, and write ● <task>
  • Stop: reuse the same label and write ○ <task>
  • SessionStart: restore the label after resume and write the idle state

The solid/hollow dot already communicates the live state, so the title does not repeat Working or Idle in text.

The hook writes an OSC 0 sequence directly to /dev/tty, because hook stdout is captured by Codex. It does not call a model or the network, so it adds no token cost or model latency.

Other behavior:

  • low-information prompts such as continue, go, or 好的 do not replace the task label
  • an explicit thread name (/rename) takes priority when it is available in local metadata
  • child-agent hook input is ignored so a subagent cannot overwrite the parent terminal title
  • labels are truncated by terminal display width, including double-width CJK characters
  • state is written atomically under ~/.codex/terminal-title-state/

The reusable hook script is here:

https://gist.github.com/sunnykaibai/f9a4c5450ee68f71c7b3c76adbe98f86

Minimal configuration

Merge these handlers into the existing ~/.codex/hooks.json rather than replacing other hooks:

{
  "hooks": {
    "SessionStart": [{
      "hooks": [{
        "type": "command",
        "command": "node --no-warnings /ABSOLUTE/PATH/codex-terminal-title-hook.mjs",
        "timeout": 5
      }]
    }],
    "UserPromptSubmit": [{
      "hooks": [{
        "type": "command",
        "command": "node --no-warnings /ABSOLUTE/PATH/codex-terminal-title-hook.mjs",
        "timeout": 5
      }]
    }],
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "node --no-warnings /ABSOLUTE/PATH/codex-terminal-title-hook.mjs",
        "timeout": 5
      }]
    }]
  }
}

Disable the native title writer so it does not overwrite the hook:

[tui]
terminal_title = []

For VS Code integrated terminals, the tab title setting must accept the program-provided sequence:

{
  "terminal.integrated.tabs.title": "${sequence}"
}

Otty already honors OSC titles directly. Hook trust should be reviewed and approved on the target machine; persisted trust hashes should not be copied between machines.

Verification

Tested locally with:

  • Codex CLI 0.146.0-alpha.9.2
  • Node.js 22.22.0
  • macOS + Otty

Verified:

  • working → idle transition
  • stable title after a short continue prompt
  • title restoration on SessionStart
  • explicit-name priority
  • child-agent isolation
  • strict Codex config parsing
  • all merged hooks trusted and enabled

The remaining reason for a native feature is important: this workaround cannot update the persisted thread name or notify every Codex surface. A first-class current-thread rename capability would still be the clean solution for /resume, history/search, IDE, desktop, and web. A smaller native TUI improvement could also expose something like a turn-summary terminal-title item alongside the existing activity/run-state items.

znbsf · 10 days ago

I have a working opt-in plugin workaround for the Codex Desktop version of this request:

https://github.com/znbsf/codex-personal-skills#codex-task-title-organizer-plugin

It intentionally avoids renaming on every turn:

  • UserPromptSubmit counts prompts locally per task session.
  • Prompt 4 asks the active Codex turn to set a useful current-task title.
  • Prompt 10 is a semantic refresh and skips the rename unless the object or purpose changed materially.
  • It stops after those two checkpoints; manual rename remains available.
  • It creates no background task or follow-up conversation.

Privacy-wise, the hook stores only hashed session/turn identifiers and small counters. It does not persist prompt text, generated titles, transcripts, rollout data, local paths, or project taxonomy.

The latest implementation is receipt-free: it does not depend on PostToolUse, because code-mode nested tools do not consistently emit that event (#38850). Existing v2 counters migrate without resetting or replaying prompt 4.

Install:

codex plugin marketplace add znbsf/codex-personal-skills --ref main
codex plugin add codex-task-title-organizer@codex-personal-skills

Then restart the desktop app or start a new Codex session and review/trust the hook. Tested on Windows Codex Desktop with the current-task title tool available.

This is not a replacement for the native feature requested here: runtimes without a current-thread rename tool are not covered, and a native implementation would still be better for first-class cross-surface auditability and user controls.