Guide · AI agents

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.

Rename Codex Thread command in the patched VS Code context menu.
Project screenshot from the original guide: the patcher adds a rename action. This is not a claim of compatibility with every current extension version. Image source (Opens in a new tab). The Boring Cat. Existing project screenshot; image unchanged.

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.

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.

Comments

Loading comments.

    Write a comment

    Your choices

    Privacy controls

    This site sets no optional cookies, so there is nothing to accept or reject. Here is what happens and what you can change.

    Read the cookie policy
    Theme preference
    If you choose light or dark mode, this site saves that choice in your browser. Clear it below to follow your system setting again.
    External videos and posts
    Off by default. A provider loads only when you press its button, for that page view. Reload the page to close it.
    Form spam check
    Cloudflare Turnstile loads only when you send a form. It may complete without showing a challenge.
    Visit statistics
    Cloudflare Web Analytics counts visits without setting cookies or storing a choice on your device.