Guide
How to use Codex in 2026: the app, the CLI, your editor and the cloud
Codex now lives in five places. How to start in each, the commands that matter, and how to use it alongside Claude Code.
To use Codex, OpenAI's coding agent, sign in with a ChatGPT account and pick a surface: the Codex mode in the ChatGPT desktop app, the Codex command-line tool (install it with curl -fsSL https://chatgpt.com/codex/install.sh | sh on Mac or Linux, then run codex), the extension for VS Code or Cursor, Codex Cloud for tasks that run on OpenAI's machines, or the ChatGPT phone app. Every ChatGPT plan includes some Codex: Free and Go get the small GPT-6 Luna model in the desktop app, and Plus at $20 unlocks the CLI, the editor extension, the cloud and GPT-6.1 Sol.
Key takeaways
- The desktop app: Codex joined the ChatGPT desktop app on July 9, 2026; switch to Codex at the top.
- The CLI: one-line installers for Mac, Linux and Windows, or
npm install -g @openai/codex. Sign in withcodex login. - Your editor: the Codex extension runs in VS Code, Cursor and Windsurf; JetBrains IDEs run Codex inside JetBrains AI.
- Instructions: put project instructions in AGENTS.md;
/initwrites a starter file. - With Claude Code: OpenAI's official plugin adds
/codex:reviewand other Codex commands inside Claude Code.
| Surface | How to start | Plans |
|---|---|---|
| ChatGPT desktop app | Switch to Codex at the top | Every plan; Free and Go get GPT-6 Luna |
| Codex CLI | Install, then run codex | Plus and up, or an API key |
| VS Code, Cursor, Windsurf | Install the Codex extension | Plus and up, or an API key |
| JetBrains IDEs | AI Chat, then choose Codex | Plus and up, or through JetBrains AI |
| Codex Cloud | Set up a GitHub environment in ChatGPT | Paid plans with ChatGPT sign-in |
| iPhone | ChatGPT app, Codex | Plus and up |
| Inside Claude Code | OpenAI's codex-plugin-cc | A Codex plan or API key |
How do you install the Codex CLI?
From OpenAI's docs (OpenAI):
- Mac or Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | sh - Windows, in PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" - npm:
npm install -g @openai/codex. Homebrew works too.
Run the same command again, or codex update, to update. Codex runs natively on Windows with its own sandbox; WSL2 is optional. The CLI is open source under Apache 2.0 (GitHub).
How do you sign in?
- With ChatGPT:
codex loginopens a browser. On a machine without one,codex login --device-auth. - With an API key:
printenv OPENAI_API_KEY | codex login --with-api-key, billed at API rates and without cloud features. codex login statusshows which you're using (OpenAI).
Your first session in the terminal
- Open your project folder and run
codex. - Run
/initto create an AGENTS.md with project instructions. - Describe the change you want. Codex reads files, runs commands and edits code.
- Use
/planto agree on an approach first,/reviewto have it review changes, and/diffto see them. - Come back later with
codex resume, orcodex resume --lastfor the latest session.
Permissions: by default Codex can edit files in your project but has no network, and asks before going further. Choose read-only, workspace-write or danger-full-access with --sandbox, and how often it asks with -a. The --yolo flag skips both approvals and the sandbox; use it only in a throwaway environment (OpenAI).
How do you use Codex in VS Code or Cursor?
Install the Codex extension from the marketplace (openai.chatgpt), then open it from its icon or the command "Codex: Open Codex Sidebar" (OpenAI). It works in VS Code, VS Code Insiders, Cursor and Windsurf. In JetBrains IDEs, open AI Chat and choose Codex.
How do you use Codex in ChatGPT?
In the ChatGPT desktop app for Mac and Windows, choose Codex at the top and start a new chat in a project folder. The app adds worktrees for parallel chats, scheduled tasks, a built-in browser and the option to move a chat to the cloud. It's also where Free and Go users get Codex.
How do you run Codex in the cloud?
Codex Cloud runs tasks on OpenAI's machines against a GitHub repository. Set up an environment (connect GitHub, choose the repository and publish the environment), then start tasks from ChatGPT on the web or desktop (OpenAI). From the terminal, codex cloud lists and starts cloud tasks and codex apply brings a result's changes into your local copy. Cloud tasks need a ChatGPT sign-in and a paid plan.
Can you use Codex on your phone?
Yes, in the ChatGPT iPhone app: it runs Codex tasks in the cloud, or on a Mac or PC you connect from the desktop app's settings (OpenAI).
How do you use Codex with Claude Code?
- Inside Claude Code: OpenAI's official plugin,
openai/codex-plugin-cc, adds Codex commands to Claude Code. Install it with/plugin marketplace add openai/codex-plugin-ccand/plugin install codex@openai-codex, then run/codex:setup(GitHub)./codex:reviewhas Codex review your changes,/codex:rescuehands a task to Codex, and/codex:transferturns the session into a Codex thread. It needs the Codex CLI and counts against your Codex limits. - The old MCP route is gone: OpenAI removed the
codex mcp-servercommand on September 5, 2026. - The other direction:
/importin Codex brings in Claude Code's setup, memories, MCP servers and recent chats.
Using two labs' agents on one codebase is covered in Cross-model code review and Claude Code vs Codex; the Claude Code side is in How to use Claude Code.
Which plan do you need?
- Free and Go ($8): GPT-6 Luna in the desktop app.
- Plus ($20): the CLI, editor, cloud and phone, GitHub reviews, and GPT-6.1 Sol.
- Pro ($100, $200 or $500): much higher limits and no five-hour window (ChatGPT Plus vs Pro, Codex pricing).
- Business: $20 a user billed annually, $25 monthly (Codex for teams).
More on what's free in Is Codex free?.
Using Codex as a team
Codex sessions belong to the person who started them. Poly (usepoly.co) runs Codex and Claude Code in a shared browser room where a team works with one agent: everyone sees each step live, and any member can approve a change before it happens. Free to start. What is Poly?
Common questions
How do I install Codex?
On Mac or Linux run curl -fsSL https://chatgpt.com/codex/install.sh | sh; on Windows use OpenAI's PowerShell installer; or run npm install -g @openai/codex. Then run codex and sign in with codex login.
Is Codex free to use?
Partly. ChatGPT Free and Go include Codex with the small GPT-6 Luna model in the desktop app. The CLI, editor extension and cloud tasks come with Plus at $20 a month or an API key.
How do I use Codex in VS Code?
Install OpenAI's Codex extension (openai.chatgpt) from the marketplace, then open it from its icon or the command Codex: Open Codex Sidebar. It also works in Cursor and Windsurf.
Can I use Codex inside Claude Code?
Yes. OpenAI's official plugin, codex-plugin-cc, adds commands such as /codex:review and /codex:rescue to Claude Code. The older codex mcp-server route was removed in September 2026.
What is AGENTS.md in Codex?
A Markdown file of project instructions that Codex reads automatically, from your home folder down to the current directory. Run /init in Codex to create one.