# Getting started with Codex

Source: https://www.youtube.com/watch?v=px7XlbYgk7I
Recap page: https://rapidrecap.app/video/px7XlbYgk7I
Generated: 2026-01-12T16:42:56.816+00:00

---
## Quick Overview

The Codex workflow is introduced through a session covering an overview, setup, prompting techniques, advanced use cases like MCP integration, and code review capabilities, all designed to streamline developer tasks from planning to release.

**Key Points:**
- Codex is OpenAI's coding agent, powered by GPT-5.1-Codex-Max, which runs locally or in the cloud via CLI or IDE extensions.
- Setup involves installing the Codex CLI via npm or brew, and authentication is done via a ChatGPT account using `codex login`.
- Agents.md files provide project context and instructions to AI coding agents, with global configurations in ~/.codex/agents.md and project-specific ones in the local directory.
- MCP (Model Context Protocol) allows Codex to connect to external tools like Figma, Jira, Datadog, and Context7 for broader capabilities like fetching external documentation.
- Advanced prompting techniques include using `/review` to find issues against a base branch or uncommitted changes, and using images (via Ctrl+V or @file.png) in prompts.
- Codex supports headless mode for automation tasks such as Security Triage, Test Coverage Bot, Refactor & Cleanup Automation, and Release Hygiene Automation.
- The presentation concludes by pointing users to OpenAI resources like documentation, cookbooks, and the changelog for further exploration.

![Screenshot at 07:07: The CLI displaying the output of /status which shows the current model \(gpt-5.1-codex-max low\), directory, approval policy \(on-request\), and context window usage, confirming successful login and session context.](https://ss.rapidrecap.app/screens/px7XlbYgk7I/00-07-07.jpg)

**Context:** This tutorial presentation, 'Getting started with Codex,' delivered by Derek and Charlie from OpenAI, introduces Codex, an AI coding agent derived from GPT-5.1-Codex-Max, detailing its architecture, setup process, fundamental prompting strategies, and advanced functionalities like integrating with external tools via the Model Context Protocol (MCP) and utilizing headless mode for CI/CD automation.

## Detailed Analysis

The presentation introduces Codex, OpenAI's coding agent based on GPT-5.1-Codex-Max, emphasizing its ability to run locally or in the cloud via CLI or IDE extensions for fast iteration (00:16). The setup process requires installing the CLI (via npm or brew) and authenticating using a ChatGPT account via `codex login` (05:58). A key concept is the `AGENTS.md` file, which serves as a dedicated README for agents, providing project context and instructions, with global configurations stored in `~/.codex/AGENTS.md` (09:20). The session moves into advanced capabilities, highlighting the Model Context Protocol (MCP) for connecting Codex to external tools like Figma, Jira, Datadog, and Context7 to leverage external documentation and context (03:37, 03:50, 03:55). The presenters demonstrate how to add an MCP server, like the Cupcake server, using `codex mcp add` (04:32). They also cover advanced prompting, such as using `/review` in the CLI to check uncommitted changes against a base branch (07:57, 43:18) and using images in prompts via Ctrl+V or @file.png, as shown by the example of adding buttons to the Agents.md site (19:18). Finally, the presentation touches upon Headless Mode for automating workflows like security triage, test coverage generation, refactoring, and release hygiene (49:02), demonstrating how Codex can be used to analyze code quality and output JSON schemas (04:22). The session concludes by pointing users to documentation, cookbooks, and the changelog for further learning.

### Introduction and Setup

- Codex is OpenAI's coding agent, based on GPT-5.1-Codex-Max, usable via CLI or IDE; setup requires installation via brew/npm and authentication via ChatGPT account; Codex is updated frequently (00:10 - 05:06).

### AGENTS.md

- An open format for guiding coding agents, stored globally in ~/.codex/AGENTS.md or locally; it provides project context, build/test commands, and code style guidelines (08:30 - 10:12).

### Prompting Best Practices

- Provide clear code pointers using @mention; include verification steps (run tests/linters); customize output behavior; start with small tasks; paste full stack traces when debugging; use open-ended prompts (17:12 - 19:48).

### MCP Servers

- Model Context Protocol (MCP) connects Codex to external tools (Figma, Jira, Context7, Datadog) via STDIO or HTTP to leverage external context (03:42 - 03:57).

### Advanced CLI/IDE Use Cases

- CLI supports custom commands (e.g., `/add-tests` defined in prompts folder) and session resumption via `codex resume <session_id>` (03:32, 04:06).

### Headless Mode

- Enables automation for Security Triage, Test Coverage Bot, Refactor & Cleanup, and Release Hygiene (e.g., updating changelogs) by running Codex in background jobs (49:02 - 49:20).

### Resources

- Documentation is at developers.openai.com/codex; Cookbooks at cookbook.openai.com/topic/codex; Changelog at developers.openai.com/codex/changelog (05:20 - 05:27).

![Screenshot at 00:07: Title slide for the 'Getting Started with Codex' session featuring Derek and Charlie.](https://ss.rapidrecap.app/screens/px7XlbYgk7I/00-00-07.jpg)
![Screenshot at 04:14: The slide outlining installation options for the Codex CLI, showing commands for npm and brew.](https://ss.rapidrecap.app/screens/px7XlbYgk7I/00-04-14.jpg)
![Screenshot at 07:07: The output of /status in the Codex CLI showing current session configuration including model \(gpt-5.1-codex-max low\) and directory.](https://ss.rapidrecap.app/screens/px7XlbYgk7I/00-07-07.jpg)
![Screenshot at 19:19: A slide detailing the features of an AGENTS.md file, including sections for project overview, build/test commands, and agent-specific guidance.](https://ss.rapidrecap.app/screens/px7XlbYgk7I/00-19-19.jpg)
![Screenshot at 38:38: A slide showing the result of a code review /review command, displaying a diff and structured feedback.](https://ss.rapidrecap.app/screens/px7XlbYgk7I/00-38-38.jpg)
