{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiclsep6nrwanlxehfymqv5qaejop6rh4r7v7x7tlrh2qdoi2l7h74",
"uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mlxyt5kpyon2"
},
"path": "/t/codex-vscode-extension-how-to-name-rename-a-task/1375697#post_10",
"publishedAt": "2026-05-16T13:34:14.000Z",
"site": "https://community.openai.com",
"textContent": "I just built one with ChatGPT that will get you there until something more formal is implemented. Try this prompt in Codex.\n\nUse this revised prompt:\n\n\n Create a small local command-line helper for the Codex VS Code extension called `codex-rename`.\n\n Goal:\n Rename local Codex task/sidebar titles without changing Codex extension code or session history.\n\n Known storage:\n - Database: `~/.codex/state_5.sqlite`\n - Table: `threads`\n - Rename field: `title`\n\n Important:\n - Update only `threads.title`.\n - Do not update `first_user_message`.\n - Do not update `preview`.\n - Do not edit rollout JSONL files.\n - Do not edit `session_index.jsonl`.\n - Do not create backups.\n - Do not bump `updated_at` or `updated_at_ms`, because renaming should not reorder sessions.\n\n Implementation:\n - Create Python script at `~/.codex/tools/codex-rename.py`.\n - Create executable shell shim at `/usr/local/bin/codex-rename`.\n - Use only Python standard library: `sqlite3`, `os`, `sys`, `termios`, `tty`, `shutil`, `pathlib`.\n - Support `CODEX_HOME` env var, defaulting to `~/.codex`.\n - Use SQLite busy timeout, e.g. `PRAGMA busy_timeout = 5000`.\n - Use a transaction for the update.\n\n Interactive behavior:\n - Running `codex-rename` opens a terminal picker.\n - Show 10 recent non-archived sessions at a time.\n - Query should be:\n - `WHERE archived = 0`\n - ordered by `COALESCE(updated_at_ms, updated_at * 1000) DESC`\n - Show each row with:\n - number\n - updated timestamp\n - cwd\n - current title\n - Use numbers `1`-`9`, and `0` for the 10th item.\n - Press `Space` to show the next page of 10.\n - Page should wrap back to page 1 after the last page.\n - Press `q` to quit.\n - After selecting a session, prompt for `New title:`.\n - Show old title and new title.\n - Ask for confirmation before writing.\n - After a successful rename, stay open and ask:\n `Press Enter to rename another session, or q to quit:`\n - On final quit, if anything was renamed, print:\n `Reload VS Code window: Command Palette -> Developer: Reload Window`\n `Then reopen the Codex sidebar if needed.`\n\n Also include the exact shell commands to install it and chmod it.\n\n\nAll my sessions are now properly renamed: For example: AI Analysis Engineer, Team Lead. It works especially well when forking sessions.",
"title": "Codex VSCode Extension - How to name/rename a task?"
}