Track
OpenAI has just released Codex inside the ChatGPT app. Codex is a tool meant to help developers and teams offload everyday coding work.
In this tutorial, I’ll walk you through how to use Codex inside ChatGPT to perform practical tasks on a GitHub repository, even if you’re not a professional coder. We’ll use Codex to:
- Apply a code fix and generate a pull request.
 - Explain a complex function inside the codebase.
 - Identify and resolve a bug based on a Q&A-style prompt.
 
You’ll see how Codex works in a secure sandbox, generates verifiable code changes, and helps you ship faster, without leaving ChatGPT.
What Is OpenAI’s Codex?
OpenAI Codex is a cloud-based software engineering agent that can write and edit code, run tests, fix bugs, and even propose pull requests. Each task is executed in its own sandboxed environment.
Codex is powered by codex-1, a version of the o3 model fine-tuned on real-world development workflows. This agent is built for safety, testability, and developer productivity. You can guide Codex using AGENTS.md files or interact with it directly in ChatGPT’s sidebar.
With Codex CLI, you can bring these capabilities directly into your terminal as well.
Setting Up OpenAI's Codex
Setting up Codex takes just a few minutes. Here’s a simple step-by-step walkthrough to get you started.
Step 1: Locating the Codex tool
Start by logging in to ChatGPT. On the left side toolbar, look for Codex. Note that Codex is currently being rolled out to Pro, Team, and Enterprise users only.

Step 2: Getting started with Codex
Click on Codex, and it will take you to another tab for initial setup. Click on “Get Started” and follow the authentication procedure as shown in the next step.

Step 3: Multi-factor authentication
Click “Set up MFA to continue” and scan the QR code using your favorite authentication app (like Google Authenticator or Authy). Enter the code to verify and you’re done!

Step 4: Connect to GitHub
Once multi-factor authentication is done, we connect Codex to GitHub.

Step 4.1: Authorize the GitHub connector
“Connect to GitHub” will take you to a pop-up to authorize the GitHub connector. Read through the pop-up and Authorize.

Step 4.2: Adding your GitHub account
Once GitHub is connected, we need to add our account. Under the GitHub organization tab, select “Add a GitHub account.”


This will take you to another pop-up to “Install and Authorize.” Click to authorize, and all your repositories will appear on the ChatGPT interface. You can also authorize only selected repositories.

Step 4.3: Creating an environment
Choose the repository you want to work on and click “Create environment.”

This will take you to “Data Controls.” Codex is still in active development, and you may see an optional prompt to allow your data to be used for model improvement. You can turn this off and proceed.

Now your environment is ready to be explored. Codex allows users to start tasks in parallel with pre-picked tasks.

Simply click on “Start tasks” or choose tasks according to your requirements. This will take you to an interface where you can ask questions or ask the agent to code a feature for you.


Once all tasks are ready, select the task you’d like to work on—or you can work on multiple tasks in parallel.
Step 5: AGENTS.md file (optional)
The AGENTS.md file is a special configuration file introduced by OpenAI for use with the Codex platform, specifically designed to help guide AI agents as they work within your codebase. You can think of it as a developer manual for AI teammates, much similar to a README.md, but focused on instructions for autonomous agents. Here is an example AGENTS.md file:
# AGENTS.md
## Code Style
- Use Black for Python formatting.
- Avoid abbreviations in variable names.
## Testing
- Run pytest tests/ before finalizing a PR.
- All commits must pass lint checks via flake8.
## PR Instructions
- Title format: [Fix] Short description
- Include a one-line summary and a "Testing Done" section
When Codex runs a task on your codebase, it:
- Searches for 
AGENTS.mdfiles whose scope includes the file(s) it is modifying. - Applies the instructions in those files to format, test, and document its changes.
 - Prioritizes deeper nested instructions when multiple files apply (like a cascading config).
 
