PTENES
TRACK 1

🟢 Basic Codex — From Zero to Advanced

Master OpenAI’s Codex CLI from zero to advanced: installation, commands, skills, subagents, and real-world projects.

10 modules ~60 minutes Basic to Advanced

Learning path map

Detailed content

🟢 What It Is

O Codex is OpenAI's coding agent — a rival to Claude Code. Its differentiator: it runs agents in the cloud, delegates tasks remotely (even from your phone) and returns ready-to-use pull requests. 274K tokens of context.

💡 Why learn

More context than Claude Code, native worktree support, direct GitHub Actions integration. A natural complement to Claude for long-running cloud tasks.

🔑 The 3 Versions

VersionBest forDetail
CLI (terminal)Speed + local controlmacOS, Windows, Linux. Direct integration with repositories
App (Windows)Complete visual interfaceSkills, plugins, built-in browser, multiple parallel threads
Web (ChatGPT)Delegate to the cloudGitHub connected, agents run without your PC on, access from your phone

🟢 What It Is

Installation via npm. Prerequisite: Node.js v18+. Sign-in uses device auth — you open a link in the browser without exposing an API key.

💡 Why learn

An outdated version of Node.js causes silent failures. Device auth is more secure than an API key — it works in Docker containers without exposing environment variables.

🔑 Step by Step

Step 1 — Install Node.js
🟩 Windows
winget install --id Git.Git -e --source winget
# depois instale Node.js em nodejs.org
🟦 Linux
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
Step 2 — Install Codex
npm install -g @openai/codex
Step 3 — Log in
codex login --device-auth
# Abre link no browser → digita código → ✓ logado

🟢 What It Is

After installing, codex opens interactive mode. / accesses internal commands, @ references project files.

💡 Why learn

O agents.md is equivalent to CLAUDE.md — it defines permanent context. Without it, Codex starts from scratch in every session.

🔑 Key Concepts

codex                    # modo interativo
codex "crie uma API"     # prompt direto
codex chat               # modo conversa
codex --full-auto "..."  # sem confirmação
/plan mode— planning
/model— switch models
/browser use— activate browser
/skill creator— create a skill

🟢 What It Is

Approval policies control when Codex asks for confirmation. Set it to always ask or never ask, depending on the environment (local development vs. production).

💡 Why learn

In an isolated container or VM, disabling confirmations eliminates friction and greatly speeds things up. In production, always keep confirmations enabled.

🔑 Main Flags

FlagBehaviorRisk
--full-autoon-request + sandbox writeMedium
-a neverNever asks for approvalMedium
--dangerously-bypass...Zero confirmations, zero sandboxHigh ⚠️

🟢 What It Is

Skills are reusable instructions for recurring tasks. Create it once, use it with $nome-da-skill or let Codex invoke it automatically.

💡 Why learn

They eliminate repetition. A "PR review" skill can run 3 subagents in parallel without rewriting the prompt each time.

🔑 Minimum Structure

---
name: pr-review-agent
description: Use quando pedir revisão de PR, diff ou código alterado.
---
Ao revisar um PR:
1. Leia o diff completo
2. Identifique riscos de segurança
3. Verifique cobertura de testes
4. Classifique achados por severidade

🟢 What It Is

Codex has several “names” for agents — thread, task agent, worker, subagent, background agent, automation, skill. They’re all variations on how you structure the work.

💡 Why learn

Understanding the hierarchy avoids confusion. Start with threads + skills + automations. Subagents and workers come in when you need real parallelism.

🔑 Table of 10 Types

TypeUsage
Main agentRegular chat/thread
Subagent"Use subagents in parallel"
Background agentBackground thread
AutomationAutomations tab (scheduled)
Skill$name or natural language

🟢 What It Is

Specialized subagents launched in parallel. Codex doesn't create them automatically — you explicitly ask for it with "use subagents in parallel".

💡 Why learn

Parallelizing audits, feature planning, and refactoring drastically reduces the total time.

🔑 Prompt Formula

Use subagentes em paralelo para [objetivo].
Divida:
1. Subagente A: [papel específico]
2. Subagente B: [papel específico]
3. Subagente C: [papel específico]
Regras: trabalho independente, não edite ainda, consolide no final.

🟢 What It Is

Worktrees let multiple agents work in parallel without mixing changes. Each agent has its own directory + branch. OpenAI highlights worktrees as a central part of the multiagent workflow.

💡 Why learn

Without worktrees, two agents editing the same file create conflicts. With worktrees, each works in isolation, and you merge afterward.

🔑 Git/GitHub Capabilities

🌿 Worktrees

Parallel agents, their own branches, no conflicts

📋 Automatic PRs

Branch + commit + push + PR with summary

⚡ GitHub Actions

Codex as CI, automatic patches

📱 Mobile Phone

Delegates through the ChatGPT app, receives PRs remotely

🟢 What It Is

Automations configure routines that Codex runs at a set time without you being present. Available in the Automations from the Codex App (Windows).

💡 Why learn

Turns Codex into a team member who works while you sleep — reviewing code, running tests, and generating reports.

🔑 Example: Weekly Review

Toda segunda-feira às 9h:
1. Atualizar dependências (se seguro)
2. Rodar testes
3. Rodar build
4. Gerar reports/weekly-review.md
5. Se houver mudanças, criar commit

🟢 What It Is

Building a stock portfolio app complete — with a UI, database, real market data, and marketing materials — using Codex 5.5, with no prior programming experience.

💡 Why learn

Pushes Codex to its limits: real multitasking with 3 simultaneous agents (dev + video + research), image generation, and reverse prompting.

🔑 Project Workflow

1

Design with image generation — Codex generates visual options, user chooses

2

Frontend + database — Next.js + Convex to persist the portfolio

3

Real data — free Alpha Vantage API for live prices

4

Multitasking — 3 agents: dev + video (Remotion) + research (browser)

5

Reverse prompting — ask Codex “what should be done next?”

← Home Next: T2 Terminal →