Skip to content
Development
Skill

/consult-codex

Multi-turn consultation with Codex CLI for second opinions, brainstorming, or collaborative problem-solving. Use when the user asks to \"consult codex\", \"ask codex\", \"get codex's opinion\", \"brainstorm with codex\", \"discuss with codex\", or \"chat with codex\".

From plugin
turbo
40279 skills
Install
$ npx -y skills add tobihagemann/turbo --skill consult-codex --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/consult-codex

Context preview

The summary Claude sees to decide when to auto-load this skill.

Multi-turn consultation with Codex CLI for second opinions, brainstorming, or collaborative problem-solving. Use when the user asks to \"consult codex\", \"ask codex\", \"get codex's opinion\", \"brainstorm with codex\", \"discuss with codex\", or \"chat with codex\".

SKILL.md

consult-codex.SKILL.md
name: consult-codex
description: "Multi-turn consultation with Codex CLI for second opinions, brainstorming, or collaborative problem-solving. Use when the user asks to \"consult codex\", \"ask codex\", \"get codex's opinion\", \"brainstorm with codex\", \"discuss with codex\", or \"chat with codex\"."

Consult Codex

Multi-turn consultation with Codex CLI. Maintains a conversation across multiple turns using session persistence, unlike single-shot `/codex-exec`.

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 or reading files outside the workspace.

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.

Generate a random session tag at the start to keep files unique for parallel use, and print the absolute path prefix it produces:

CODEX_TAG=$(head -c 4 /dev/urandom | xxd -p) && mkdir -p "$PWD/.turbo/codex" && echo "$PWD/.turbo/codex/$CODEX_TAG"

Substitute the printed value for `<prefix>` in every later command of this consultation. Shell variables do not survive between Bash tool calls, and an earlier `cd` in a compound command leaves the session in a different directory, so a relative path resolves against that directory instead.

Number the `-o` file by turn — `<prefix>-1.txt` for the first, `<prefix>-2.txt` for the next, and so on. A turn that reuses the previous turn's path finds that turn's complete answer waiting there, so a read landing before the current turn finishes returns the wrong answer with nothing to mark it as stale.

codex exec --skip-git-repo-check -s read-only -o "<prefix>-1.txt" "<question>" < /dev/null

Prompt Shaping

Structure the question using XML tags for clearer Codex responses:

  • `<task>`: The concrete question and relevant context.
  • `<compact_output_contract>`: Desired output shape and brevity requirements.
  • `<structured_output_contract>`: Same purpose but for structured/schema responses.
  • `<grounding_rules>`: When claims must be evidence-based (review, research, root-cause analysis).
  • `<dig_deeper_nudge>`: Push past surface-level findings to check for second-order failures.
  • `<verification_loop>`: When correctness matters — ask Codex to verify before finalizing.
  • `<merit_only>`: When a recommendation is wanted, bar answers that appeal to scope.
  • `<verdict_line>`: When the consultation runs until Codex approves, fix the line that ends every response and terminates the loop.
  • `<style_constraints>`: When the answer must follow a house style, name the shapes that style forbids.

Example prompt for a diagnosis question:

<task>Diagnose why the auth middleware rejects valid tokens after the session refactor.</task>
<compact_output_contract>Return: (1) most likely root cause, (2) evidence, (3) smallest safe next step.</compact_output_contract>
<grounding_rules>Ground every claim in the provided context or tool outputs. Label hypotheses explicitly.</grounding_rules>

For correctness-critical questions, add `<verification_loop>` asking Codex to verify its answer before finalizing.

When a recommendation is wanted, add `<merit_only>`: state that "out of scope" or "leave it alone" is not an acceptable argument on its own, and that recommending no change must be justified on technical merit. Pair it with `<compact_output_contract>` demanding one pick per decision, the reasoning, and the strongest counterargument to that pick, with hedging across options ruled out.

When the consultation runs until Codex approves, add `<verdict_line>`: require every response to end with exactly one fixed line stating the verdict, in a designated positive or negative form, carrying nothing else. Terminate the loop when that line reaches the positive form, so a politely worded answer does not end it early and agreement does not go unrecognized. Pair it with `<compact_output_contract>` demanding that each finding ship a ready-to-paste replacement rather than an instruction, which keeps a round cheap enough to iterate.

When the consultation is a prose rewrite bound by a house style, add `<style_constraints>` naming the shapes that style forbids in the first prompt, so they do not have to be corrected across follow-up turns. Common ones: prefixing a summary with a grammatical subject the convention omits, expanding a pronoun to its full noun phrase at every occurrence, and splitting a sentence so a condition is restated in both halves.

Instruct Codex to answer the consultation itself rather than delegating to a peer review or consultation skill that crosses back to Claude. The prompt has already crossed the tool b

Read more
Ships withturbo

A composable dev process for agentic coding harnesses, packaged as modular skills. Turbo has sibling editions for Claude Code and Codex. The Claude Code edition is production-tested.

Get the whole plugin
Stats
402
Stars
30
Forks
Active
Maintenance
Shell
Language
MIT
License
2d ago
Last commit
6mo ago
Created

Repo: tobihagemann/turbo

Other skills on turbo.

audit
Skill

audit

Project-wide health audit pipeline that fans out to all analysis skills in parallel, evaluates findings, and produces a unified report at .turbo/audit.md. Use…