/ CMD K
Home Courses OpenAI Codex 0% complete

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.

10
Follow the course
Build something by day 2 or 3.
#
Work in your repo
Give Codex files, docs, and context.
OK
Safe and reviewable
Ask for checks before approval.
!
Save time, ship faster
Focus on decisions, not busywork.
How Codex Works At a Glance
1
Assign a taskDescribe what you want Codex to do.
2
Codex plansIt explores the repo and creates a path.
3
Codex executesIt edits files, runs commands, and validates.
4
You reviewReview the diff, ask follow-ups, then ship.
Essential Commands

Run these in your terminal from inside your repository.

bash
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-request
Best Practices
Be specific

Clear goals and constraints lead to better results.

Provide context

Link files, docs, screenshots, and errors.

Review carefully

Always review diffs, tests, and logs.

Iterate quickly

Small tasks and faster feedback beat huge prompts.

Extend Codex
Skills

Reusable playbooks for repeated work.

Plugins

Installable tool bundles from OpenAI and teams.

Automations

Scheduled background checks and reminders.

Hooks

Custom checks that run inside the agent loop.

Course Path

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

DayLevelModuleOutcome
1BeginnerInstall + VS Code TerminalOpen a project folder, run safe commands, start Codex.
2BeginnerFirst BuildCreate a simple landing page, tool, or dashboard mockup.
3BeginnerGitHub + DeployCommit, push, and deploy to a public or private preview.
4BuilderPrompt LoopUse goal, context, constraints, and done criteria.
5BuilderRules and MemoryAdd AGENTS.md, project standards, and common commands.
6BuilderReview + TestingAsk Codex to run checks, explain errors, and review changes.
7PowerSkills + PluginsUse reusable workflows and installed capabilities.
8PowerMCP + ConnectorsConnect docs, GitHub, browser, databases, or private tools.
9AdvancedSubagents, Worktrees, Background TasksSplit research, QA, and implementation safely.
10AdvancedLaunch ReviewSecurity, privacy, performance, deploy checklist, handoff.

What to teach now vs later

LevelTeach these firstHold until later
BeginnerVS Code terminal, install commands, first prompt, Git checkpoints, GitHub push, deploy.Hooks, custom plugins, managed settings, MCP server authoring.
BuilderAGENTS.md, project overview, development standards, common commands, known issues, related projects.Complex rule hierarchies, enterprise settings, background automation.
Power userSkills, plugin library, MCP connectors, slash commands, permissions, checkpoints, troubleshooting.Writing plugins, custom MCP servers, hook security design.
Super advancedSubagents, 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

Commands

Daily CLI commands, slash commands, review commands, and safe launch flags.

Memory and rules

Use AGENTS.md, project docs, handoff files, and configuration layers.

Skills

Reusable workflows with progressive disclosure: instructions, references, scripts, and assets.

Plugins

Installable bundles that can include skills, tools, connectors, hooks, or assets.

MCP and connectors

Bring live tools and private context into Codex instead of guessing.

Subagents and worktrees

Use for parallel research, QA, broad audits, and isolated changes.

Checkpoints

For beginners, teach Git checkpoints first: commit before big changes and review diffs.

Hooks and managed settings

Super advanced: enforce rules mechanically after students understand manual review.

Prompt: turn any module into a simple lesson

prompt
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 later
Course design rule: beginners build first, then learn advanced agent architecture only when they need leverage or safety.
Part 1

Install 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

StepInstallWhy it mattersWhat to do
1GitSaves versions of your project and connects to GitHub.Install Git, then restart your terminal.
2Node.js LTSRuns many modern website/app tools.Install the LTS version from Node.js.
3Visual Studio CodeThe editor where you see and organize project files.Install VS Code and add the code command if prompted.
4CodexThe AI coding agent that reads, edits, runs, and reviews code.Use the official Codex install commands below, then sign in.
5GitHub accountLets 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

Mac users usually paste the macOS/Linux command. Windows users usually paste the Windows PowerShell command inside the VS Code terminal. If VS Code asks which terminal profile to use, choose PowerShell on Windows or zsh/bash on Mac.

