Skip to content

Allow setting thread name at session start with codex --name #14482

Open

Description

@zipus

What variant of Codex are you using?

CLI

What feature would you like to see?

Summary

Add a --name flag to the interactive CLI so a thread can be named when it is created:

codex --name "issue AAA"

This should work with the existing thread naming and resume behavior, so the same session can later be resumed with:

codex resume "issue AAA"

Problem

Today, naming a conversation is a two-step flow:

  1. Start a session with codex
  2. Rename it later with /rename

That works, but it is awkward when the intended thread name is already known before starting the session, for
example when opening work for a specific bug, issue, or task.

Proposed behavior

Support:

codex --name "issue AAA"

Expected behavior:

  • Starts a fresh interactive session

  • Sets the initial thread name to "issue AAA"

  • Persists that name through the existing session index / thread naming path

  • Makes the session resumable via:

    codex resume "issue AAA"

Scope

This request is only for naming a fresh session at startup.

I would not expect --name to implicitly rename resumed or forked sessions. Those cases should probably either:

  • reject --name with a clear error, or
  • be handled in a follow-up design discussion

Why this shape

codex --name "..." fits the current CLI better than a separate codex name "..." command because naming is metadata
for the normal interactive startup path, not a distinct top-level mode.

This looks like it should be a relatively small change because:

  • /rename already persists thread names
  • codex resume already resolves thread names

So the missing part is mainly exposing an initial-name option on the fresh-session path.

Additional information

No response

Activity

  1. added
    enhancement
    on Mar 12, 2026
  2. added
    CLI
    on Mar 12, 2026
  3. zipus commented on Mar 12, 2026

    @zipus
    Author

    I implemented this on my fork, but GitHub is blocking PR creation because openai/codex only allows collaborators
    to open pull requests.

    Branch:
    zipus/issue-14482-initial-thread-name

    Commit:
    382d8909

    Fork branch URL:
    https://github.com/zipus/codex/tree/zipus/issue-14482-initial-thread-name

    Summary:

    • add codex --name "..." for fresh interactive sessions
    • persist the initial thread name through the existing thread/session naming path
    • reject --name on resume/fork instead of ignoring it
  4. tkozzer commented on Apr 11, 2026

    @tkozzer

    Now that 0.120.x has /rename in interactive mode, it just makes sense to have a --name flag. Hoping this can get bumped up and gain some traction for next release.

  5. added
    TUI
    and removed
    CLI
    on Apr 11, 2026
  6. baawhee commented on May 6, 2026

    @baawhee

    That would be a great addition to the CLI!

  7. NightGlowww commented on May 22, 2026

    @NightGlowww

    Adding a related Desktop use case: this would also help Codex Desktop users whose first prompt naturally begins with long local paths.

    Example workflow:

    /Users/<user>/Desktop/<workspace>/<project>/<document>.docx
    Please modify this file according to the attached/spec document...
    

    Today, if that first prompt is used as the initial title or remains as a stale fallback in metadata, Desktop Projects/sidebar rows become very long and hard to scan. A creation-time name such as:

    codex --name "Course material revision"

    or an equivalent Desktop UI field would avoid relying on the first prompt as title metadata.

    Related current behavior I observed on Codex Desktop 26.519.31651 / CLI 0.133.0:

    So --name / initial-name support would solve the workflow problem, while #16405 tracks keeping the persistence layers in sync after a name is set.

  8. Higor-Matos commented on Jun 10, 2026

    @Higor-Matos

    I hit this in daily CLI use with multiple concurrent Codex sessions.

    Environment:

    • codex-cli 0.139.0
    • macOS
    • separate wrapper/CODEX_HOME flows for personal and work sessions

    Desired workflow:

    codex --name "desc-pay refund panel"
    codex resume "desc-pay refund panel"

    This would avoid the current start-then-rename flow when the intended task name is already known. I am going to try a focused implementation and will link a branch or PR if GitHub allows it.

  9. Higor-Matos commented on Jun 10, 2026

    @Higor-Matos

    I implemented a focused branch for this on my fork, but GitHub is blocking PR creation from my account with:

    GraphQL: Higor-Matos does not have the correct permissions to execute `CreatePullRequest`
    

    Branch/commit:

    Implementation summary:

    • adds codex --name <THREAD_NAME> for fresh interactive sessions
    • normalizes/rejects empty names before TUI startup
    • rejects --name for subcommands and for resume/fork paths instead of silently ignoring it
    • uses the existing thread/name/set app-server API immediately after thread/start, so it works through the current TUI app-server startup path without adding a new thread/start protocol field

    Validation:

    • cargo fmt --all (fallback because just is not installed locally)
    • cargo test -p codex-cli name_flag --bin codex
    • cargo test -p codex-tui thread_name --lib

    The first test run hit a webrtc-sys GitHub download timeout for webrtc-mac-arm64-release.zip; I pre-downloaded the expected archive into the local Cargo build cache and reran the tests successfully.

  10. est7 commented on Jul 4, 2026

    @est7

    Friendly ping on this.

    There now seem to be multiple independent implementations of this feature, along with several users requesting the same workflow. The implementation also appears relatively self-contained since it builds on the existing thread naming and resume infrastructure.

    Is there any maintainer feedback on the proposed --name approach, or any design concerns that should be addressed before this can move forward?

    I'd be happy to help test or iterate on the implementation if that would help get it merged.

  11. sshekhar-coursera commented on Jul 15, 2026

    @sshekhar-coursera

    Is this being picked, its a real important feature I am awaiting.

  12. LamForest commented on Jul 22, 2026

    @LamForest

    This is exactly the feature I’m looking for.

    I can confirm that the startup naming option is still unavailable in
    codex-cli 0.145.0-alpha.27 on macOS.

  13. saidelike commented on Jul 24, 2026

    @saidelike

    Also voted for this

  14. gswallow commented on Aug 6, 2026

    @gswallow

    Correction: I should have read the manual. /rename already exists in the CLI.

    The actual gap I ran into was discoverability, not the absence of a rename feature.

  15. matanox commented on Oct 21, 2026

    @matanox

    This would be a workflow and fluency improvement for those who run many concurrent Codex CLI sessions, surely not hard to implement, and perhaps also one that does not carry a huge tangle of design interactions versus existing feature sets.

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

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions