Skip to content

Repository files navigation

codexwinsync

Enable Settings > Connections > Control other devices in Codex Desktop for Windows without modifying ChatGPT.exe, app.asar, or any file under C:\Program Files\WindowsApps.

Tested with Codex Desktop 26.715.7063.0 and 26.715.10079.0 on Windows 11.

Important

Enable multi-factor authentication (MFA) on your OpenAI/ChatGPT account **before** linking the account or adding a device. Remote-control enrollment requires MFA to already be active.

Warning

This is an unofficial, version-sensitive runtime experiment. It launches Codex with localhost debugging ports that can execute code inside the Codex process. Use it only on a trusted machine, and launch Codex normally when you are finished.

What works

  • Shows the shipped Control other devices tab on Windows.
  • Authorizes and stores a Windows controller device key.
  • Lists signed-in Codex devices available to control.
  • Opens projects on a connected remote host.
  • Imports preexisting projects from connected hosts into the Windows sidebar.
  • Imports preexisting remote chats and groups them under their matching remote projects.
  • Leaves the installed Codex package unchanged.

Requirements

  • Windows 10 or Windows 11.
  • Codex Desktop installed from the Microsoft Store/MSIX package.
  • Node.js 22 or newer available as node.exe on PATH.
  • MFA enabled on the OpenAI/ChatGPT account before device enrollment.
  • Another signed-in Codex host available on the same account.

Run

  1. Clone the repository:
   git clone https://github.com/harisharvind/codexwinsync.git
   cd codexwinsync
  1. Quit Codex Desktop.
  2. Run the launcher:
   powershell -NoProfile -ExecutionPolicy Bypass -File .\launch-codex-remote-control.ps1
  1. In Codex, open Settings > Connections > Control other devices.
  2. Select Add and complete authorization with the MFA-enabled account.
  3. Create a project and choose the connected device under New remote project.

The launcher writes diagnostics to %TEMP%\codexwinsync.log.

Preexisting projects and chats normally appear within 30 seconds after their host connects. The importer reads project names and root paths from that host's Codex global state, lists the host's existing threads, and adds missing project and chat-to-project mappings to the Windows controller. If a remote chat was created without a saved project, its working directory becomes a remote project entry so the chat can be shown in the sidebar. Chat contents remain on the remote host and load from there when opened; the importer never copies or deletes project files or chat transcripts.

How it works

Codex Desktop 26.715 ships the Windows remote-controller UI and backend client, but two checks prevent the controller flow from working:

  1. Statsig gate 782640499 is inverted in the renderer. A value of true hides showControlOtherDevices, so the runtime override forces this one gate to false.
  2. The main process rejects device-key operations unless process.platform is darwin, then tries to load remote-control-device-key.node, which is not shipped in the Windows package.

The launcher starts Codex with renderer DevTools on 127.0.0.1:9322 and the Electron main-process inspector on 127.0.0.1:9333. It then:

  • Overrides only Statsig gate 782640499 in renderer Statsig clients.
  • Reports darwin only while the shipped getAddon() device-key method is on the call stack.
  • Intercepts only requests for remote-control-device-key.node.
  • Supplies an in-memory P-256 signing implementation.
  • Encrypts private keys with Windows DPAPI using CurrentUser scope.
  • Stores encrypted keys in \.codex\remote-control-device-keys.windows.json.
  • Reconciles connected hosts' local project metadata and existing thread mappings with the controller every 30 seconds.

Disable or remove

To disable the runtime hooks, quit Codex and launch it normally. The hooks and debugging ports exist only in the specially launched process.

After revoking remote-control access in Codex, you can optionally remove the encrypted Windows key store:

Remove-Item -LiteralPath "$HOME\.codex\remote-control-device-keys.windows.json"

You can then delete this gist folder. No installed Codex files need restoration.

Troubleshooting

  • The tab is missing: Confirm Codex was launched by launch-codex-remote-control.ps1, then inspect %TEMP%\codexwinsync.log.
  • Authorization fails before linking: Confirm MFA was enabled before starting device enrollment, then retry Add.
  • No devices appear: Confirm the other Codex host is signed in to the same account, online, and configured to allow remote control.
  • Existing remote projects or chats are missing: Keep the host connected for up to 30 seconds. Confirm the runtime log contains Codex remote workspace metadata sync is active. and relaunch with the script if it does not.
  • A Codex update breaks the launcher: Launch Codex normally and stop using the override until the relevant gate and device-key code are reviewed for the new build.

Credits

- Hunter Beach — fixed the sync part and documented the workaround.

- zdaar — control other devices patch.

- brunolemos\ — Codex Desktop feature flag overrides

- Everyone contributing research, testing, and reports to [OpenAI Codex issue #28919](openai/codex#28919).

- OpenAI for Codex and the underlying remote-connections functionality.

This project is an independent, community-maintained workaround and is not affiliated with or endorsed by OpenAI.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages