The Codex VS Code extension puts OpenAI's Codex agent in a sidebar next to your code. Install it from the Visual Studio Marketplace (extension ID openai.chatgpt), sign in with ChatGPT or an API key, and Codex can read your open files and selections, edit code, run commands in a sandbox, and hand bigger tasks to Codex Cloud. The same extension installs in Cursor and Windsurf.
Everything below comes from OpenAI's Codex IDE extension docs, its settings reference and command reference, read on 24 October 2026.
What is the Codex VS Code extension?
It is the editor front end for the same agent that powers the Codex CLI. OpenAI sums up the idea as working "with Codex beside your code": bring open files and selections into the prompt, review edits in place, and delegate longer work without leaving the editor.
The extension and CLI share their configuration layers, so a model, sandbox or MCP server you set in ~/.codex/config.toml applies to both. The Codex config.toml guide explains where that file lives and which layer wins.
How do you install it in your editor?
OpenAI's docs list one extension for VS Code and compatible editors, plus separate integrations for JetBrains and Xcode:
| Editor | How to get Codex |
|---|---|
| Visual Studio Code | Install the Codex extension (openai.chatgpt) from the Visual Studio Marketplace |
| VS Code Insiders | Same Marketplace extension |
| Cursor | Same extension, installed from inside Cursor |
| Windsurf | Same extension, installed from inside Windsurf |
| JetBrains IDEs | Built into JetBrains AI Assistant: open AI Chat and select Codex |
| Xcode | Xcode's coding intelligence: start a chat and choose Codex as the agent |
After installing in VS Code, Cursor or Windsurf:
- Select the Codex icon. If you do not see it, open the Command Palette and run Codex: Open Codex Sidebar.
- On the signed-out screen, choose Sign in with ChatGPT and finish the browser flow, or choose Use API Key, paste your key and select OK.
- Open a project and ask Codex to explain the codebase or make one focused change.
OpenAI recommends creating Git checkpoints before and after a task so you can revert. Signing in with ChatGPT uses your plan's limits; an API key bills at standard API rates and does not include cloud features.
JetBrains notes
The JetBrains Codex page lists three ways to authenticate: a JetBrains AI subscription, an API key, or a ChatGPT account. Two limits are worth knowing: a bring-your-own-key setup needs a key issued directly by OpenAI, and Codex does not respect AI Assistant's .aiignore file, so files listed there can still be processed. Codex in JetBrains reads AGENTS.md from the project root.
What can the extension do?
- Use editor context. The extension automatically includes your open files. Select code before you prompt to focus Codex on it, and use
/ide-contextto turn automatic context on or off. - Edit and review in place. Codex shows a summary and a focused diff beside your code. Keep the changes you want and ask for follow-ups in the same chat.
- Review your work.
/reviewreviews uncommitted changes or compares against a base branch. - Plan first.
/plantoggles plan mode so Codex proposes an approach before editing. - Address TODOs. A CodeLens appears above
TODOcomments so Codex can pick them up. - Isolate work.
/worktreeruns the chat in a new Git worktree.
The most useful slash commands, from the official list:
| Command | What it does |
|---|---|
/model, /reasoning |
Pick the model and reasoning effort for this chat |
/plan |
Toggle plan mode |
/review |
Review uncommitted changes or a branch diff |
/local, /cloud |
Run the chat locally or in the cloud |
/cloud-environment |
Choose the cloud environment |
/compact |
Compact the chat's context |
/init |
Generate an AGENTS.md scaffold |
/mcp |
Show connected MCP servers |
/status |
Show chat ID, context usage and rate limits |
How do permissions work in the extension?
Use the permissions control beneath the composer. Depending on your configuration it offers Ask for approval, Approve for me, Full access, and any named permission profiles. OpenAI suggests starting with Ask for approval, which lets Codex work inside the current workspace and pauses before going further.
Approve for me keeps the same workspace boundary but sends eligible approval requests to an automatic reviewer instead of you. Full access removes the sandbox, so save it for isolated environments. The Codex sandbox guide explains the modes underneath these labels.
On Windows, keep the agent inside WSL2 with this VS Code setting, which gives it Linux sandbox behavior:
{
"chatgpt.runCodexInWindowsSubsystemForLinux": true
}
Which settings can you change?
The extension has two layers of settings:
- Codex settings control agent behavior shared with the CLI: model, reasoning effort, permissions, sandbox, MCP servers and personalization. Open them from the gear icon > Codex Settings, or select Open config.toml to edit the file directly.
- Editor settings control how the extension behaves in your editor. Search your settings for
@ext:openai.chatgpt.
The editor settings worth knowing:
| Setting | Default | What it controls |
|---|---|---|
chatgpt.followUpQueueMode |
queue |
Whether messages sent during a run wait (queue) or steer the current run (steer) |
chatgpt.composerEnterBehavior |
enter |
Whether Enter sends, or a Cmd/Ctrl modifier is needed |
chatgpt.reviewDelivery |
inline |
Run /review in the current chat or a separate one (detached) |
chatgpt.commentCodeLensEnabled |
true |
CodeLens above TODO comments |
chatgpt.openOnStartup |
false |
Focus the Codex sidebar when the extension starts |
chatgpt.runCodexInWindowsSubsystemForLinux |
false |
Windows only: run Codex in WSL |
These chatgpt.* keys stay in editor settings and never go in config.toml. You can also bind keyboard shortcuts to commands such as chatgpt.newChat (Cmd+N or Ctrl+N by default), chatgpt.addToThread and chatgpt.addFileToThread through Preferences: Open Keyboard Shortcuts.
Local or cloud: when should you use each?
Local chats run on your machine against your working copy. Cloud chats run on OpenAI's machines from a published Codex Cloud environment.
| Local | Cloud | |
|---|---|---|
| Where it runs | Your computer, inside the Codex sandbox | An isolated cloud VM |
| Files it sees | Your checkout, including uncommitted work | The environment's repositories |
| Sign-in | ChatGPT or API key | ChatGPT only, on a plan with Codex cloud |
| Best for | Quick edits, learning code, reviewing changes | Long tasks, parallel work, work that should continue while you are away |
To delegate, select the cloud icon beneath the composer (or run /cloud) and pick an environment. OpenAI's prompting guide says the new cloud chat "carries over the existing chat context (including the plan and any local source changes)." When it finishes, review the cloud diff, then open a pull request from the cloud or pull the changes locally.
Tips for using the Codex extension well
- Select before you ask. A highlighted function gives Codex a tighter starting point than a whole file.
- Commit before big edits. A clean working tree makes every change easy to inspect and undo.
- Plan locally, build remotely. Use
/planto agree on milestones, then send each milestone to the cloud. - Tell Codex about your edits. If you revert or change something it wrote, say so, so it does not overwrite your fix.
- Set defaults in config.toml. Your model and permission choices then carry over to the CLI.
Keep your skills out of one editor
Skills you use in the extension are plain folders, so they travel well. Kipt keeps your prompts and Agent Skills as Markdown in a private GitHub repo you own and installs every skill into Codex with one npx skills add command, which means the same library works in VS Code, Cursor and the terminal. See the Codex skills guide for where Codex looks for them.