Codex Thread Renamer Patcher for VS Code

Practical guide for patching the OpenAI ChatGPT/Codex VS Code extension so Codex thread renames persist and update the UI immediately.

Harllens George | 2026-02-23

Codex Thread Renamer Patcher repository banner.

codex-thread-renamer-patcher is a local patcher for the OpenAI ChatGPT/Codex VS Code extension. It adds a reliable rename flow so Codex thread titles persist, patch cached values, and refresh in the sidebar without waiting for a restart.

What this is

This is a developer tool for people using OpenAI Codex in VS Code who want thread names that actually stick.

It patches the installed openai.chatgpt extension locally and adds:

  • a Rename Codex Thread command
  • a right click rename action in the thread list
  • backend plus cache updates for better persistence
  • immediate UI refresh through the existing webview message flow

Who it is for

  • Developers using Codex heavily in VS Code sessions
  • Builders managing many threads and wanting readable thread history
  • Teams testing local productivity tooling around OpenAI Codex workflows

Get it

Compatibility

  • VS Code with the OpenAI ChatGPT/Codex extension (openai.chatgpt)
  • Node.js installed locally
  • sqlite3 CLI available in PATH
  • Best used with extension versions verified by the patcher before applying

Why this patcher exists

Renaming a Codex thread is not only a UI problem. In practice, titles can be stored and rehydrated from multiple places. A simple database edit often fails because the running extension or cached state can overwrite the title again.

This patcher makes rename work as an action, not a one off file edit.

How it works (high level)

The patcher makes a minimal modification to the installed extension and keeps most custom logic in injected helper files.

It patches these areas:

  • package.json to contribute the rename command and menu entries
  • out/extension.js to load the runtime patch
  • webview/index.html to inject the webview helper

The runtime patch then does three layers of work:

  1. backend rename (source of truth)
  2. cache patching (workspace and extension caches)
  3. live webview update (thread-title-updated)

Quick start

1) Check patch status

node bin/codex-thread-renamer-patch.js status

2) Verify compatibility

node bin/codex-thread-renamer-patch.js verify

3) Apply the patch

node bin/codex-thread-renamer-patch.js apply

4) Reload VS Code

  • Developer: Restart Extension Host, or
  • reload the VS Code window

Screenshots

Choose a thread to rename

Context menu entry to rename a Codex thread in the VS Code sidebar.

Rename thread dialog flow

Rename flow for Codex thread title patch in VS Code.

Troubleshooting (fast)

  • Command appears but fails: restart the Extension Host or reload VS Code.
  • Rename persists but UI does not update: reopen the Codex sidebar, switch threads, and switch back.
  • Patch verification fails: your openai.chatgpt version likely changed, run verify and patch the correct extension directory.
  • Patched wrong extension folder: use --extension-dir to target the active extension build.

Safety notes

This tool modifies installed VS Code extension files on disk.

  • Reapply after OpenAI extension updates.
  • Run verify before apply when versions change.
  • Keep backups enabled and restore if you test unsupported builds.

Links