📘 Introduction

Visual Studio Code is one of the most popular editors for developers. Codex is OpenAI's coding agent for writing, reviewing, and shipping code. When you use Codex in Visual Studio Code, you can keep your normal editor workflow while asking Codex to help with coding tasks inside your project.

In this step-by-step guide, you will learn how to use Codex in Visual Studio Code, connect it to a local project, give it useful project instructions, and start your first coding task.

The goal is not to replace your own review. The goal is to make Codex a practical coding partner that can inspect your project, suggest changes, and help you move faster.

💡 What are we setting up?

We will set up this workflow:

Visual Studio Code -> Codex extension -> local project folder -> coding task

You will use VS Code as your editor and Codex as an AI coding agent inside that workflow.

After the setup, you should be able to ask Codex tasks such as:

  • explain part of the codebase
  • fix a small bug
  • add a simple feature
  • write or update tests
  • summarize changes before you review them

✅ Prerequisites

Before we start, you should have:

☑️ Visual Studio Code installed
☑️ A ChatGPT account with access to Codex
☑️ A local project folder or Git repository
☑️ Basic knowledge of opening folders in VS Code
☑️ No advanced Git knowledge required

⚙️1️⃣ Open your project in Visual Studio Code

First, open the project you want to work on in Visual Studio Code.

In VS Code, choose:

File -> Open Folder

Select your project folder or local Git repository.

For example, your folder might look like this:

my-project/
├── README.md
├── src/
└── tests/

Starting with a real project folder is important because Codex works best when it can see the codebase it should help with.

🧩2️⃣ Install the Codex extension

Next, install the official Codex extension in Visual Studio Code.

Open the Extensions view in VS Code:

View -> Extensions

Search for the official OpenAI Codex extension and install it. You can also start from the official Codex page and choose the IDE option.

After installation, you should see Codex available inside VS Code.

🔐3️⃣ Sign in to Codex

Open the Codex extension and sign in with your ChatGPT account.

The sign-in flow may open your browser. Complete the login and return to VS Code when it is finished.

After signing in, Codex should be connected to your account and ready to work with your current project.

📁4️⃣ Select the project Codex should use

Make sure Codex is working with the correct folder. This should be the same project you opened in VS Code.

If your workspace contains several folders, choose the folder that contains the code you want Codex to inspect and edit.

A good first project is small enough to understand, but real enough to contain source code, tests, and a clear task.

You now have the basic VS Code setup. In the Academy section, we continue with project instructions, first tasks, prompts, review workflow, and common beginner mistakes.

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In