Codex in VS Code: install, sign in, modes, Remote-SSH, WSL
OpenAI’s Codex extension for VS Code, Cursor and Windsurf: install ID, sign-in, the permission modes, shared config.toml, cloud handoff, Remote-SSH, WSL fixes.
OpenAI’s Codex extension for VS Code is listed as Codex – OpenAI’s coding agent, ID openai.chatgpt, and the same extension installs in Cursor and Windsurf. Install it with code --install-extension openai.chatgpt, open it from the Codex icon or Codex: Open Codex Sidebar in the Command Palette, and choose Sign in with ChatGPT (Plus, Pro, Business, Edu or Enterprise) or Use API Key. The permissions control under the composer sets what it does alone: Ask for approval edits inside the workspace and asks before touching other files or the internet, Approve for me keeps that sandbox but lets an automatic reviewer answer, and Full access turns off the sandbox and the prompts. It reads the same ~/.codex/config.toml and the same saved sign-in as the Codex CLI, hands a chat to Codex cloud from the cloud icon, and in a Remote-SSH or WSL window it runs on the remote side, with that machine’s files, settings and login. The current release is 26.1117.41037, published November 20, 2026.
Install it in VS Code, Cursor or Windsurf
The extension is on the VS Code Marketplace, published by OpenAI, with more than 17 million installs as of November 23, 2026. From a terminal:
code --install-extension openai.chatgptCopiedOpenAI’s IDE extension page points Cursor and Windsurf at the same ID (its buttons open cursor:extension/openai.chatgpt and windsurf:extension/openai.chatgpt). Cursor installs extensions from Open VSX, where OpenAI publishes it as a verified openai.chatgpt at the same version numbers. JetBrains IDEs and Xcode are the exception: they have their own Codex integrations, chosen in JetBrains’ AI Chat and in Xcode’s coding assistant.
- Versions. Release builds and pre-release builds ship side by side: on November 20 the release was 26.1117.41037 and the pre-release 26.51117.41037, a 5 in front of the middle number. The Install button’s menu has Install Pre-Release Version if you want the second. The manifest requires VS Code 1.96.2 or later.
- A second extension comes with it. Installing Codex also installs Codex Audio, described as “Local microphone support for Codex dictation, including remote workspaces.”
- Finding it. Choose the Codex icon. The extension’s manifest puts its view in the secondary side bar where the editor has one, and in the activity bar where it doesn’t; if you see neither, run Codex: Open Codex Sidebar.
- Not open source. OpenAI’s open-source page lists the extension as “Not open source”, unlike the CLI, but its bugs are reported on the openai/codex tracker, which is where the fixes below were announced.
Sign in: a ChatGPT plan or an API key
The signed-out screen has two buttons, per OpenAI’s authentication page: Sign in with ChatGPT, which opens a browser and returns your credentials to the extension, and Use API Key, where you paste a key from the OpenAI platform and select OK.
- On a ChatGPT plan, Codex in the editor draws on your plan’s allowance. The listing says it is “included in ChatGPT Plus, Pro, Business, Edu, and Enterprise plans”, and OpenAI’s pricing page puts “in the IDE extension” on the Plus card ($20 a month), while the Free and Go cards mention only “GPT-6 Luna at Standard speed in the desktop app, subject to rollout”. Limits and models per plan are in which ChatGPT plans include Codex.
- On an API key, usage is billed at API rates and the editor works locally only: the API-key card reads “No cloud-based features (GitHub code review, Slack, etc.)”, and “Codex cloud requires signing in with ChatGPT.”
- The sign-in is the CLI’s. “The CLI and extension share the same cached login details. If you log out from either one, you’ll need to sign in again the next time you start the CLI or extension.” The cache is
~/.codex/auth.jsonor your operating system’s credential store.
Permissions: Ask for approval, Approve for me, Full access
The permissions control beneath the composer is the extension’s equivalent of the CLI’s /permissions. OpenAI’s permissions page recommends starting with Ask for approval and describes the entries this way:
| Mode | What the menu says | Underneath |
|---|---|---|
Ask for approval | “Always ask to edit external files and use the internet” | The workspace-write sandbox; requests to go beyond it come to you |
Approve for me | “Only ask for actions detected as potentially unsafe” | The same sandbox, approval_policy on-request, with approvals_reviewer set to auto_review |
Full access | “Unrestricted access to the internet and any file on your computer” | sandbox_mode = "danger-full-access" with approval_policy = "never" |
Custom (config.toml) | “Uses permissions defined in config.toml” | Whatever your file sets, such as sandbox_mode = "read-only" for a chat that reads but asks before any edit or command |
The menu can also list named permission profiles, and an organization’s policy can remove entries. The sandbox is what lets the first two run unattended: per the sandboxing page, commands Codex starts, “git, package managers, or test runners” included, inherit it, enforced by Seatbelt on macOS, bubblewrap on Linux and WSL2, and the Windows sandbox on native Windows. Its network is off: “the default workspace-write sandbox mode keeps network access turned off unless you enable it in your configuration”, so an npm install or a test that calls an API stops for approval in Ask for approval mode. To allow it, add this to ~/.codex/config.toml:
[sandbox_workspace_write]
network_access = trueCopiedApprove for me does not widen the sandbox; it sends the requests to a reviewer model, which “uses extra model calls, so it can add to Codex usage.” If the entry is missing or greyed out, OpenAI’s troubleshooting page points at an explicit features.guardian_approval = false in your config, or at a workspace policy you cannot override locally. To have Codex propose before it edits, /plan toggles plan mode. The trade-offs of running with no prompts at all are in Claude Code and Codex without permission prompts.
What it shares with the Codex CLI, and what is the editor’s own
OpenAI’s extension settings page splits the settings in two. The agent’s side, “the model, reasoning effort, permissions, sandbox, MCP servers, and personalization”, is read from config.toml, the same layered file the CLI reads: your ~/.codex/config.toml and a trusted project’s .codex/config.toml. Select the gear in the Codex sidebar, then Codex Settings for the common controls or Open config.toml for the file. Where each layer lives and which one wins is in the config.toml guide.
The editor’s side lives in VS Code’s own settings under chatgpt.* keys (search @ext:openai.chatgpt), and those “don’t go in config.toml”. The ones worth knowing, with their defaults:
| Setting | Default | What it does |
|---|---|---|
chatgpt.followUpQueueMode | queue | A message sent while Codex is working waits for the next run (queue) or steers the current one (steer); Cmd/Ctrl+Shift+Enter does the opposite once |
chatgpt.composerEnterBehavior | enter | Enter sends; cmdIfMultiline needs Cmd/Ctrl+Enter for multi-line prompts, cmdAlways always |
chatgpt.reviewDelivery | inline | /review runs in the current chat, or in a separate one with detached |
chatgpt.commentCodeLensEnabled | true | An Implement with Codex link above TODO comments |
chatgpt.openOnStartup | false | Focus the Codex sidebar when the extension starts |
chatgpt.runCodexInWindowsSubsystemForLinux | false | Windows only; see the WSL section, where the docs and the extension disagree |
MCP servers are added from the gear menu: MCP servers, Add server, a name, STDIO or Streamable HTTP, then Restart extension; an OAuth server shows Authenticate. They are saved to config.toml, and OpenAI’s MCP page adds: “The ChatGPT desktop app, Codex CLI, and IDE extension share this configuration.” The file format is in Codex MCP servers.
The ChatGPT desktop app, which now contains the Codex app, links up with the extension: “When the ChatGPT desktop app and IDE extension are open in the same project, they share active chats and editor context,” and you can open an app chat from the extension or continue an extension chat in the app.
The Codex binary is not shared. The extension runs its own bundled executable, so its Codex version is the extension’s, not necessarily your CLI’s. chatgpt.cliExecutable can point it elsewhere, but OpenAI labels that setting development-only and warns that “manually overriding the bundled executable can prevent parts of the extension from working.” So the editor and the CLI can disagree about which models and features exist.
Editor context, commands and slash commands
“The IDE extension automatically includes your open files as context,” per OpenAI’s prompting guide, and /ide-context turns that on or off. To point at specific code, select it and run Add to Codex Chat, or add a whole file with Add File to Codex Chat; both are in the Command Palette under Codex and can be given shortcuts. chatgpt.newChat is Cmd+N on macOS and Ctrl+N on Windows and Linux. OpenAI’s own advice on its IDE page: “Create Git checkpoints before and after a task so you can revert changes.”
Typing / in the composer lists the slash commands. From OpenAI’s command reference:
| Command | What it does |
|---|---|
/model, /reasoning | Choose the model, and the reasoning effort, for the current chat |
/plan | Toggle plan mode for multi-step planning |
/review | Review uncommitted changes, or compare against a base branch |
/local, /cloud, /cloud-environment | Run the chat in your workspace or in the cloud, and choose its cloud environment |
/worktree | Run the chat in a new Git worktree |
/status | Show the chat ID, context usage and rate limits |
/mcp | Show connected MCP servers |
/init | Generate an AGENTS.md scaffold for the project |
/side, /fork, /compact | A temporary side chat, a copy of the chat, or a compacted context |
Handing a task to Codex cloud
A chat can move from your machine to OpenAI’s. The prompting guide’s steps: “Click on the cloud icon beneath the prompt composer and select your cloud environment.” With your next prompt, “Codex creates a new chat in the cloud that carries over the existing chat context (including the plan and any local source changes).” /cloud and /cloud-environment do the same from the keyboard, and /local brings the next run back. You review the cloud diff in the same chat, then open a pull request from the cloud or pull the changes down.
What it takes: a ChatGPT sign-in, since API keys get no cloud features; Plus, Pro, Business or Enterprise, the plans the pricing page lists for Codex cloud; and a cloud environment, which is created “on the web or in the desktop app”, not in the editor. If you sign in to ChatGPT with an email and password, OpenAI requires multi-factor authentication before Codex cloud opens. Beyond the chat and your changes, the cloud machine gets nothing of yours: “Your computer’s local files, running processes, browser sign-ins, and VPN access aren’t automatically transferred to it.” How long a cloud task keeps its state, and when a machine of your own fits better, is in Codex cloud or your own machine.
Codex on a remote machine: Remote-SSH, WSL and containers
Remote-SSH
The registries list Codex as a workspace extension, and VS Code runs workspace extensions “on the remote machine / environment” whenever the folder is remote, child processes included. So in a Remote-SSH window Codex is installed on the server and works there: its commands run on the server, it edits the server’s files, and the ~/.codex it reads and writes, with config.toml, the sign-in and the chat history, belongs to the account you connected as, not to your laptop. When you first connect, a locally installed Codex shows dimmed under Local - Installed; select Install to put it on the host, or list it for every host in your VS Code settings:
"remote.SSH.defaultExtensions": ["openai.chatgpt"]CopiedDeveloper: Show Running Extensions tells you which side an extension runs on. Codex Audio is a ui extension and stays on your computer, which is how dictation keeps using your own microphone in a remote window.
Two things follow from Codex living on the server. Its sandbox needs bubblewrap there, and on Ubuntu 24.04 it may also need an extra AppArmor profile loaded; both are in Codex CLI on a Linux server. And one Linux account shared by several people is one Codex, sign-in and history included. When a user reported exactly that, an OpenAI engineer answered “If you’re sharing the same account on a server, then you all have access to the same files, home directory, etc.”, and pointed at separate accounts as the fix.
WSL
Here OpenAI’s docs and the extension disagree. The settings page and the security page tell you to set chatgpt.runCodexInWindowsSubsystemForLinux to true (“Run Codex in WSL when WSL is available”). The extension’s own description of that setting, in 26.1117.41037, reads: “Deprecated. To run Codex in WSL, reopen your folder using the Microsoft WSL extension. Turn this setting off to run Codex on Windows. Changing it reloads the window.” OpenAI’s WSL page describes the same route the extension now asks for, a WSL window opened from inside Linux:
# from your WSL shell
cd ~/code/your-project
code .CopiedThe status bar then shows WSL: <distro>, and Codex runs in Linux under the Linux sandbox, so install bubblewrap in the distribution. Keep the repository under your Linux home rather than /mnt/c, which the page says is slower. WSL1 is out: it “was supported through Codex 0.114”, and 0.115 moved the Linux sandbox to bubblewrap. Native Codex on Windows keeps its files in %USERPROFILE%\.codex and Codex inside WSL in the Linux home, and OpenAI’s Windows page says they don’t share configuration, cached sign-in or history unless you sync the two folders or point CODEX_HOME at one. Setting WSL up in the first place is its own guide.
Dev containers
OpenAI’s security page gives two ways to run Codex in a Dev Container: keep its Linux sandbox if the container grants what bubblewrap needs, or treat the container as the boundary and run Codex with full access inside it. It is direct about the second: “a malicious project can exfiltrate anything available inside the devcontainer, including Codex credentials.”
Codex in VS Code’s own chat, without the extension
VS Code now treats Codex as one of its agent harnesses beside Copilot and Claude. Its harness docs (November 2026) say “Codex is not listed by default” and give two routes. The extension above is one: installed, it adds Codex to VS Code’s Chat view. The other is an experimental Agent Host integration: enable chat.agentHost.codexAgent.enabled “to make Codex available in the Agents window without the OpenAI Codex extension,” and chat.editor.codex.preferAgentHost to use it in the Chat view too, where it replaces the extension’s Codex choice: “Only one Codex implementation appears in each window.” It runs on Copilot Pro+ or on a ChatGPT sign-in, about which the docs say: “A free ChatGPT account is sufficient.” Its own permission picker offers Default Permissions, Auto-Review and Full Access. Copilot’s enterprise-managed settings turn the Codex harness off unless an administrator allows it.
When it goes wrong
- “Codex could not start. The extension could not start its user interface.” This hit many users after 26.1021.22027 in late October, locally and over Remote-SSH. OpenAI closed the report on November 11: “Please update the Codex extension to 26.1106.51428 (stable) or 26.51106.51428 (pre-release), then reload the editor window” that showed the error. A separate report of the same message over Remote-SSH, #56736, was still open with no reply from OpenAI on November 23. VS Code waits 12 hours by default before installing an extension update on its own; the extension’s Update button skips the wait. In a remote window, the copy that counts is the one on the host.
- Rolling back a bad update. OpenAI’s instructions on an earlier breakage: “In VS Code’s Extensions view, right-click Codex, select Install Another Version, and choose that release.” From a terminal, append the version:
code --install-extension openai.chatgpt@26.1106.51428. Once the fix ships: “If you installed an older version as a workaround, update it manually.” - Sign-in never finishes in a remote window. The browser on your computer is sent to
http://localhost:1455/auth/callback, Codex’s callback server, which is running on the server, so that port has to reach it. VS Code’s port forwarding moves a forward to another local port when the first is in use, and a user reports 1455 held by another VS Code window or Codex instance; one Dev Containers user found the callback forwarded to 1456 and signed in once it was set back to 1455, which the Forwarded Ports panel lets you change. The fallback OpenAI documents for the CLI is to forward the port yourself,ssh -L 1455:localhost:1455 you@server, and sign in again. The other is the CLI’s browserlesscodex login --device-auth, run in the server’s terminal once device code sign-in is switched on in your ChatGPT security settings (the CLI is a separate install there); OpenAI’s auth page says the CLI and the extension share their cached login. A report from November 19 of the browser stuck on “Waiting for 127.0.0.1...” is still open. - “Sign-in failed: workspace routing discovery timed out.” Open on the tracker since September 28; most of the users who cleared it ended the leftover
codexprocesses on the machine where Codex runs, a long-running app-server among them, and started again. - Installs and API calls stop for approval, or fail with network errors. That is the sandbox’s network switch above. If commands fail before they start with
bwrap:errors on Linux, it is bubblewrap, covered in Codex sandbox and bubblewrap errors. - “VS Code in WSL cannot find codex.” OpenAI’s WSL page has you check inside WSL with
which codex || echo "codex not found"and install the CLI in the distribution if it is missing. - On Windows, installed but unresponsive. The Windows sandbox page says your system may be missing C++ development tools: install Visual Studio Build Tools with the C++ workload and the Visual C++ Redistributable (x64), for example with
winget install --id Microsoft.VisualStudio.2022.BuildTools -e, then fully restart VS Code.