Back to Tools
AdvancedFreemiumIncluded with every ChatGPT plan, with limited usage on Free; also usable with OpenAI API credits. Usage is consumption-based.

OpenAI's coding agent. Rather than asking a chatbot to write a snippet you then paste somewhere, you point Codex at a project and describe what you want changed — it reads the files, makes the edits, runs commands and tests, and shows you a diff to review. It runs in several places: a command-line tool in your terminal, a desktop app for Mac and Windows, an extension inside VS Code and JetBrains editors, and a cloud agent that works on a connected GitHub repository in the background. Behaviour is configured with an AGENTS.md file in the project, and it can connect to other systems through the Model Context Protocol.

What is Codex?

Codex is OpenAI's AI assistant for people who write software. It is worth being clear about how it differs from asking ChatGPT a coding question, because the difference is the whole point.

When you ask a chatbot for code, you get text back, and it is your job to work out where it goes and paste it in. Codex works the other way round. You point it at a real project, describe what you want, and it does the work in the files themselves — reading the existing code, making the changes, running the tests, and then showing you a diff of exactly what it did so you can accept it or push back.

You do not need to be an expert to use it, but you do need to be comfortable reading code well enough to review what it produces. This is an advanced tool: it changes real files, so understanding what it changed matters.

Best Use Cases

Making a Change Across a Whole Project

The kind of task that is tedious by hand because it touches a dozen files — renaming something, updating a pattern everywhere it appears, or splitting one thing into two.

Try this prompt: "Rename the getUserData function to fetchUserProfile everywhere it is used, update the tests to match, and show me the diff before changing anything."

Debugging Something That Is Failing

Instead of describing a bug and hoping the answer applies, let it read the actual code and run the actual test.

Try this prompt: "The checkout test is failing. Run it, work out why, explain the cause in plain English, and only then propose a fix."

Reviewing Changes Before They Ship

Codex can read a set of proposed changes and tell you what looks wrong — a second pair of eyes on work you or someone else has already done.

Try this prompt: "Review the changes on this branch. Tell me anything that would break existing behaviour, and flag anything that is not covered by a test."

Where Codex Runs

Codex is the same agent across four places, and which one you use depends on how you like to work:

  • CLI — a command-line tool that runs in your terminal, inside whatever project directory you are already in.
  • Desktop app — for Mac and Windows, good for longer tasks you want to keep an eye on across several projects.
  • IDE extension — inside VS Code and JetBrains editors, so it sits alongside the code you are looking at.
  • Cloud agent — connect a GitHub repository and Codex works on tasks in the background, then opens a pull request with the result.

How It Connects To Your Other Tools

  • AGENTS.md — a plain-text file you put in the project describing how Codex should behave there: the conventions to follow, the commands to run, what to leave alone. Write it once and every task in that project follows it, instead of you repeating yourself in every prompt.
  • Model Context Protocol (MCP) — the open standard for connecting AI agents to other software. Add an MCP server for your issue tracker, database or internal documentation and Codex can read from it while it works, rather than you copying details across by hand.

Getting Started

  1. Go to openai.com/codex and pick a surface — the CLI, the desktop app, or the IDE extension.
  2. Sign in with your ChatGPT account, or with an OpenAI API key if you would rather bill it that way.
  3. Open the project folder you want to work in.
  4. Start with something small and reversible — ask it to explain a file, or to make one contained change — so you can see how it reports back before you trust it with more.
  5. Review the diff every time. Accepting a change you have not read is how bad days start.

Tips for Beginners

  • Use version control before you start. Codex changes real files; being able to undo everything with one command turns a mistake into a non-event.
  • Ask it to explain before it acts. "Tell me what you would change and why, then wait" gives you a cheap check on whether it has understood.
  • Write an AGENTS.md early. Five minutes describing your project's conventions saves repeating them in every single prompt.
  • Give it one job at a time. A tightly scoped task produces a diff you can actually review; a vague one produces a sprawl you cannot.
  • Let long tasks run in the background rather than watching them. That is what the cloud agent and the desktop app are for.
  • Keep an eye on usage. It is included with ChatGPT plans, but consumption varies a lot with how big and how frequent your tasks are.

Get a Video Tutorial

Our AI will generate a professional video script about this or other topics, tailored to your learning path.

Generate a Script