Official install commands to paste

bash
# 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 codex

After install, start Codex inside VS Code

bash
codex --version
codex login
codex

Use 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

VS Code
File -> Open Folder...
Documents/codex-projects/my-first-project
Explorer shows your files on the left

Always open the whole project folder, not a single file. Codex needs the full folder context.

2. Open the terminal

VS Code
Explorer | Search | Source Control
Terminal -> New Terminal
$ codex --version

The terminal should open at the bottom of VS Code. This is where you paste setup commands.

3. Start Codex

Terminal
cd Documents/codex-projects/my-first-project
codex app .
Sign in when Codex asks

On macOS, codex app . opens the current folder in the Codex desktop app.

Copy-paste setup checks

bash
git --version
node --version
npm --version
codex --version
codex login
codex app .
If a command says "not found" or "not recognized", close and reopen VS Code and Terminal first. If it still fails, reinstall that tool and restart the computer.

First prompt after opening Codex

prompt
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

SurfaceBest forPlain-English advice
Codex appLocal projects, planning, visual review, connected tools, long conversationsStart here if you are not technical. Open the project folder, explain the outcome, and let Codex inspect files.
Codex CLITerminal-first work, quick commands, scripted automationUse when you want to type codex inside a project folder and work directly with the repo.
IDE extensionEditor-attached coding, selected code, open filesUse when you are already in the code editor and want context from specific files.
Codex cloudParallel tasks, GitHub repos, work from another devicePush your code to GitHub first, then delegate contained tasks.

One-time setup checklist

bash
codex doctor
Source: OpenAI Codex manual sections for CLI features, authentication, and command reference.
Part 2

Starting 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

text
my-project/
  AGENTS.md
  docs/
    MASTERPLAN.md
    DECISIONS.md
    TESTING.md
  src/
  package.json

The four-part prompt formula

PieceWhat to writeExample
GoalThe specific outcome"Add password reset to the app."
ContextFiles, docs, screenshots, errors, URLs"Read docs/MASTERPLAN.md and src/auth first."
ConstraintsRules, libraries, safety limits"Do not add new packages unless needed."
Done whenHow Codex proves success"Tests pass and the reset email flow works locally."

First prompt for a new repo

prompt
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.

prompt
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 done
Part 7

Prompt 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

prompt
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

prompt
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

prompt
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.

bash
codex --image screenshot.png "Explain what is wrong with this UI and fix the app to match the intended design."
Part 3

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

LayerRecommended defaultWhy it matters
Project memorydocs/MASTERPLAN.md + AGENTS.mdKeeps Codex and future agents aligned on the product, commands, and rules.
Version controlPrivate GitHub repositoryStores the code in the cloud, enables rollback, and lets other agents or collaborators continue.
HostingVercel connected to GitHubEvery push can create a preview; production deploys from the main branch.
UI/designTailwind CSS + shadcn/ui + lucide-reactFast, modern, accessible components that agents can extend cleanly.
PaymentsStripe Checkout SessionsBest default for first paid products because Stripe hosts the sensitive checkout flow.
Compliance basicsPrivacy, terms, legal notice, cookie bannerOften required before ads, payments, analytics, or serious launch.

GitHub handoff checklist

Prompt: prepare and push existing project to GitHub

prompt
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

bash
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 HEAD
Do not run git add . blindly on a first project. Ask Codex to inspect what will be staged first.

Vercel prompt

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

prompt
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

LibraryUse whenPrompt line
Tailwind CSSYou want fast styling without custom CSS chaos."Use Tailwind utility classes and keep design tokens consistent."
shadcn/uiYou want polished forms, dialogs, nav, tables, and dashboard components."Use shadcn/ui components where appropriate; do not over-install."
lucide-reactYou need clean icons in buttons, nav, cards, and empty states."Use lucide-react icons instead of random emoji for production UI."
Framer MotionYou need subtle product animations."Add restrained motion only where it clarifies state or hierarchy."
Magic UI / Aceternity-style componentsYou want marketing polish, but only after the core app works."Use one or two premium visual sections, not a decorative component dump."
Course notes used: private GitHub repo first, Vercel hosting from GitHub, Stripe test/live environments, legal/cookie basics, and continuous audits. Official references checked: GitHub local-to-remote docs, Vercel Git deployments, Stripe Checkout Sessions, and shadcn/ui docs.
Part 4

