← Blog

How-to4 min read

Claude Code and Codex in VS Code: install the extensions and get started

How to install the Claude Code and Codex extensions in VS Code or Cursor, open them, sign in, and what each extension does differently from the CLI.

A Mirasim session with its own file tree and editor for the workspace it runs inA Mirasim session with its own file tree and editor for the workspace it runs in

The short answer

Both have an official VS Code extension. Open the Extensions view (Cmd+Shift+X on a Mac, Ctrl+Shift+X elsewhere), search for Claude Code or Codex, and install the one published by Anthropic or OpenAI. Open it from its icon and sign in with the same account you'd use for the CLI. The same extensions install in Cursor too.

Claude CodeCodex
ExtensionClaude Code, by AnthropicCodex, by OpenAI (openai.chatgpt)
EditorsVS Code 1.94 or later, Cursor, and other VS Code forks through Open VSXVS Code, Cursor, Windsurf, VS Code Insiders; Xcode and JetBrains have their own integrations
AccountAny paid Claude plan or an Anthropic Console account; no API key neededA ChatGPT plan from Plus up, or an API key
Open itThe Spark icon in the editor toolbar, the Activity Bar or the status barThe Codex icon, or Codex: Open Codex Sidebar in the Command Palette

Claude Code in VS Code

  1. Install and open it

    Install Claude Code from the Extensions view, then click the Spark icon at the top right of an open file. If it doesn't show up, run Developer: Reload Window from the Command Palette.

  2. Sign in

    The first time, click Sign in and finish in your browser.

  3. Ask with your selection

    Claude sees the text you have selected. Press Option+K (Alt+K on Windows and Linux) to insert a reference such as @file.ts#5-10 into the prompt.

  4. Review the changes

    The permission mode is shown under the prompt box. In Manual mode, Claude shows the original and the proposed change side by side and asks before editing.

Codex in VS Code

  1. Install and open it

    Install Codex (openai.chatgpt) from the Extensions view and click the Codex icon. If you don't see it, run Codex: Open Codex Sidebar from the Command Palette.

  2. Start with what's open

    Add an open file, your selection or a recent chat to the message, then ask Codex to explain the code or make a focused change. Commit before and after, so you can go back.

  3. Review in place

    Codex shows a summary and the changed lines next to your code; keep the edits you want and follow up in the same chat. For a longer task, hand it to Codex in the cloud and come back to the result.

On Windows, if the extension is installed but doesn't respond, OpenAI's fix is to install Visual Studio Build Tools with the C++ workload and restart VS Code.

Both agents side by side, then open it in VS Code

The extensions each run one agent inside the editor. Mirasim is a desktop app that runs Claude Code, Codex and other agents in panes next to each other, each session with the workspace's file tree and an editor. When you want your own editor, open the workspace in VS Code, Cursor or Zed from Mirasim. Mirasim is not an Anthropic or OpenAI product.

Questions

Do I need an API key for the Claude Code extension?
No. A paid Claude plan or an Anthropic Console account is enough; you sign in when you first open it.
Can I use these extensions in Cursor?
Yes. Both Anthropic and OpenAI list Cursor as a supported editor for their extensions.
Extension or CLI?
The extension keeps the agent next to the code you're reading. The CLI also runs in scripts and on servers without a desktop. Both sign in with the same account.

Sources

Checked on November 25, 2026 against code.claude.com/docs/en/vs-code and learn.chatgpt.com/docs (the Codex IDE extension page, pricing and Windows pages). The extensions change quickly, so check those pages for the latest.

Keep reading