---
{
  "title": "A practical guide to OpenAI Codex integrations with VS Code (2026)",
  "slug": "openai-codex-integrations-with-vs-code",
  "intent": "consumer",
  "locale": "en",
  "date": "2026-06-04",
  "updated": "2026-06-04",
  "template": "default",
  "excerpt": "How to install, configure, and actually use OpenAI Codex in VS Code - covering the extension, CLI, cloud delegation, and where it genuinely beats GitHub Copilot.",
  "categories": ["Guides","Trending"],
  "tags": [
    "openai codex",
    "vs code",
    "ai coding",
    "github copilot"
  ],
  "readTime": 13,
  "author": 16,
  "reviewer": 4,
  "seo": {
    "title": "A practical guide to OpenAI Codex integrations with VS Code (2026)",
    "description": "Install OpenAI Codex in VS Code, configure approval modes, delegate cloud tasks, and understand how it compares to GitHub Copilot. Full 2026 guide.",
    "image": "https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/3e7160b00f234465ba7a7581d86f41e0.webp"
  },
  "coverImage": "https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/3e7160b00f234465ba7a7581d86f41e0.webp",
  "coverImageAlt": "OpenAI and VS Code logos on a warm off-white background illustrating Codex integration",
  "coverImageWidth": 1920,
  "coverImageHeight": 1080,
  "faqs": {
    "heading": "Frequently Asked Questions",
    "type": "blog",
    "answerType": "html",
    "faqs": [
      {
        "question": "Is OpenAI Codex free to use in VS Code?",
        "answer": "The VS Code extension is free to install, but using Codex requires a paid ChatGPT plan or OpenAI API key. The Free plan gives limited trial access. A Plus plan at $20/month gives 30-150 GPT-5.3-Codex messages per 5-hour rolling window, plus cloud task delegation and GitHub code review. See our <a href='https://www.eesel.ai/blog/openai-codex-pricing'>OpenAI Codex pricing guide</a> for the full tier breakdown."
      },
      {
        "question": "What is the difference between OpenAI Codex and GitHub Copilot in VS Code?",
        "answer": "They serve different workflows. GitHub Copilot delivers real-time inline completions and chat assistance as you type - it's always on, always responding. Codex is an asynchronous agent you delegate tasks to: it works in an isolated environment, can run for hours unattended, and returns completed code. Most developers use both tools for different jobs - Copilot for day-to-day editing flow, Codex for large self-contained feature work."
      },
      {
        "question": "Does the Codex VS Code extension work in Cursor and Windsurf?",
        "answer": "Yes. The official Codex extension (ID: <code>openai.chatgpt</code>) installs in <a href='https://www.eesel.ai/blog/cursor-pricing'>Cursor</a> and Windsurf using the same extension ID. In Cursor, use <code>cursor:extension/openai.chatgpt</code> in Quick Open. All three editors share the same underlying Codex CLI and <code>~/.codex/config.toml</code> config file."
      },
      {
        "question": "How do I run Codex cloud tasks in the background from VS Code?",
        "answer": "Set up a cloud environment at <a href='https://chatgpt.com/codex/settings/environments'>chatgpt.com/codex/settings/environments</a> and connect a GitHub repository. In the VS Code panel, pick your environment and click <strong>Run in the cloud</strong>. Codex works in an isolated sandbox while you keep coding - track progress in the sidebar and apply the diff when it finishes. This feature requires a Plus plan or higher."
      },
      {
        "question": "Which Codex plan is right for a solo developer using VS Code?",
        "answer": "Plus ($20/month) is the natural starting point. The 30-150 GPT-5.3-Codex messages per 5-hour window covers most daily workflows, and cloud delegation is included. If you hit limits regularly, the Pro 5x tier ($100/month) gives 5x the usage. API-only access works in the extension and CLI but loses cloud delegation and GitHub code review. The <a href='https://www.eesel.ai/blog/openai-codex-pricing'>full pricing breakdown</a> has all the tier details."
      }
    ],
    "supportLink": null
  },
  "alternates": {
    "x-default": "openai-codex-integrations-with-vs-code",
    "en": "openai-codex-integrations-with-vs-code",
    "de": "openai-codex-vs-code-integrationen",
    "es": "integraciones-openai-codex-vs-code",
    "fr": "integrations-openai-codex-vs-code",
    "ja": "openai-codex-vs-code-renkei",
    "pt": "integracoes-openai-codex-vs-code"
  }
}
---