Commands Cheat Sheet

Everyday commands

CommandUse it when
codexOpen 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 --lastContinue your most recent session.
codex doctorGenerate diagnostics when something feels broken.
codex completion zshInstall shell completions so Tab shows commands.
codex updateCheck for and apply a CLI update if supported.

Useful launch flags

bash
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

/plan

Use before complex or ambiguous work. Codex gathers context and plans before coding.

/review

Review uncommitted changes, a branch diff, or a commit.

/permissions

Change how much Codex can do without asking.

/mcp

Inspect active MCP servers and tool connections.

/goal

Set a persistent objective for longer tasks when enabled.

/agent

Inspect or switch between subagent threads in CLI workflows.

Part 8

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

bash
codex
/init

After Codex scaffolds the file, edit it so it reflects how your team actually works.

Copy-paste starter template

markdown
# 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

FileScopeWhen to use
~/.codex/AGENTS.mdGlobalYour personal defaults across all repos.
AGENTS.mdProjectRules everyone should follow in this repo.
subfolder/AGENTS.mdNestedRules for a specific area like payments or mobile.
AGENTS.override.mdOverrideTemporary or stronger rules that should win.
Keep AGENTS.md practical. Short, accurate instructions beat long vague rules. Add rules after repeated mistakes, not before.
Part 6

Daily Workflow

The safe loop

Daily opening prompt

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

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.
Part 7

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

prompt
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

bash
codex
/review

What to ask Codex to run

Project typeCommon checks
JavaScript/React/Next.jsnpm test, npm run lint, npm run build
Pythonpytest, ruff check, mypy
Static HTMLOpen in browser, test links, search, buttons, responsive layout
Unknown repoAsk Codex to inspect package files and README to identify checks.
Part 9

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

Docs are changing

Use an official docs MCP or web search instead of stale memory.

Design matters

Use browser, Figma, screenshots, or image inputs for visual QA.

Private data matters

Use connectors for Google Drive, Gmail, Calendar, GitHub, Notion, etc.

Production bugs

Connect Sentry/logging tools instead of guessing from code alone.

MCP commands

bash
codex mcp --help
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp login SERVER_NAME
codex
/mcp

Plain-English MCP prompt

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.
Part 10

Skills, Plugins, and Subagents

Skills vs plugins vs subagents

ThingUse it forNon-technical translation
SkillReusable workflow instructions, references, scripts, templatesA saved playbook Codex can follow.
PluginInstallable bundle of skills, tools, MCP servers, hooks, assetsA toolbox you can turn on.
SubagentParallel exploration, review, testing, summaries, independent tasksExtra Codex workers for bounded jobs.

Ask for subagents safely

prompt
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.
Part 13

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

ModeWhat it meansBest for
Read-onlyCodex can inspect, but not change, until you approve.Audits, explanations, risky repos.
Auto / workspace-writeCodex can work in the project folder and asks for broader actions.Normal trusted project work.
Full Access / yoloCodex can act broadly without approvals.Only externally hardened environments or very trusted automation.

Safe launch pattern

bash
codex --sandbox workspace-write --ask-for-approval on-request

Rules to add to AGENTS.md

markdown
## 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.
Do not use --dangerously-bypass-approvals-and-sandbox unless the environment is already isolated and you understand the risk.
Part 11

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 thisWhen you wantExample
SkillA repeatable workflow Codex should follow step by step.A "PR reviewer" skill, "meeting insights" skill, or "n8n workflow audit" skill.
PluginA packaged capability you can install, enable, disable, and share.Google Drive, Gmail, GitHub, Codex Security, or Sites.
MCP serverLive tools or private/external context inside Codex.Figma, GitHub, Sentry, browser tools, docs servers.
App connectorAuthorized access to a private app or workspace.Read Google Docs, triage Gmail, inspect Calendar, manage Notion.

