First Codex Session
Launching Codex, understanding modes, first task execution
Starting a Codex session follows a similar pattern to Claude Code.
Starting a session
- Navigate to your project directory:
cd ~/projects/myapp - Launch Codex:
codex
This opens a full-screen terminal UI a distinct visual style from Claude Code's inline interface.
Alternatively, pass an initial prompt directly:
codex "explain this codebase to me"Codex reads your project structure, analyzes relevant files, and presents its understanding in the terminal.
Understanding the three modes
-
Suggest Mode (
--suggest) Requires approval for every action. Shows proposed edits and commands, prompting"Allow? [y/N/e/a]"before proceeding. Best for learning or sensitive codebases. -
Auto-Edit Mode (
--auto-edit) Allows automatic file modifications but still prompts before shell commands. Balances speed with safety for active development. -
Full-Auto Mode (
--full-auto) Handles everything autonomously: file edits, commands, and iteration. Reserve for well-defined tasks in isolated environments.
Switch modes mid-session using the /approvals slash command.
First task execution
A productive first session follows this pattern:
codex --suggest "add input validation to the login function"Codex reads the relevant files, proposes a diff showing exact changes, and waits for approval:
yApply the changeeOpen an editor to modify the proposalNReject it
Create a Git commit before experimenting with auto modes. This provides an easy revert path if results are unexpected.
The interaction is more transactional than Claude Code's conversational flow. Codex presents discrete actions for approval rather than extended dialogue a design reflecting its sandbox-first security philosophy.