Allow setting thread name at session start with codex --name
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:
``bash`
codex --name "issue AAA"
`
This should work with the existing thread naming and resume behavior, so the same session can later be resumed with:
bash``
codex resume "issue AAA"
## Problem
Today, naming a conversation is a two-step flow:
- Start a session with codex
- 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 <name> already resolves thread names
So the missing part is mainly exposing an initial-name option on the fresh-session path.
Additional information
_No response_
8 Comments
I implemented this on my fork, but GitHub is blocking PR creation because
openai/codexonly allows collaboratorsto open pull requests.
Branch:
zipus/issue-14482-initial-thread-nameCommit:
382d8909Fork branch URL:
https://github.com/zipus/codex/tree/zipus/issue-14482-initial-thread-name
Summary:
codex --name "..."for fresh interactive sessions--nameon resume/fork instead of ignoring itNow that 0.120.x has
/renamein interactive mode, it just makes sense to have a--nameflag. Hoping this can get bumped up and gain some traction for next release.That would be a great addition to the CLI!
Adding a related Desktop use case: this would also help Codex Desktop users whose first prompt naturally begins with long local paths.
Example workflow:
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:
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:
thread/name/setwith{ threadId, name }session_index.jsonlcan contain the concise title whilestate_5.sqlite.threads.titlestill contains the long first promptSo
--name/ initial-name support would solve the workflow problem, while #16405 tracks keeping the persistence layers in sync after a name is set.I hit this in daily CLI use with multiple concurrent Codex sessions.
Environment:
Desired workflow:
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.
I implemented a focused branch for this on my fork, but GitHub is blocking PR creation from my account with:
Branch/commit:
Implementation summary:
codex --name <THREAD_NAME>for fresh interactive sessions--namefor subcommands and forresume/forkpaths instead of silently ignoring itthread/name/setapp-server API immediately afterthread/start, so it works through the current TUI app-server startup path without adding a newthread/startprotocol fieldValidation:
cargo fmt --all(fallback becausejustis not installed locally)cargo test -p codex-cli name_flag --bin codexcargo test -p codex-tui thread_name --libThe first test run hit a
webrtc-sysGitHub download timeout forwebrtc-mac-arm64-release.zip; I pre-downloaded the expected archive into the local Cargo build cache and reran the tests successfully.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
--nameapproach, 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.
Is this being picked, its a real important feature I am awaiting.