External Publication
Visit Post

Codex VSCode Extension - How to name/rename a task?

OpenAI Developer Community May 15, 2026
Source

I just built one with ChatGPT that will get you there, until something more formal is implemented. Try this prompt in Codex.

Use this revised prompt:

Create a small local command-line helper for the Codex VS Code extension called `codex-rename`.

Goal:
Rename local Codex task/sidebar titles without changing Codex extension code or session history.

Known storage:
- Database: `~/.codex/state_5.sqlite`
- Table: `threads`
- Rename field: `title`

Important:
- Update only `threads.title`.
- Do not update `first_user_message`.
- Do not update `preview`.
- Do not edit rollout JSONL files.
- Do not edit `session_index.jsonl`.
- Do not create backups.
- Do not bump `updated_at` or `updated_at_ms`, because renaming should not reorder sessions.

Implementation:
- Create Python script at `~/.codex/tools/codex-rename.py`.
- Create executable shell shim at `/usr/local/bin/codex-rename`.
- Use only Python standard library: `sqlite3`, `os`, `sys`, `termios`, `tty`, `shutil`, `pathlib`.
- Support `CODEX_HOME` env var, defaulting to `~/.codex`.
- Use SQLite busy timeout, e.g. `PRAGMA busy_timeout = 5000`.
- Use a transaction for the update.

Interactive behavior:
- Running `codex-rename` opens a terminal picker.
- Show 10 recent non-archived sessions at a time.
- Query should be:
  - `WHERE archived = 0`
  - ordered by `COALESCE(updated_at_ms, updated_at * 1000) DESC`
- Show each row with:
  - number
  - updated timestamp
  - cwd
  - current title
- Use numbers `1`-`9`, and `0` for the 10th item.
- Press `Space` to show the next page of 10.
- Page should wrap back to page 1 after the last page.
- Press `q` to quit.
- After selecting a session, prompt for `New title:`.
- Show old title and new title.
- Ask for confirmation before writing.
- After a successful rename, stay open and ask:
  `Press Enter to rename another session, or q to quit:`
- On final quit, if anything was renamed, print:
  `Reload VS Code window: Command Palette -> Developer: Reload Window`
  `Then reopen the Codex sidebar if needed.`

Also include the exact shell commands to install it and chmod it.

All my sessions are now properly renamed: For example: AI Analysis Engineer, Team Lead. It works especially well when forking sessions.

Discussion in the ATmosphere

Loading comments...