Codex IDE Extension
OpenAI's coding agent for your editor
Overview
The Codex IDE extension brings OpenAI's coding agent directly into your editor. It reads your codebase, edits files, runs commands, and integrates with your development workflow — all without leaving your IDE.
Platform support
Codex IDE integrations are available for VS Code-compatible editors and JetBrains IDEs on macOS, Windows, and Linux:
- VS Code — Visual Studio Code, Cursor, Windsurf, and VS Code Insiders
- JetBrains — IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs
Install the extension from the Visual Studio Code Marketplace or your JetBrains IDE's plugin manager.
Authentication
Sign in with your ChatGPT account or an API key. ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex access. The extension updates automatically and supports customizable keyboard shortcuts.
Features
Chat and editing
Reference files with @filename syntax to provide context, enabling shorter, more focused prompts. The interface supports seamless previewing of changes before they are applied.
Model selection
A built-in model switcher allows you to change models dynamically during work sessions.
Reasoning control
Adjust reasoning effort to low, medium, or high. Higher settings provide deeper analysis but consume more tokens and require longer response times.
Approval modes
The extension offers three operational modes:
| Mode | Description |
|---|---|
| Chat | Conversation-only mode for planning and discussion. |
| Agent | Codex automatically handles file reading, editing, and local commands. Network access requires approval. |
| Agent (Full Access) | Unrestricted file and network access without approval prompts. |
Cloud execution
Offload work to Codex's cloud environment by selecting a configured cloud workspace and choosing Run in the cloud. Tasks execute from either the main branch or local changes. Follow-up prompts maintain conversation context, and changes can be reviewed in the cloud interface before local application.
Web search
Enabled by default for local tasks. Uses an OpenAI-maintained cache of indexed results rather than live fetching, reducing injection risks while maintaining relevance.
Image generation
Built-in image creation using gpt-image-2. Invoke explicitly with $imagegen or request naturally in your prompt. Image generation counts toward standard usage limits.
Image import
Attach images to prompts with Shift+drag-and-drop into the chat interface. Use screenshots or design specs so Codex can reason about visual content alongside code.
Settings
The Codex IDE extension can be customized through editor settings and a shared configuration file.
How to change settings
- Open editor settings
- Search for "Codex" or the specific setting name
- Update the value
~/.codex/config.toml rather than editor settings.Settings reference
| Setting | Purpose |
|---|---|
chat.fontSize | Adjusts chat text size in the sidebar, including conversation content and composer. |
chat.editor.fontSize | Controls code-rendered content display, including snippets and diffs. |
chatgpt.cliExecutable | Development-only setting for specifying the Codex CLI executable path. |
chatgpt.commentCodeLensEnabled | Enables CodeLens above to-do comments for Codex completion. |
chatgpt.localeOverride | Sets preferred UI language (auto-detects if left empty). |
chatgpt.openOnStartup | Focuses the Codex sidebar upon extension startup. |
chatgpt.runCodexInWindowsSubsystemForLinux | Windows-specific: runs Codex in WSL when available. Requires VS Code reload. |
IDE Commands
The Codex IDE extension provides commands accessible through the VS Code Command Palette to control Codex functionality directly from your editor.
Assigning key bindings
- Open the Command Palette with Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)
- Select Preferences: Open Keyboard Shortcuts
- Search for "Codex" or a specific command ID like
chatgpt.newChat - Click the pencil icon and input your preferred shortcut
Available commands
| Command | Default Binding | Function |
|---|---|---|
chatgpt.addToThread | None | Include selected text as context within the active thread. |
chatgpt.addFileToThread | None | Include the complete file as context for the active thread. |
chatgpt.newChat | Cmd+N / Ctrl+N | Start a new conversation thread. |
chatgpt.implementTodo | None | Direct Codex to resolve a highlighted TODO comment. |
chatgpt.newCodexPanel | None | Launch an additional Codex panel. |
chatgpt.openSidebar | None | Display the Codex sidebar interface. |
Slash Commands
Type / in the chat input, select from the dropdown list (or continue typing to filter), and press Enter.
| Command | Description |
|---|---|
/auto-context | Toggle automatic inclusion of recent files and IDE context. |
/cloud | Switch to remote cloud execution mode. |
/cloud-environment | Select which cloud environment to use. |
/feedback | Submit user feedback and optionally attach logs. |
/local | Switch to local workspace execution. |
/review | Initiate code review mode for uncommitted changes. |
/status | Display thread ID, context usage, and rate limit information. |