How to Use Codex
OpenAI's autonomous coding agent — give it a task, watch it plan, code, and ship.
🌐Browser — chatgpt.com/codex — ChatGPT Plus or Pro plan requiredCodex is OpenAI's cloud-based AI coding agent. Unlike editors like Cursor or Windsurf where you watch the AI write code locally, Codex runs entirely in the cloud — you assign it a task, it spins up its own environment, writes and runs code, then opens a pull request when it's done. You review the result, not the process.
✓ Perfect for you if...
- ▸Developers with an existing codebase on GitHub who want to delegate tasks
- ▸Adding features, writing tests, or fixing bugs without switching context
- ▸Running multiple coding tasks in parallel — Codex handles them simultaneously
Get set up in 5 steps
Follow these in order — each step takes about 1–2 minutes.
Open Codex in ChatGPT
Go to chatgpt.com and open the Codex agent from the sidebar or main menu. You need a ChatGPT Plus or Pro plan to access it.
Connect your GitHub account
Click "Connect GitHub" and authorise Codex to access your repositories. You can grant access to all repos or just specific ones — start with one repository to get familiar.
Select the repository
Choose the repo you want Codex to work on from the dropdown. Codex will read the codebase to understand the existing structure before starting any task.
Describe the task
Type a clear description of what you want done. Be specific: name the file, the function, or the behaviour you want changed. Good: "Add input validation to the signup form in app/auth/signup.tsx — email must be valid, password must be 8+ characters." Vague: "Improve the signup flow."
Review the pull request
Codex runs the task in a sandboxed cloud environment — writing code, running tests, and fixing errors autonomously. When it's done it opens a GitHub pull request. Review the diff, ask follow-up questions, and merge when you're satisfied.
Your first prompt — paste this right now
This prompt gives Codex a specific, bounded task with clear acceptance criteria. The last line tells it to read the existing code first — Codex works best when you point it toward the right file rather than describing the whole codebase from scratch.
Add a dark mode toggle to this Next.js app. Requirements: - Add a toggle button to the top-right corner of the header - Use the system preference (prefers-color-scheme) as the default state - Persist the user's choice in localStorage so it survives page refreshes - Apply dark mode via a CSS class on the <html> element - Ensure all existing text, background, and card colours have dark mode equivalents using Tailwind's dark: prefix - The toggle should be accessible — include an aria-label Please check the existing header component first and integrate the toggle into it rather than creating a new component.
3 tips that make a real difference
1. Point Codex to the specific file, not just the feature
"Update the pricing table in app/pricing/page.tsx" produces far better results than "update the pricing page." Codex reads your repo, but the more precisely you identify the location of the change, the less time it spends guessing.
2. Run multiple tasks in parallel
One of Codex's biggest advantages over local editors is concurrency — you can assign 3–5 tasks at the same time and they all run in separate cloud environments simultaneously. Queue up a bug fix, a test suite, and a feature addition at once.
3. Use the follow-up chat after the PR opens
When Codex opens a pull request, you can chat with it directly about the changes. Ask it to adjust the approach, handle an edge case you spotted, or explain why it made a particular decision. The conversation is anchored to the PR — no context lost.
Ready to pick your first idea?
We've curated the best project ideas specifically matched to Codex — filtered by what actually works well with this tool.
Browse Codex project ideas →