codex (or start it from anywhere with codex --cd /path/to/project). In VS Code, install the Codex extension (openai.chatgpt), open the project with File → Open Folder and open the Codex sidebar. In the ChatGPT desktop app, choose “create a project” or “open a folder”. Then describe a task, review the changes and commit them with Git.

Contents
- Before you start
- Method 1: add a project in the Codex CLI
- Method 2: add a project to Codex in VS Code (step by step)
- Method 3: add a project in the desktop app
- Which method should you pick?
- How to use a project in Codex once it is added
- Safety settings worth knowing
- If Codex does not show up in VS Code
- FAQ
Before you start
- A ChatGPT account. Codex is included in the Free, Go, Plus, Pro, Business, Enterprise and Edu plans, so you sign in with ChatGPT; an API key also works in the CLI, SDK and IDE extension.
- A project folder. A Git repository is best, because OpenAI recommends creating Git checkpoints before and after each Codex task so you can undo changes. If the project is not under Git yet, run
git initand make a first commit.
Method 1: how to add a project to Codex in the CLI
- Install the CLI. On macOS and Linux, OpenAI’s page gives
curl -fsSL https://chatgpt.com/codex/install.sh | sh. - Go to your project. In a terminal run
cd /path/to/your-project. - Start Codex. Run
codex. The first time, choose “Sign in with ChatGPT” (or another sign-in method). - Or set the project without changing directory. Run
codex --cd /path/to/your-project. The--cdflag sets the working directory before the session starts. - Give access to a second folder if needed. Use
--add-dirto grant write access to extra directories, for example a shared library next to your project.
Method 2: how to add a project to Codex in VS Code
This is the route most people want: you stay inside the editor, and Codex works on the folder you have open.
Step 1: install the Codex extension
- Open VS Code and click the Extensions icon (or press
Ctrl+Shift+Xon Windows/Linux,Cmd+Shift+Xon Mac). - Search for Codex by OpenAI (Marketplace item ID
openai.chatgpt) and click Install.
Step 2: open your project folder
Choose File → Open Folder and select your project. Codex treats the folder you opened as the project, so open the repository root rather than a single file.
Click the Codex icon in the sidebar. If you do not see it, press Ctrl+Shift+P (Cmd+Shift+P on Mac) and run Codex: Open Codex Sidebar.
Step 4: sign in
Sign in with your ChatGPT account when asked. The IDE extension can also use an API key billed at API pricing.
Step 5: run your first task in VS Code
- Start with something small, such as “explain how this project is structured”.
- Then ask for a real change, for example “add a unit test for the login function”.
- Read the proposed changes, accept only what you understand and commit.
Does the extension work in Cursor, Windsurf and other editors?
Per OpenAI’s docs, the extension works in VS Code, Cursor, Windsurf and VS Code Insiders, so the same steps apply there. Xcode and JetBrains IDEs have separate Codex integrations rather than this extension.
Method 3: add a project in the ChatGPT desktop app
OpenAI’s desktop app (macOS, Windows and Linux) lets you “choose where to work”: start a chat, create a project, or open a folder. To add an existing codebase, open its folder; to start fresh, create a project. The exact buttons change between releases, so follow the on-screen prompts in your version.
Which method should you pick?
| Method | Best for | Needs a terminal? |
|---|---|---|
| CLI | Developers who live in the terminal; scripting and extra folders with --add-dir | Yes |
| VS Code extension | Working inside your editor (also Cursor, Windsurf, VS Code Insiders) | No |
| Desktop app | A chat-style workspace without editor setup | No |
How to use a project in Codex once it is added
- Make a Git checkpoint (a commit) so you can revert.
- Ask for a small, specific task, for example “add input validation to the signup form and update its tests”.
- Optionally plan first. The
/planslash command is listed in OpenAI’s docs. - Review the diff before accepting anything.
- Run your tests, then commit.
- Come back later with
codex resumeto reopen a recent conversation in the CLI.
Safety settings worth knowing
| Setting | What it does |
|---|---|
/permissions | Controls when Codex can edit files or run commands without asking |
--sandbox read-only | Codex can read but not change files; a safe first run |
--sandbox workspace-write | Codex can edit files in the workspace |
--ask-for-approval | Controls when Codex pauses for your OK |
If Codex does not show up in VS Code
- Reload the window: Command Palette → Developer: Reload Window.
- Check that the extension is enabled and published by OpenAI.
- Make sure you opened a folder, not an empty window.
- Update VS Code to a recent version, then reinstall the extension.
How to add and use a project in Codex: the short version
If you only remember one thing about how to add and use a project in Codex, remember this: open the project folder first, start Codex inside it, and review every change with Git. Whether you add a project in the CLI, in VS Code or in the desktop app, the way to use a project in Codex is the same: make a checkpoint, ask for a small task, review the diff, run your tests and commit.
That routine is all there is to how to add and use a project in Codex safely, and it keeps your work easy to undo if an agent makes a mistake.
Related guides: How good is Codex? 2026 review · CodexBar usage tracker
Sources, as read in November 2026: OpenAI’s Codex docs for the CLI, IDE extension and desktop app, plus the OpenAI Codex listing on the VS Code Marketplace.
Add and use a project in Codex: FAQ
How to add and use a project in Codex for the first time?
Install your preferred Codex app (CLI, VS Code extension or desktop app), open your project folder, start Codex inside it and begin with a small, specific task. Commit before and after so you can review and revert.
How do I add a project to Codex?
Open the project folder in your Codex app: run codex inside the folder in the CLI, open the folder in VS Code and use the Codex sidebar, or choose “open a folder” in the desktop app.
How do I add a project to Codex in VS Code?
Install the OpenAI Codex extension, open your project folder with File → Open Folder, open the Codex sidebar and sign in with ChatGPT.
How do I add a project to use Codex without the terminal?
Use the VS Code extension or the ChatGPT desktop app. Both let you open a folder and work from a chat panel.
Is the Codex extension free?
The extension is free to install. Usage is covered by your ChatGPT plan (including Free, with limits) or billed at API pricing if you use an API key.
Which editors does the Codex extension support?
VS Code, Cursor, Windsurf and VS Code Insiders, according to OpenAI’s docs.
Run “Codex: Open Codex Sidebar” from the Command Palette.
Do I need Git to use Codex on a project?
Not strictly, but OpenAI recommends Git checkpoints before and after tasks so you can revert any change.
Can Codex work on more than one folder?
Yes. In the CLI, --add-dir grants write access to additional directories.
How do I reopen a past Codex session in a project?
Run codex resume in the CLI to pick up a recent conversation.




Leave a Reply