How to use Codex, in short: open it in the ChatGPT desktop app, add it to your code editor, or install it in your terminal and type codex, then sign in with your ChatGPT account. Codex is OpenAI's coding agent. It reads your files, edits them and runs commands, and the CLI version runs locally on your own computer. (OpenAI Codex on GitHub (README) (opens in a new tab); OpenAI: Get started with Codex (opens in a new tab))

OpenAI says Codex is included in your ChatGPT plan. Its Get started page describes Plus as covering focused coding sessions each week, Pro as offering higher limits for longer workdays across several projects, and Business as a shared workspace with admin controls. The official README recommends signing in with a Plus, Pro, Business, Edu or Enterprise plan. DataCamp's tutorial notes that Free and Go accounts get only very limited access. (OpenAI Codex on GitHub (README) (opens in a new tab); OpenAI: Get started with Codex (opens in a new tab); DataCamp: OpenAI Codex tutorial (opens in a new tab))

That means most paying ChatGPT users already have it and never opened it. It is not only for big software projects either. OpenAI's own beginner guide suggests first tasks like organizing notes, cleaning up a small dataset or comparing two drafts of a document.

Where you can use Codex

There are four ways in, and they share one account. The ChatGPT desktop app has a Codex section with your projects and threads. The IDE extension works in VS Code, Cursor and Windsurf, according to the README. The Codex CLI runs in the terminal. And Codex Web, at chatgpt.com/codex, is the cloud agent that works on your GitHub repositories while you do something else. OpenAI says cloud tasks keep running and you can follow them from another device. (OpenAI Codex on GitHub (README) (opens in a new tab); OpenAI: Get started with Codex (opens in a new tab); Scrimba: How to use OpenAI Codex (opens in a new tab))

Tip: If you are not a developer, start with the desktop app. If you live in an editor, use the extension. The terminal and the cloud are the most powerful, and the easiest places to make a mess.

How to install the Codex CLI

1. Run the installer

On a Mac or Linux, paste the command below into your terminal. On Windows, the README gives a PowerShell command instead. You can also install it with npm or Homebrew, or download a binary from the GitHub releases page.

Install commands from the official README

# Mac or Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

# npm
npm install -g @openai/codex

# Homebrew
brew install --cask codex

2. Sign in with ChatGPT

Type codex and press Enter. Choose Sign in with ChatGPT so Codex uses your plan. An OpenAI API key also works, but the README says it needs extra setup.

3. Open the app from the terminal if you prefer

Running codex app opens the desktop app experience, according to the README. Same agent, with a window instead of a command line.

Your first project in the Codex app

4. Give Codex its own folder

OpenAI Academy suggests making a parent folder called ChatGPT Codex with one subfolder per project. Drop in the files Codex should work on, or leave it empty and let Codex create new ones. Then create a project tied to that folder rather than a loose thread.

5. Keep Default permissions

Below the input box, the app shows Work locally, which means Codex can only work in the folder you picked, with the tools you allow. A dropdown changes the permissions. OpenAI recommends Default permissions for beginners and says to use full permissions only if you understand what Codex is doing and have checked with your admin. Codex does not get access to everything on your computer.

6. Use the recommended model first

Start with the default recommended model and raise the reasoning level only for harder tasks, OpenAI Academy says.

Prompt 1: Understand a project before touching it

Read this folder and explain what the project does in plain English. List the main files and what each one is for. Do not change anything yet.

Prompt 2: A small, checkable change

In [file name], [describe the one change you want]. Keep the change as small as possible, then tell me exactly what you changed and how I can check that it works.

Teach Codex your rules with AGENTS.md

AGENTS.md is an optional file in your project that tells coding agents how to work there: formatting rules, which tests to run, how to name pull requests. Before Codex edits a file, it looks for AGENTS.md files that cover it, and a file deeper in the folder tree wins over a higher one, DataCamp explains. Scrimba's guide puts the benefit simply: you stop repeating the same instructions every session. (DataCamp: OpenAI Codex tutorial (opens in a new tab); Scrimba: How to use OpenAI Codex (opens in a new tab))

Prompt 3: Let Codex draft your AGENTS.md

Look at this project and write an AGENTS.md file for it. Include how to run the tests, the code style you see in the existing files, and any folders an agent should never edit. Show it to me before saving.

Tip: Read the AGENTS.md before you save it. Agents follow these files closely, so a wrong line here repeats in every session.

Hand bigger jobs to Codex in the cloud

7. Connect GitHub and create an environment

In ChatGPT, open Codex from the sidebar and click Get Started. DataCamp's walkthrough shows a multi-factor authentication step, then Connect to GitHub, where you can allow all repositories or only the ones you choose. Pick a repository and create an environment.

8. Start tasks and review them

Describe a task and start it. Each task runs in its own isolated sandbox, and you can run several at once. Check the diff and the logs, ask follow-up questions, then click Push to open a pull request on GitHub. Internet access inside tasks is off by default and can be allowed per environment.

You can also start work by tagging @codex on a GitHub issue or pull request, and the IDE extension can apply a finished cloud diff to your local files, according to Scrimba. (Scrimba: How to use OpenAI Codex (opens in a new tab))

What Codex is bad at

Codex is fast and confident, and that is the risk. It will happily make a change that looks right and quietly breaks something else. Give it small, specific tasks instead of vague goals, read every diff before you accept it, and be most careful with logins, payments and anything that handles personal data. And your plan's usage is limited, which is why Pro is sold on higher limits.