## TL;DR

<mark>OpenAI Codex in VS Code is an async coding agent, not a smarter autocomplete.</mark> Install via `ext install openai.chatgpt` (the [official extension has 9.8 million installs](https://marketplace.visualstudio.com/items?itemName=openai.chatgpt)), sign in with a $20/month Plus plan, and you get a sidebar agent that reads your files, runs terminal commands, and hands off long tasks to Codex Cloud while you keep working. It scores [85.5% on SWE-bench Verified](https://medium.com/@ricardomsgarces/openai-codex-vs-github-copilot-why-codex-is-winning-the-future-of-coding-f9a2767695b0) for autonomous coding tasks versus GitHub Copilot's 54% - but the right frame isn't "which one wins," it's "these do different jobs." Use Copilot for inline completions, use Codex for the tasks you'd otherwise dump in your backlog.

And once your devs ship faster with Codex, [eesel](https://www.eesel.ai) handles the support side: autonomous AI agents that resolve tickets inside Zendesk, Freshdesk, and Slack without your team lifting a finger.

## What "OpenAI Codex in VS Code" means in 2026

The name confusion is real and worth clearing up before anything else.

The original "[OpenAI Codex](https://www.eesel.ai/blog/openai-codex)" was an API model from 2021 - a version of GPT-3 fine-tuned on code that powered GitHub Copilot's early autocomplete. OpenAI deprecated it in March 2023. What the VS Code extension connects to now is a completely different product that launched in May 2025 and shares the name.

The [2025 Codex](https://openai.com/index/introducing-codex/) is a cloud-based software engineering agent powered by purpose-built models in the GPT-5 family: GPT-5.3-Codex, GPT-5.4, and GPT-5.5. It runs tasks in isolated cloud sandboxes preloaded with your repository, can operate autonomously for up to 25 hours on complex work, and manages multiple workstreams in parallel. The VS Code extension is one of several surfaces alongside the [Codex desktop app](https://www.eesel.ai/blog/openai-codex-app), the open-source CLI, [GitHub integration](https://www.eesel.ai/blog/openai-codex-integrations-with-github), [Slack](https://www.eesel.ai/blog/openai-codex-integrations-with-slack), and iOS.

![OpenAI Codex product page showing the agentic coding assistant](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/c2485b6955224414a02fa167a596147b.mp4)

VS Code is one window into this system - and once you understand it as a system rather than a plugin, the whole setup makes more sense.

## Three ways Codex runs in VS Code

There isn't one "Codex in VS Code" - there are three distinct patterns that serve different workflows.

![OpenAI Codex in VS Code: three integration paths - IDE Extension, CLI in terminal, and Cloud Delegation](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/73a7dc801a9e4d66949e23893c7a8967.png)

**The VS Code extension (sidebar panel)** - Extension ID `openai.chatgpt`, publisher: openai. This is the primary integration: a sidebar chat panel that can read your open files, apply edits in Agent mode, run terminal commands, and connect to Codex Cloud for longer background tasks.

**The Codex CLI in the VS Code terminal** - The open-source CLI ([88,000+ GitHub stars](https://github.com/openai/codex)) runs as a full terminal agent inside VS Code's integrated terminal. It shares config with the extension and some developers find it noticeably better for complex reasoning tasks.

**Cloud delegation from the extension** - This is where Codex diverges from every other VS Code AI tool. From the extension panel, send a task to Codex Cloud: it runs in an isolated sandbox connected to your GitHub repository, you close VS Code, the task keeps running, and you come back to a completed diff.

## Getting set up: installing the extension

![Codex VS Code extension page on the Visual Studio Code Marketplace showing 9.8 million installs](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/88ddca50bb4442ea9f23dd626c42ead7.mp4)

Three steps:

1. Press `Cmd+P` (Mac) or `Ctrl+P` (Windows/Linux) to open Quick Open
2. Paste `ext install openai.chatgpt` and press Enter
3. Click **Sign in** in the Codex panel and authenticate with your ChatGPT account or OpenAI API key

You can also search "Codex" in the Extensions panel and look for publisher "openai."

The same extension ID works in [Cursor](https://www.eesel.ai/blog/cursor-pricing) and [Windsurf](https://marketplace.visualstudio.com/items?itemName=openai.chatgpt) - just replace the `vscode:` URI prefix with `cursor:` or `windsurf:` in Quick Open. The extension, CLI, and `~/.codex/config.toml` config file are all shared across editors, so if you work across multiple environments your settings travel with you.

One layout tip: move the Codex panel to the right side of your editor. Drag the sidebar icon to the right activity bar. With code on the left and Codex on the right you get a natural split view - much better than stacking it on top of the file explorer.

**What plan do you need?** Codex is bundled into all paid ChatGPT plans starting at Plus ($20/month). No separate Codex subscription. API key access works for the extension and CLI but loses cloud features including GitHub code review and cloud delegation. See the [full OpenAI Codex pricing guide](https://www.eesel.ai/blog/openai-codex-pricing) for tier details.

## Inside the extension: what you can actually do

![OpenAI Codex IDE documentation showing extension features and cloud integration options](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/2b8687802f4f49009e3f0aa36346bd1c.mp4)

### The model selector and reasoning effort

The model picker at the bottom of the Codex panel is the first thing that differs from GitHub Copilot's chat. You choose model and reasoning effort explicitly: GPT-5.3-Codex at low/medium/high, GPT-5.4, GPT-5.4-mini, and GPT-5.5. Medium reasoning handles most tasks well. Bump to high for complex refactors where an extra minute of thinking eliminates several correction loops. Use GPT-5.4-mini for routine questions - it extends your message budget by 2.5-3x versus primary models.

### File references with @

The `@filename` syntax is one of the most practical things about the extension. Instead of pasting code into chat:

```
Use @auth.ts and @user.model.ts to add email verification
to the registration flow, keeping error handling consistent
with the pattern in @error-handler.ts
```

Codex reads all referenced files in full, understands the cross-file context, and makes changes consistent across all of them. The extension auto-suggests filenames as you type `@`.

### Three approval modes

![OpenAI Codex VS Code extension: three approval modes - Chat (read-only), Agent (default), Agent Full Access](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/9d009af60f304768a645c799b87da22c.png)

| Mode | What Codex can do |
|------|------------------|
| **Chat** | Conversation only - no file edits, no command execution |
| **Agent** (default) | Reads files, edits code, runs commands in your working directory |
| **Agent Full Access** | Agent capabilities plus network access |

Switch modes from the selector below the chat input. Agent is the right default: it runs `npm run test`, edits files, and verifies its changes compile - all the local operations needed for most coding tasks. Full Access adds internet lookup, useful if Codex needs to fetch documentation mid-task.

<mark>The permission approval loop is the most widely-reported friction point in the current extension.</mark> Even with "Allow every time" enabled, Codex re-asks approval when a command varies even slightly. It's a known bug.

> "Even in Linux. If there's any variation in the CLI at all, it considers it a new command requiring new approval. Claude Code is way better at this."
> - u/jimheim, [r/ChatGPTCoding](https://www.reddit.com/r/ChatGPTCoding/comments/1n9vmhu/codex_extension_in_vscode_completely_ignores/)

If the approval loop is causing friction, switch approval to "auto" in `~/.codex/config.toml` or use the CLI version inside the terminal, which handles re-approval more sensibly.

### What Codex handles well in Agent mode

Tasks where Codex consistently delivers: "fix the failing tests in `auth.spec.ts`," "add dark mode support to the component library," "refactor the payment flow to use the new API client," "add JSDoc comments to all exported functions." Self-contained work where it can read, edit, run tests, and verify in one pass.

Where it struggles: anything requiring real-time visual feedback, iterative front-end pixel work, and tasks where you want to review an execution plan before code starts changing. Codex has no Plan Mode - unlike Claude Code, it executes immediately. The community pattern from r/codex and r/ClaudeCode: Codex for complex back-end work, Claude Code for front-end and iterative refinement.

## Cloud delegation: the extension's real differentiator

The async workflow is what separates Codex from every other AI tool in VS Code.

**Setup (one time):** Go to [chatgpt.com/codex/settings/environments](https://chatgpt.com/codex/settings/environments) and connect a GitHub repository to a cloud environment.

**Per task:**
1. Pick your cloud environment from the selector in the VS Code panel
2. Click **Run in the cloud**
3. Choose starting point: `main` branch for new features, or your current branch to continue in-progress work
4. Describe the task and send

Codex starts working in an isolated sandbox. You can close VS Code - the task runs in the cloud. Progress appears in your sidebar when it finishes. Review the diff, apply it locally, iterate.

> "It also can process multiple workflows in the background while you discuss the next steps with it. It's crazy good and saves a lot of time. The number of requests also seem to be reasonably high on the Plus subscription: 30-150 per 5 hours."
> - u/pnkpune, [r/OpenAI](https://www.reddit.com/r/OpenAI/comments/1n2iymc/codex_extension_for_vscode/)

The cloud setup also feeds into [GitHub integration](https://www.eesel.ai/blog/openai-codex-integrations-with-github): Codex automatically reviews PRs as they move from draft to ready, posts analysis directly on GitHub pull requests, and responds to `@codex review` mentions with targeted bug detection. Austin Ray, AI Dev X Team Lead at Ramp: ["Codex PR reviews catch bugs our team would have missed, and we ship with more confidence because of it."](https://openai.com/codex/)

![Codex code review showing citations, test verification, and PR analysis results](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/9a213daf4cfc4d02bc78e2d6a750b85c.webp)

One hard limit worth knowing: when Codex in Agent mode applies changes locally, there's no accept/reject diff workflow - edits land in your working directory directly. This is the most significant UX gap versus GitHub Copilot's polished diff view. Commit or stash before delegating a large task so `git reset` is always available.

## Running Codex CLI in the VS Code terminal

The CLI installs separately from the extension:

```bash
npm i -g @openai/codex
```

Then run it inside VS Code's integrated terminal:

```bash
# Interactive TUI session
codex

# With an initial prompt
codex "Explain this codebase to me"

# Non-interactive for scripts
codex exec "Fix all linting errors in src/"
```

![Codex CLI terminal showing model set to gpt-5.2-codex medium with directory and reasoning effort settings](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/85257e1bc2cb4b9b96f8c6c683e03603.webp)

The CLI and extension share `~/.codex/config.toml`. Set defaults once rather than toggling in the UI each session:

```toml
# ~/.codex/config.toml
model = "gpt-5.3-codex"
approval_mode = "agent"
```

The combo that works well: run the CLI in VS Code's integrated terminal for prompting, keep VS Code open to the same folder for real-time git diff review. You get whatever reasoning quality the CLI provides alongside VS Code's clean diff visualizer.

The CLI prints session stats at the end of each run - context window usage, 5-hour rate limit remaining, total token count. Useful for managing Plus plan limits.

The CLI also integrates natively with [Bitbucket](https://www.eesel.ai/blog/openai-codex-integrations-with-bitbucket) repos, works inside [Google Colab](https://www.eesel.ai/blog/openai-codex-integrations-with-colab) and [Jupyter](https://www.eesel.ai/blog/openai-codex-integrations-with-jupyter) notebooks, and connects to [Replit](https://www.eesel.ai/blog/openai-codex-integrations-with-replit) environments. If you work across other IDEs, there are integration guides for [PyCharm](https://www.eesel.ai/blog/openai-codex-integrations-with-pycharm), [IntelliJ](https://www.eesel.ai/blog/openai-codex-integrations-with-intellij), and [Visual Studio](https://www.eesel.ai/blog/openai-codex-integrations-with-visual-studio) (the full Microsoft IDE, not VS Code).

## Codex vs GitHub Copilot in VS Code: they do different things

![Comparison of OpenAI Codex and GitHub Copilot: interaction mode, task scope, SWE-bench score, parallelism, and best use cases](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/074ffb9fa8f54313be13431e187154d1.png)

The "Codex vs Copilot" framing misses the point. They're not competing for the same slot in your workflow.

**Copilot** is always on. It delivers real-time ghost text completions as you type, inline chat for quick questions about the current function, next-edit suggestions, and multi-model access: you can switch between OpenAI GPT-5, Anthropic Claude, and Google Gemini depending on the task. For front-end work, some developers in the community find Claude via Copilot produces better UI code than Codex can (Codex is locked to OpenAI models). For full details, see our [Copilot pricing](https://www.eesel.ai/blog/copilot-pricing) breakdown.

**Codex** is asynchronous. You give it a task prompt, it works independently in an isolated environment, and returns a completed result. The [SWE-bench Verified score of 85.5%](https://medium.com/@ricardomsgarces/openai-codex-vs-github-copilot-why-codex-is-winning-the-future-of-coding-f9a2767695b0) measures autonomous end-to-end task completion - exactly what it's built for.

| Dimension | GitHub Copilot | OpenAI Codex |
|-----------|---------------|--------------|
| Primary mode | Real-time suggestions | Async task delegation |
| Task scope | Single-file edits and chat | Multi-file, multi-step projects |
| Model variety | GPT-5, Claude, Gemini | OpenAI models only |
| SWE-bench autonomous | [54%](https://docs.github.com/en/copilot/concepts/agents/openai-codex) | [85.5%](https://medium.com/@ricardomsgarces/openai-codex-vs-github-copilot-why-codex-is-winning-the-future-of-coding-f9a2767695b0) |
| Change preview | Yes (diff view, accept/reject) | No (applied directly) |
| Parallelism | One session at a time | Multiple background tasks |
| Best for | Day-to-day editing | Complex standalone work |

The pattern that works: keep [GitHub Copilot](https://www.eesel.ai/blog/claude-vs-copilot) active for inline completions and quick questions. Queue up 2-3 larger tasks in Codex daily - the things you'd otherwise park in your backlog. Come back to completed diffs.

If you're evaluating [Copilot alternatives](https://www.eesel.ai/blog/copilot-alternatives) more broadly, [Cursor](https://www.eesel.ai/blog/cursor-reviews) competes most directly with Copilot on real-time pair-programming. There are also [Cursor alternatives](https://www.eesel.ai/blog/cursor-alternatives) worth considering depending on your workflow. Our [Claude vs Copilot](https://www.eesel.ai/blog/claude-vs-copilot) guide covers the Anthropic side of the comparison.

## Pricing: what you actually pay

Two billing tracks. For the complete breakdown, see our [OpenAI Codex pricing guide](https://www.eesel.ai/blog/openai-codex-pricing).

**ChatGPT subscription (Codex bundled):**

| Plan | Price | GPT-5.3-Codex per 5h window | Cloud tasks per 5h |
|------|-------|-----------------------------|-------------------|
| Free | $0 | Limited trial | None |
| Go | $8/mo | Lightweight tasks | None |
| Plus | $20/mo | 30-150 messages | 10-60 tasks |
| Pro 5x | $100/mo | 150-750 messages | 50-300 tasks |
| Pro 20x | $200/mo | 600-3,000 messages | 200-1,200 tasks |
| Business | Per seat | Same as Plus, extendable | Yes |
| Enterprise/Edu | Contact sales | No fixed limits | Yes |

Limits reset on a rolling 5-hour window. [OpenAI added the Pro 5x tier in April 2026](https://community.openai.com/t/introducing-new-100-month-pro-tier/1378752) directly in response to Claude Code's pricing - a clear middle path for developers hitting Plus limits but not ready for $200/month.

**API key (no subscription):** Works in the extension and CLI at [$1.50/1M input, $6/1M output](https://platform.openai.com/docs/pricing) for codex-mini-latest (75% prompt caching discount). No cloud delegation, no GitHub code review.

One limit-management tip: use GPT-5.4-mini for routine questions ("explain this function," "what does this test verify"). It extends your local message count 2.5-3x versus primary models, leaving GPT-5.3-Codex budget for the tasks that need it.

## The honest verdict

Codex in VS Code genuinely delivers at what it's designed for. The [85.5% SWE-bench score](https://medium.com/@ricardomsgarces/openai-codex-vs-github-copilot-why-codex-is-winning-the-future-of-coding-f9a2767695b0) holds up in practice: complex back-end refactors, multi-file feature work, and code review that catches bugs static analysis misses.

The rough edges are also real. The permission approval loop in the extension has been broken since launch. There's no diff preview before local changes land - Copilot handles this better. No Plan Mode means you can't review the approach before execution starts, which catches some developers off guard. And post the April 2026 credit-rate change, some Pro plan users report GPT-5.5 on Medium intensity running out in 3-4 tasks - model selection matters for limit management.

> "I have the $100 CC license and $20 OpenAI plan. When CC cannot resolve a difficult problem I give it to Codex and have it take forever, but it has fixed numerous issues CC is unable to."
> - u/SequentialHustle, [r/ClaudeAI](https://www.reddit.com/r/ClaudeAI/comments/1qjx1u0/claude_code_has_overtaken_openai_codex_in_vs_code/)

That's the honest positioning: not "better than Claude Code or Copilot," but a distinct tool for a specific job. If you're spending time on tasks like "implement this feature from a spec" or "write tests for this module," $20/month on Plus to try it for a week is a straightforward call.

For Codex in other contexts: guides for [Discord](https://www.eesel.ai/blog/openai-codex-integrations-with-discord), [Notion](https://www.eesel.ai/blog/openai-codex-integrations-with-notion), and [Slack](https://www.eesel.ai/blog/openai-codex-integrations-with-slack) are available. For the full desktop experience, the [Codex app guide](https://www.eesel.ai/blog/openai-codex-app) covers macOS availability and the parallel task command center. If it's not the right fit, our [OpenAI Codex alternatives](https://www.eesel.ai/blog/openai-codex-alternatives) roundup covers the full field.

## Try eesel

![eesel AI homepage showing autonomous AI agents working inside existing tools](https://cdn-public.eesel.ai/355ca1d8-3d7c-4618-973f-22c7b8780d42/48a0ef84-d2a4-48f0-9c4c-79c75fe7aa4d/e6660c93cfee49ac8866a32ca875aac5.mp4)

Codex handles your dev queue. [eesel](https://www.eesel.ai) handles your support queue.

eesel deploys AI agents that work autonomously inside your existing tools - [Zendesk](https://www.eesel.ai/blog/zendesk), [Freshdesk](https://www.eesel.ai/blog/freshdesk), Slack, email, and 100+ more. The same "delegate and come back to results" philosophy as Codex, applied to support operations. eesel agents resolve tickets, draft replies, triage issues, and escalate edge cases without interrupting your team. No new interface to learn. Start free with 100 credits, no card required.

[Start free at eesel.ai](https://www.eesel.ai)