OpenAI plugin library ideas

Plugin or capabilityBest forPrompt to try
GitHubPR summaries, issue triage, code review, CI failures."Use GitHub context to summarize this PR and list the risky changes."
Google DriveFind docs, summarize files, create Docs/Sheets/Slides artifacts."Find the latest product brief in Drive and turn it into implementation tasks."
GmailInbox triage, thread summaries, draft replies."Summarize unread Gmail threads from today and draft replies for the urgent ones."
Google CalendarDaily briefs, availability, meeting prep."Prepare me for today's meetings with context and open questions."
NotionKnowledge capture, specs, documentation, meeting intelligence."Turn this discussion into a Notion decision record."
Codex SecurityScan authorized code, review findings, verify fixes."Run a security review on this branch and prioritize actionable findings."
SitesCreate and deploy hosted websites, apps, and games."Create a simple internal landing page and deploy it as a Codex Site."
CanvaCreate or adapt visual designs and presentations."Turn this HTML or brief into a Canva presentation."

How to install or use plugins

text
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
/plugins

How to ask Codex to use a plugin

prompt
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.

markdown
---
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

LocationScopeUse for
.agents/skillsRepoTeam workflows checked into a project.
~/.agents/skillsUserYour personal workflows across projects.
/etc/codex/skillsAdminShared machine or organization defaults.
Bundled by OpenAISystemBuilt-in skills such as creators and default workflows.

Skill starter prompt

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.
Source: OpenAI Codex manual sections for Agent Skills and Plugins.
Part 12

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

FeatureUse whenWatch out for
Goal modeA task will take many steps and needs a persistent definition of done.Write measurable completion criteria.
SubagentsYou need parallel read-heavy work, review, triage, or research.Avoid parallel edits to the same files.
AutomationsYou want recurring background checks or reminders.Use worktrees for Git repos when changes should stay isolated.
HooksYou need custom checks before/after tool use or at session stop.Review and trust hooks before running them.
Non-interactive modeYou want Codex in scripts, CI, logs, or pipelines.Default to least privilege; avoid broad credentials.
Cloud tasksYou want hosted parallel work against GitHub repos.Push your code and define a contained task.
WorktreesYou want isolated background or parallel changes.Clean up old worktrees and avoid stale branches.

Goal mode prompt

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

AutomationSchedulePrompt idea
Weekly repo healthEvery Monday"Inspect this repo for stale docs, failing tests, and risky dependencies. Report only actionable findings."
PR babysitterEvery 30 minutes"Check this PR status. If CI or review feedback changed, summarize it and suggest next steps."
Daily inbox triageEvery morning"Use Gmail and Calendar to brief me on urgent messages and today's meetings."
Newsletter workflow monitorAfter scheduled run"Check the latest n8n execution and report failures, empty content, or delivery issues."

Ask Codex to create an automation

prompt
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

bash
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.

json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "python3 .codex/hooks/stop_check.py",
            "timeout": 30,
            "statusMessage": "Checking completion rules"
          }
        ]
      }
    ]
  }
}

Advanced workflow prompt

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.
Source: OpenAI Codex manual sections for Automations, Hooks, Subagents, Cloud, Worktrees, and Non-interactive mode.
Part 14

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 --last when the previous thread had useful context.
  • Update AGENTS.md after repeated mistakes: Convert friction into durable instructions.

Troubleshooting prompts

prompt
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

ProblemTry this
Codex edits the wrong filesConfirm working directory, branch, and active AGENTS.md files.
Codex seems staleAsk it to inspect source files and current docs. Use live web search for changing facts.
Command failsPaste the full error and ask Codex to diagnose before changing code.
Instructions not loadingRun a prompt asking Codex to list instruction sources; check for empty or override files.
Too much contextAsk Codex for a compact handoff summary and continue from that.
Reference

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

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.