OpenAI · ChatGPT and Codex
OpenAI Codex
What it is
Codex is OpenAI's coding agent. It runs in the ChatGPT apps, in the Codex CLI in your terminal, in an IDE extension (VS Code, Cursor, Windsurf), and as Codex Cloud. It's included in ChatGPT's plans from Free up, or you can pay per use with an API key, without the cloud features.
When to pick it
When you want an agent to work in a real codebase and you already pay for ChatGPT. Claude Code and Cursor cover the same ground; the habits in Same Skills, Any Assistant carry across all three.
Setup
- Install the CLI on macOS or Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | sh. The same command updates it. - In your project folder, run
codexand choose "Sign in with ChatGPT". - Run
/initto write a firstAGENTS.md. Codex reads~/.codex/AGENTS.md, then the one at your repository's root, then one in each folder down to where you are, so the nearest one wins. - Choose how much it may do. The sandbox can be
read-only,workspace-write(the default for local work) ordanger-full-access, and the approval policy can beon-requestornever. Type/permissionsto change them.
A first real task
Start read-only and ask: "Explain how this project is laid out and how I run its tests." Then switch to workspace-write with approvals on-request, and ask for one small fix. Read the change before you approve it.
Connect it to your site or data
Codex keeps MCP servers in ~/.codex/config.toml (or .codex/config.toml in a trusted project), shared by the app, the CLI and the IDE extension. Add one from the terminal with codex mcp add, or in the file:
[mcp_servers.memberpress-ai-academy]
url = "https://academy.memberpress.ai/mcp"
codex mcp list shows what's connected, and /mcp shows it inside a session.
Checked against OpenAI's docs on 2026-10-14: Codex overview, pricing, CLI, IDE extension, AGENTS.md, MCP, sandboxing.
Try these prompts
- Write an AGENTS.md for this repository: how to install, how to run the tests, and the three rules you most need to follow here.Open in ChatGPT (new tab)Open in Claude (new tab)
- Read this repository and tell me, before changing anything, how you'd add a contact form. Wait for me to say go.Open in ChatGPT (new tab)Open in Claude (new tab)
Ask me about this lesson
I'll answer from "OpenAI Codex" and the rest of the academy.
I keep this chat with your account, so it's here on any lesson.
Sign in to keep your place and tick off lessons. Reading stays open either way.