OpenAI’s Codex: Three Practical Examples
Let’s explore how Codex can help you in real-world development using three examples I ran on a repository.
Example 1: Basic fixes and typos
Codex sometimes breaks a single request into subtasks—like fixing typos, improving a README, or writing tests, all within the same workspace.


You can start a new task within an existing task based on the initial review, request changes to the existing codebase, or ask questions via the textbox. To extend the task or fix something new, click “Code” and start a new subtask directly.

Once satisfied with the changes, click “Push,” which will create a new pull request. After a few seconds, you can click “View Pull Request” to access the pull request and merge it into the main.
Example 2: Codebase explanation
Next, I used Codex for a non-editing task: exploring the codebase and asking what I could do next. This is especially useful if you're new to a project, trying to onboard quickly, or just stuck trying to understand how a certain function works.

Codex navigated the project and provided a clean, beginner-friendly breakdown of the codebase’s structure. Instead of just listing files, Codex grouped them by purpose:
- It highlighted that 
qwen3_demo.pyis the main script, launching two Gradio-based interfaces—one for reasoning mode switching and another for multilingual translation. - It identified 
qwen3_demo.ipynbas an interactive notebook alternative. - It pointed out 
test_qwen3_demo.pyfor unit testing andREADME.mdfor documentation and video walkthroughs. 
Beyond that, Codex also listed “Key Points to Know,” like dependencies (Ollama CLI), the role of the _run_ollama function, and tips for extending the interface. It even suggested next steps, such as exploring model versioning, improving the UI, and adding error handling.
Example 3: Find and fix a bug
Codex can scan the entire codebase, identify a bug, propose a fix, and show you a preview of the changes. This process resembles code change reviews on GitHub.

You can review the logs to understand the background process for the changes made by clicking “Logs.”

Codex returns a summary of changes made, along with files created or affected by the changes. You can also ask questions about the changes or ask Codex to write new code to enhance the current implementation.


Once satisfied with the code fixes, click “Push” and “Create New PR” to open a new pull request.

After a few seconds, you can click “View Pull Request” to access the pull request and merge it into the main.

Codex makes it possible to merge the changes with just a few clicks.


The main files are updated seamlessly on the repository.

Why Is Codex Important?
Codex is not just another code-generating tool but a collaborative agent. You can ask it to write, refactor, test, debug, or explain, and it’ll show you the terminal logs, citations, and outputs for each step.
Here are some real-world benefits I’ve observed:
- Tasks are traceable and verifiable.
 - Codex works in parallel, so you can queue multiple changes.
 - It respects your development setup, especially if you’ve configured conventions through 
AGENTS.md file. - It aligns with human PR standards and can pass CI tests.
 
To me, this feels like OpenAI just released a software engineering intern.
Conclusion
We learned how Codex can fix bugs, apply feature patches, and explain code logic, all while generating pull requests, running tests, and citing its actions through terminal logs and diffs.
This hands-on walkthrough illustrates how Codex can improve your daily developer workflow, whether you're debugging legacy code, onboarding to a new repo, or triaging maintenance tasks.
As Codex evolves, I anticipate deeper integrations with IDEs, CI pipelines, and task planners, making it a critical companion in the modern software stack. To learn more about Codex, read the official release blog, and you can also find example use cases on OpenAI’s YouTube channel.
To dive deeper into OpenAI’s engineering-focused models and tools, I recommend these blogs:
Introduction to AI Agents
FAQs
Is Codex different from ChatGPT?
Yes, Codex is a specialized agent for software engineering, optimized for task execution in Git repos.
Do I need to install Codex?
You don't need to install Codex if you use it inside the ChatGPT app. However, for using it inside the terminal, you must install the Codex CLI.
Is OpenAI's Codex safe?
Codex runs in a secure, isolated container. It can’t access the internet or external APIs.

I am a Google Developers Expert in ML(Gen AI), a Kaggle 3x Expert, and a Women Techmakers Ambassador with 3+ years of experience in tech. I co-founded a health-tech startup in 2020 and am pursuing a master's in computer science at Georgia Tech, specializing in machine learning.


