consult-codex
Consult Codex
Multi-turn consultation with Codex CLI. Maintains a conversation across multiple turns using session persistence.
Step 1: Gather Context
Identify the 2-5 files most relevant to the problem. Formulate a clear, specific question. Include what has been tried and relevant constraints.
Step 2: Start Session
Run codex exec with -o to capture the response cleanly. Default to -s read-only for safety. Use -s workspace-write when the consultation requires running code, inspecting an artifact passed by path, or reading files outside the workspace, and tell Codex to keep any scratch files it writes under .turbo/. Pass the same -s value on every resume turn of the consultation: a resume turn takes its sandbox from its own command line, and without the flag it falls back to the codex config, where a trusted project runs workspace-write.
Omit -m, leaving the consultation on codex's configured model. When the user named a model for this consultation, add -m <model> to every codex exec command in this skill, resume turns included, and pass the name verbatim.
All codex Bash calls require dangerouslyDisableSandbox: true (network access to OpenAI API). Use .turbo/ as the temp directory — it is in the working directory (sandbox-writable), gitignored, and avoids $TMPDIR path mismatches between sandbox and non-sandbox mode.
Every codex exec invocation requires --skip-git-repo-check, resume turns included. Outside a git repository codex aborts before doing any work, printing Not inside a trusted directory and --skip-git-repo-check was not specified., and never writes the -o file.
Non-piped codex exec invocations require < /dev/null to avoid hanging on stdin. Codex reads from stdin whenever stdin is non-TTY, and in subprocess contexts the harness leaves stdin connected to a pipe that never EOFs — codex blocks forever, printing only Reading additional input from stdin.... The piped form (cat file | codex exec "...") is safe — cat closes the pipe after the file.