Welcome to the OpenAI Codex Bible
Your practical AI Con Todo handbook for getting real work done with Codex. Use it to plan changes, write stronger prompts, configure reusable rules, run checks, and review work before you ship.
Run these in your terminal from inside your repository.
codex login # Sign in to Codex
codex doctor # Check local setup
codex app . # Open Codex app here
codex "Explain this codebase" # One-off repo question
codex resume --last # Continue recent work
codex --image screenshot.png "Fix this UI"
codex --sandbox workspace-write --ask-for-approval on-requestClear goals and constraints lead to better results.
Link files, docs, screenshots, and errors.
Always review diffs, tests, and logs.
Small tasks and faster feedback beat huge prompts.
Reusable playbooks for repeated work.
Installable tool bundles from OpenAI and teams.
Scheduled background checks and reminders.
Custom checks that run inside the agent loop.
10-Day Builder Course Path
This is the friendly path for non-technical people. The goal is not to learn every Codex feature first. The goal is to build a simple real project by day 2 or 3, then add power features only when they solve a real problem.
The promise
10-day build path
| Day | Level | Module | Outcome |
|---|---|---|---|
| 1 | Beginner | Install + VS Code Terminal | Open a project folder, run safe commands, start Codex. |
| 2 | Beginner | First Build | Create a simple landing page, tool, or dashboard mockup. |
| 3 | Beginner | GitHub + Deploy | Commit, push, and deploy to a public or private preview. |
| 4 | Builder | Prompt Loop | Use goal, context, constraints, and done criteria. |
| 5 | Builder | Rules and Memory | Add AGENTS.md, project standards, and common commands. |
| 6 | Builder | Review + Testing | Ask Codex to run checks, explain errors, and review changes. |
| 7 | Power | Skills + Plugins | Use reusable workflows and installed capabilities. |
| 8 | Power | MCP + Connectors | Connect docs, GitHub, browser, databases, or private tools. |
| 9 | Advanced | Subagents, Worktrees, Background Tasks | Split research, QA, and implementation safely. |
| 10 | Advanced | Launch Review | Security, privacy, performance, deploy checklist, handoff. |
What to teach now vs later
| Level | Teach these first | Hold until later |
|---|---|---|
| Beginner | VS Code terminal, install commands, first prompt, Git checkpoints, GitHub push, deploy. | Hooks, custom plugins, managed settings, MCP server authoring. |
| Builder | AGENTS.md, project overview, development standards, common commands, known issues, related projects. | Complex rule hierarchies, enterprise settings, background automation. |
| Power user | Skills, plugin library, MCP connectors, slash commands, permissions, checkpoints, troubleshooting. | Writing plugins, custom MCP servers, hook security design. |
| Super advanced | Subagents, worktree isolation, headless mode, hooks, managed settings, CI workflows. | Only teach after students have shipped one working project. |
Codex translation of the big course topics
Daily CLI commands, slash commands, review commands, and safe launch flags.
Use AGENTS.md, project docs, handoff files, and configuration layers.
Reusable workflows with progressive disclosure: instructions, references, scripts, and assets.
Installable bundles that can include skills, tools, connectors, hooks, or assets.
Bring live tools and private context into Codex instead of guessing.
Use for parallel research, QA, broad audits, and isolated changes.
For beginners, teach Git checkpoints first: commit before big changes and review diffs.
Super advanced: enforce rules mechanically after students understand manual review.
Prompt: turn any module into a simple lesson
Act as a course creator for non-technical builders.
Turn this topic into a friendly lesson:
[topic]
Make it:
- beginner-safe
- practical
- copy-paste friendly
- focused on building something real
- no more than 5 steps before the learner gets a visible result
Include:
1. Why this matters
2. What to click
3. What to paste
4. What success looks like
5. What to ignore until laterInstall Codex + VS Code
Start here if you are not technical. The goal is simple: install the tools once, open your project folder in VS Code, then let Codex inspect the folder before it changes anything.
Beginner install order
| Step | Install | Why it matters | What to do |
|---|---|---|---|
| 1 | Git | Saves versions of your project and connects to GitHub. | Install Git, then restart your terminal. |
| 2 | Node.js LTS | Runs many modern website/app tools. | Install the LTS version from Node.js. |
| 3 | Visual Studio Code | The editor where you see and organize project files. | Install VS Code and add the code command if prompted. |
| 4 | Codex | The AI coding agent that reads, edits, runs, and reviews code. | Use the official Codex install commands below, then sign in. |
| 5 | GitHub account | Lets you back up projects and work from other AI tools later. | Create or sign in to GitHub before your first real project. |
Install Codex from the VS Code Terminal
Official install commands to paste
# macOS or Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
# Optional alternatives
npm install -g @openai/codex
brew install --cask codexAfter install, start Codex inside VS Code
codex --version
codex login
codexUse codex when you want Codex to run inside the VS Code terminal. Use codex app . when you want to open the current project folder in the Codex desktop app.
SOP: where to click
1. Open the project folder
Always open the whole project folder, not a single file. Codex needs the full folder context.
2. Open the terminal
The terminal should open at the bottom of VS Code. This is where you paste setup commands.
3. Start Codex
On macOS, codex app . opens the current folder in the Codex desktop app.
Copy-paste setup checks
git --version
node --version
npm --version
codex --version
codex login
codex app .First prompt after opening Codex
I am new to coding. Please inspect this project before changing anything.
Tell me:
1. What files and folders matter
2. How to run the project locally
3. What commands are safe to run
4. What you recommend as the first small step
Do not edit files until I approve the plan.Choose the right Codex surface
| Surface | Best for | Plain-English advice |
|---|---|---|
| Codex app | Local projects, planning, visual review, connected tools, long conversations | Start here if you are not technical. Open the project folder, explain the outcome, and let Codex inspect files. |
| Codex CLI | Terminal-first work, quick commands, scripted automation | Use when you want to type codex inside a project folder and work directly with the repo. |
| IDE extension | Editor-attached coding, selected code, open files | Use when you are already in the code editor and want context from specific files. |
| Codex cloud | Parallel tasks, GitHub repos, work from another device | Push your code to GitHub first, then delegate contained tasks. |
One-time setup checklist
codex doctorStarting Any Project
Good Codex work starts before code. Give Codex the project goal, the files that matter, the constraints, and a clear definition of done.
Project starter folder
my-project/
AGENTS.md
docs/
MASTERPLAN.md
DECISIONS.md
TESTING.md
src/
package.jsonThe four-part prompt formula
| Piece | What to write | Example |
|---|---|---|
| Goal | The specific outcome | "Add password reset to the app." |
| Context | Files, docs, screenshots, errors, URLs | "Read docs/MASTERPLAN.md and src/auth first." |
| Constraints | Rules, libraries, safety limits | "Do not add new packages unless needed." |
| Done when | How Codex proves success | "Tests pass and the reset email flow works locally." |
First prompt for a new repo
Inspect this project before changing anything. Read the README, package files, docs folder, and any AGENTS.md files.
Tell me:
1. What this project appears to do
2. How to run it locally
3. How to test it
4. Any risks or missing setup
5. The safest next step for: [describe what I want]When to use Plan mode
Use Plan mode for big, unclear, or risky tasks. In the Codex app and CLI, use /plan or Shift+Tab when available. A good planning prompt asks Codex to inspect first, ask questions, and wait before editing.
Before coding, make a plan. Inspect the current repo and ask me any questions that would materially change the solution.
Do not edit files yet. I want:
- a short diagnosis
- the proposed files to change
- risks
- tests you will run
- the exact definition of donePrompt Recipes
Copy these prompts and replace the brackets. They are written for people who know what they want but do not want to micromanage code.
Build a feature safely
Goal: Build [feature].
Context:
- Read [file or doc].
- Follow the current app patterns.
Constraints:
- Keep the change small.
- Do not add new dependencies without explaining why.
- Preserve existing user data and behavior.
Done when:
- The feature works in [screen/workflow].
- Relevant tests or checks pass.
- You summarize what changed and any remaining risk.Fix a bug
This is the bug: [describe what happens].
Expected behavior: [describe what should happen].
Steps to reproduce:
1. [step]
2. [step]
3. [step]
Please reproduce or reason from the code first. Then fix the root cause, add or update a test if practical, run the relevant check, and explain the fix in plain English.Ask Codex to interview you
I have a fuzzy project idea. Interview me like a product-minded engineer.
Ask one short batch of questions at a time until you can write:
- the goal
- ideal user
- main workflows
- MVP features
- non-goals
- risks
- first implementation plan
My idea: [describe it casually]Use images as context
Codex can take screenshots and images as input. Use them for UI bugs, design references, console errors, diagrams, and visual QA.
codex --image screenshot.png "Explain what is wrong with this UI and fix the app to match the intended design."First Project + GitHub Launch Path
Use this when a non-technical builder is creating their first real project and needs a safe path from local folder to GitHub, Vercel, design system, and optional Stripe payments.
The first-project stack
| Layer | Recommended default | Why it matters |
|---|---|---|
| Project memory | docs/MASTERPLAN.md + AGENTS.md | Keeps Codex and future agents aligned on the product, commands, and rules. |
| Version control | Private GitHub repository | Stores the code in the cloud, enables rollback, and lets other agents or collaborators continue. |
| Hosting | Vercel connected to GitHub | Every push can create a preview; production deploys from the main branch. |
| UI/design | Tailwind CSS + shadcn/ui + lucide-react | Fast, modern, accessible components that agents can extend cleanly. |
| Payments | Stripe Checkout Sessions | Best default for first paid products because Stripe hosts the sensitive checkout flow. |
| Compliance basics | Privacy, terms, legal notice, cookie banner | Often required before ads, payments, analytics, or serious launch. |
GitHub handoff checklist
Prompt: prepare and push existing project to GitHub
I want to push this existing project to GitHub so another LLM or coding agent can work on it later.
Before pushing, do a safe handoff preparation:
1. Inspect current branch, changed files, untracked files, git status, and remote status.
2. Check for files that should not be pushed: .env, API keys, credentials, large generated files, node_modules, build outputs, cache folders.
3. Make sure the repo has README.md, setup instructions, local run command, test/build commands, required environment variables without secret values, .gitignore, and AGENTS.md or HANDOFF.md.
4. Do not delete, rewrite, or push anything until you show me the files that will be committed and I approve them.
5. If safe, create a clean commit with a clear message.
6. If no GitHub remote exists, tell me the exact steps to create/connect one.
7. After pushing, give me the repo URL, branch name, commit hash, changed files, and what the next agent should know.GitHub commands when Codex says it is safe
git status
git add README.md AGENTS.md docs .gitignore src package.json
git commit -m "Prepare first project handoff"
gh repo create PROJECT_NAME --private --source=. --remote=origin --push
git branch --show-current
git rev-parse --short HEADgit add . blindly on a first project. Ask Codex to inspect what will be staged first.Vercel prompt
Help me deploy this project to Vercel from GitHub.
First verify:
- the GitHub repo is pushed
- README has local setup
- environment variables are documented
- build command and output directory are known
Then tell me the Vercel import settings:
- framework preset
- install command
- build command
- output directory
- environment variables for preview and production
Do not paste secret values into code.Stripe prompt for first paid project
I want to add payments with Stripe, but keep it beginner-safe.
Use Stripe Checkout Sessions unless there is a strong reason not to.
Explain test mode vs live mode.
List the required environment variables without secret values.
Create the minimal checkout flow and webhook plan.
Add a launch checklist for privacy policy, terms, cookie banner, test cards, and Vercel production environment variables.
Do not use live keys during development.Design libraries to ask for
| Library | Use when | Prompt line |
|---|---|---|
| Tailwind CSS | You want fast styling without custom CSS chaos. | "Use Tailwind utility classes and keep design tokens consistent." |
| shadcn/ui | You want polished forms, dialogs, nav, tables, and dashboard components. | "Use shadcn/ui components where appropriate; do not over-install." |
| lucide-react | You need clean icons in buttons, nav, cards, and empty states. | "Use lucide-react icons instead of random emoji for production UI." |
| Framer Motion | You need subtle product animations. | "Add restrained motion only where it clarifies state or hierarchy." |
| Magic UI / Aceternity-style components | You want marketing polish, but only after the core app works. | "Use one or two premium visual sections, not a decorative component dump." |
Commands Cheat Sheet
Everyday commands
| Command | Use it when |
|---|---|
codex | Open the interactive CLI in the current folder. |
codex "explain this codebase" | Ask a one-off question from Terminal. |
codex app . | Open the Codex desktop app on the current project. |
codex resume --last | Continue your most recent session. |
codex doctor | Generate diagnostics when something feels broken. |
codex completion zsh | Install shell completions so Tab shows commands. |
codex update | Check for and apply a CLI update if supported. |
Useful launch flags
codex --cd /path/to/project "Summarize this repo"
codex --model gpt-5.5 "Plan the refactor"
codex --sandbox workspace-write --ask-for-approval on-request
codex --image screenshot.png "Fix this visual bug"
codex --search "Look up the current docs and update this integration"Slash commands inside Codex
Use before complex or ambiguous work. Codex gathers context and plans before coding.
Review uncommitted changes, a branch diff, or a commit.
Change how much Codex can do without asking.
Inspect active MCP servers and tool connections.
Set a persistent objective for longer tasks when enabled.
Inspect or switch between subagent threads in CLI workflows.
AGENTS.md Rules
AGENTS.md is the file Codex reads for persistent instructions. Put reusable team rules there so you do not repeat them in every prompt.
Create a starter AGENTS.md
codex
/initAfter Codex scaffolds the file, edit it so it reflects how your team actually works.
Copy-paste starter template
# AGENTS.md
## Project overview
- This project is: [one sentence].
- Main users: [who uses it].
## Commands
- Install: `npm install`
- Run locally: `npm run dev`
- Test: `npm test`
- Lint: `npm run lint`
- Build: `npm run build`
## Working rules
- Inspect existing patterns before editing.
- Keep changes scoped to the request.
- Ask before adding new dependencies or changing architecture.
- Never commit secrets, API keys, or credentials.
- Run the relevant checks before saying work is complete.
## Definition of done
- User-facing behavior works.
- Tests/checks pass or failures are clearly explained.
- The final response summarizes changed files and remaining risks.Where instructions can live
| File | Scope | When to use |
|---|---|---|
~/.codex/AGENTS.md | Global | Your personal defaults across all repos. |
AGENTS.md | Project | Rules everyone should follow in this repo. |
subfolder/AGENTS.md | Nested | Rules for a specific area like payments or mobile. |
AGENTS.override.md | Override | Temporary or stronger rules that should win. |
Daily Workflow
The safe loop
Daily opening prompt
Orient me in this repo. Check the current branch, changed files, active instructions, and available test commands.
Then tell me the safest next step for today's goal:
[describe goal]End-of-session handoff prompt
Create a handoff note for the next session.
Include:
- what changed
- files touched
- commands run and results
- decisions made
- blockers
- exact next steps
If there is a docs/HANDOFF.md or docs/PROJECT_STATE.md file, update it.Review and Testing
The biggest non-technical upgrade is this: do not accept "I changed it" as done. Ask Codex to prove it.
Review before you ship
Review your own changes like a senior engineer.
Focus on:
- bugs or behavior regressions
- security or privacy issues
- missing tests
- edge cases
- confusing user experience
List findings first with file references. Then fix the high-confidence issues and rerun checks.CLI review command
codex
/reviewWhat to ask Codex to run
| Project type | Common checks |
|---|---|
| JavaScript/React/Next.js | npm test, npm run lint, npm run build |
| Python | pytest, ruff check, mypy |
| Static HTML | Open in browser, test links, search, buttons, responsive layout |
| Unknown repo | Ask Codex to inspect package files and README to identify checks. |
MCP and Connectors
MCP gives Codex tools and live context beyond your codebase: docs, browser, Figma, GitHub, Sentry, databases, or internal systems.
When to connect tools
Use an official docs MCP or web search instead of stale memory.
Use browser, Figma, screenshots, or image inputs for visual QA.
Use connectors for Google Drive, Gmail, Calendar, GitHub, Notion, etc.
Connect Sentry/logging tools instead of guessing from code alone.
MCP commands
codex mcp --help
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp login SERVER_NAME
codex
/mcpPlain-English MCP prompt
Use the connected docs/tooling instead of guessing.
First inspect which MCP tools or connectors are available.
Then use the smallest relevant source to answer or implement the task.
If the source is missing or stale, tell me before proceeding.Skills, Plugins, and Subagents
Skills vs plugins vs subagents
| Thing | Use it for | Non-technical translation |
|---|---|---|
| Skill | Reusable workflow instructions, references, scripts, templates | A saved playbook Codex can follow. |
| Plugin | Installable bundle of skills, tools, MCP servers, hooks, assets | A toolbox you can turn on. |
| Subagent | Parallel exploration, review, testing, summaries, independent tasks | Extra Codex workers for bounded jobs. |
Ask for subagents safely
Use parallel subagents for read-only analysis.
Spawn:
1. one agent for security risks
2. one agent for UX/accessibility issues
3. one agent for test gaps
Wait for all three. Return a consolidated list of findings with file references. Do not let subagents edit files.When not to use subagents
- Do not use multiple write-heavy agents on the same files unless you want merge conflicts.
- Do not use subagents for tiny tasks; they cost more tokens and coordination.
- Do use them for broad exploration, review, logs, and independent research.
Permissions and Security
Codex can run commands and edit files, so permissions matter. Start conservative, then loosen only in trusted repos.
Approval modes in plain English
| Mode | What it means | Best for |
|---|---|---|
| Read-only | Codex can inspect, but not change, until you approve. | Audits, explanations, risky repos. |
| Auto / workspace-write | Codex can work in the project folder and asks for broader actions. | Normal trusted project work. |
| Full Access / yolo | Codex can act broadly without approvals. | Only externally hardened environments or very trusted automation. |
Safe launch pattern
codex --sandbox workspace-write --ask-for-approval on-requestRules to add to AGENTS.md
## Safety rules
- Never print, commit, or paste secrets.
- Ask before deleting files, dropping databases, changing auth, or running migrations.
- Use read-only analysis first for unfamiliar production systems.
- Before deployment, run tests/build and review the diff.
- Prefer targeted fixes over broad rewrites.--dangerously-bypass-approvals-and-sandbox unless the environment is already isolated and you understand the risk.Skills and Plugin Library
Skills and plugins are how Codex grows beyond a generic coding assistant. Use skills for reusable workflows, and plugins when you want installable bundles that may include skills, app connections, MCP servers, assets, or hooks.
Skills vs plugins, in plain English
| Use this | When you want | Example |
|---|---|---|
| Skill | A repeatable workflow Codex should follow step by step. | A "PR reviewer" skill, "meeting insights" skill, or "n8n workflow audit" skill. |
| Plugin | A packaged capability you can install, enable, disable, and share. | Google Drive, Gmail, GitHub, Codex Security, or Sites. |
| MCP server | Live tools or private/external context inside Codex. | Figma, GitHub, Sentry, browser tools, docs servers. |
| App connector | Authorized access to a private app or workspace. | Read Google Docs, triage Gmail, inspect Calendar, manage Notion. |
OpenAI plugin library ideas
| Plugin or capability | Best for | Prompt to try |
|---|---|---|
| GitHub | PR summaries, issue triage, code review, CI failures. | "Use GitHub context to summarize this PR and list the risky changes." |
| Google Drive | Find docs, summarize files, create Docs/Sheets/Slides artifacts. | "Find the latest product brief in Drive and turn it into implementation tasks." |
| Gmail | Inbox triage, thread summaries, draft replies. | "Summarize unread Gmail threads from today and draft replies for the urgent ones." |
| Google Calendar | Daily briefs, availability, meeting prep. | "Prepare me for today's meetings with context and open questions." |
| Notion | Knowledge capture, specs, documentation, meeting intelligence. | "Turn this discussion into a Notion decision record." |
| Codex Security | Scan authorized code, review findings, verify fixes. | "Run a security review on this branch and prioritize actionable findings." |
| Sites | Create and deploy hosted websites, apps, and games. | "Create a simple internal landing page and deploy it as a Codex Site." |
| Canva | Create or adapt visual designs and presentations. | "Turn this HTML or brief into a Canva presentation." |
How to install or use plugins
In the Codex app:
1. Open Plugins.
2. Browse Curated by OpenAI, Shared with you, or Created by you.
3. Install the plugin.
4. Connect the external app if prompted.
5. Start a new thread and ask Codex to use it.
In the CLI:
codex
/pluginsHow to ask Codex to use a plugin
Use the installed [PLUGIN NAME] plugin if it is available.
First confirm what tools or skills the plugin exposes.
Then use the smallest relevant tool for this task:
[describe outcome]
If authentication or permission is missing, stop and tell me exactly what to connect.Create a reusable skill
Use a skill when you repeat the same workflow often: auditing an n8n workflow, hardening analytics tracking, reviewing a PR, creating a brand guide, preparing a meeting brief, or writing release notes.
---
name: project-handoff
description: Use when finishing a coding session and creating a concise handoff for the next Codex run.
---
1. Inspect changed files and commands run.
2. Summarize what changed in plain English.
3. List blockers, risks, and exact next steps.
4. Update docs/HANDOFF.md if it exists.
5. Do not claim tests passed unless you ran them.Where skills live
| Location | Scope | Use for |
|---|---|---|
.agents/skills | Repo | Team workflows checked into a project. |
~/.agents/skills | User | Your personal workflows across projects. |
/etc/codex/skills | Admin | Shared machine or organization defaults. |
| Bundled by OpenAI | System | Built-in skills such as creators and default workflows. |
Skill starter prompt
$skill-creator
I want a new skill for [workflow].
It should trigger when [situations].
It should not trigger when [boundaries].
The output should be [deliverable].
Ask me questions until the skill is clear, then create the SKILL.md.Advanced Features
Advanced Codex features are for making work faster, safer, or repeatable. Use them once the basic loop is working: prompt, plan, edit, test, review.
Advanced feature map
| Feature | Use when | Watch out for |
|---|---|---|
| Goal mode | A task will take many steps and needs a persistent definition of done. | Write measurable completion criteria. |
| Subagents | You need parallel read-heavy work, review, triage, or research. | Avoid parallel edits to the same files. |
| Automations | You want recurring background checks or reminders. | Use worktrees for Git repos when changes should stay isolated. |
| Hooks | You need custom checks before/after tool use or at session stop. | Review and trust hooks before running them. |
| Non-interactive mode | You want Codex in scripts, CI, logs, or pipelines. | Default to least privilege; avoid broad credentials. |
| Cloud tasks | You want hosted parallel work against GitHub repos. | Push your code and define a contained task. |
| Worktrees | You want isolated background or parallel changes. | Clean up old worktrees and avoid stale branches. |
Goal mode prompt
/goal
Objective: [specific outcome].
Definition of done:
- [measurable result]
- [tests/checks pass]
- [docs or handoff updated]
Constraints:
- Keep changes scoped.
- Ask before destructive actions.
- Report blockers clearly.Automation ideas
| Automation | Schedule | Prompt idea |
|---|---|---|
| Weekly repo health | Every Monday | "Inspect this repo for stale docs, failing tests, and risky dependencies. Report only actionable findings." |
| PR babysitter | Every 30 minutes | "Check this PR status. If CI or review feedback changed, summarize it and suggest next steps." |
| Daily inbox triage | Every morning | "Use Gmail and Calendar to brief me on urgent messages and today's meetings." |
| Newsletter workflow monitor | After scheduled run | "Check the latest n8n execution and report failures, empty content, or delivery issues." |
Ask Codex to create an automation
Create an automation for this project.
Task: [what to check or do]
Schedule: [daily, weekly, every 30 minutes, cron, etc.]
Scope: [current thread, standalone, or project automation]
Safety: use workspace-write only if edits are needed; otherwise read-only.
Reporting: only notify me when there are actionable findings.Non-interactive Codex commands
codex exec "summarize the repository structure"
codex exec --json "triage the top risks in this repo" | jq
codex exec --ephemeral "review this folder and suggest next steps"
npm test 2>&1 | codex exec "summarize failing tests and suggest the smallest fix"
codex exec --sandbox workspace-write "update release notes from recent commits"Hook starter example
Hooks can run scripts around Codex events. For non-technical teams, the best first hook is usually a Stop hook that reminds Codex to validate or update a handoff.
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "python3 .codex/hooks/stop_check.py",
"timeout": 30,
"statusMessage": "Checking completion rules"
}
]
}
]
}
}Advanced workflow prompt
This is an advanced Codex workflow.
Recommend the right surface before acting:
- normal thread
- goal mode
- subagents
- automation
- hook
- plugin or MCP
- codex exec
Explain why, then proceed only with the safest option that fits the task.Hacks and Troubleshooting
Small hacks that work
- Dictate context: In the Codex app, speech dictation can be faster than typing a long setup.
- Ask for a file map first: Great when you are lost in a repo.
- Use screenshots: UI bugs are easier when Codex can see them.
- Ask for "smallest safe change": This reduces broad rewrites.
- Resume instead of restating: Use
codex resume --lastwhen the previous thread had useful context. - Update AGENTS.md after repeated mistakes: Convert friction into durable instructions.
Troubleshooting prompts
Something is off. Do not guess.
Please inspect:
- current working directory
- current git branch and changed files
- active instructions
- available scripts
- the exact error output
Then explain the likely cause and the smallest safe fix.Common issues
| Problem | Try this |
|---|---|
| Codex edits the wrong files | Confirm working directory, branch, and active AGENTS.md files. |
| Codex seems stale | Ask it to inspect source files and current docs. Use live web search for changing facts. |
| Command fails | Paste the full error and ask Codex to diagnose before changing code. |
| Instructions not loading | Run a prompt asking Codex to list instruction sources; check for empty or override files. |
| Too much context | Ask Codex for a compact handoff summary and continue from that. |
Official Sources Used
This guide was adapted from the OpenAI Codex manual fetched during this build, plus the supplied Claude Code Bible interaction pattern and AI Con Todo branding.
OpenAI Codex docs
- Best practices
- Prompting
- CLI command reference
- CLI features
- AGENTS.md custom instructions
- Model Context Protocol
- Subagents
- Hooks
Notes for future updates
- Commands and model names can change. Re-check the official Codex manual before teaching this as a current workshop.
- For non-technical teams, keep the guide opinionated: app first, Plan mode for hard work, AGENTS.md for durable rules, tests before "done".
- Add team-specific commands to the AGENTS.md section once each project has real build and test scripts.