-
If unclear, ask the user (via AskUserQuestion) what they want reviewed or changed.
-
Assemble the codex command with appropriate options:
-m, --model gpt-5.3-codex (default model)
-c model_reasoning_effort="xhigh" (default reasoning effort; options: none, minimal, low, medium, high, xhigh)
--sandbox <mode> - use read-only for reviews, workspace-write for edits, danger-full-access for network/broad access
--full-auto - only for write operations, not needed for read-only
-C, --cd <DIR> - run from a different directory
-
When continuing a previous session, use resume syntax:
codex exec resume --last "your prompt here" 2>/dev/null
Add --skip-git-repo-check if running outside a git repo.
Do not use configuration flags when resuming unless explicitly requested - the session inherits original settings.
-
For code reviews, prefer the dedicated review subcommand:
codex exec review --base main "Review instructions" 2>/dev/null
Options: --uncommitted (staged/unstaged/untracked), --base <branch>, --commit <sha>.
-
IMPORTANT: Append 2>/dev/null to suppress thinking tokens (stderr). Only show stderr if debugging is needed.
-
Run the command, summarize the outcome for the user.
-
After Codex completes, inform the user: "You can resume this Codex session at any time by saying 'codex resume'."