Codex
Run a task through OpenAI's Codex CLI in read-only mode and report the results back.
Step 1: Determine the prompt
- If the user provided a specific task (e.g.,
/codex review this PR for security issues), use that as the Codex prompt. - If the user invoked
/codexwithout arguments, ask what they want Codex to analyze. - Prepend context to the prompt as needed — current branch, relevant file paths, or a summary of recent changes — so Codex has enough information to produce useful output.
Step 2: Run Codex
Execute the following command via Bash, substituting <PROMPT> with the full prompt from Step 1:
codex exec --sandbox read-only -m gpt-5.3-codex -c model_reasoning_effort=high "<PROMPT>" 2>/dev/null
Notes:
- Stderr is redirected to
/dev/nullbecause Codex streams thinking tokens there, which would consume excessive context. - If the command fails (auth error, model unavailable), tell the user and suggest checking that
CODEX_API_KEYorOPENAI_API_KEYis set. - For large codebases, set a generous timeout (up to 10 minutes).
Step 3: Capture and save output
- Capture the stdout from the Codex command — this is the final analysis.
- Write it to a markdown file in the project root:
codex-report-YYYY-MM-DD-HHMMSS.md, with a brief header noting the prompt used and model. - Summarize the key findings inline in the conversation so the user gets an immediate overview without opening the file.
Output format
The inline summary should be concise — highlight the top findings, flag anything critical, and note where the full report is saved. Example:
Codex analysis complete — saved to
codex-report-2026-02-07-143022.mdKey findings:
- [finding 1]
- [finding 2]
- [finding 3]
See the full report for details.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.