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
41775 skills

Claude Code

$ npx -y skills add tobihagemann/turbo --skill consult-codex --agent claude-code

SKILL.md

consult-codex.SKILL.md
name: consult-codex
description: "Multi-turn consultation with Codex CLI for second opinions or brainstorming. Use when the user asks to \"consult codex\", \"ask codex\", \"get codex's opinion\", or \"brainstorm with 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.

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 Codex must judge claims against a source, state in `<grounding_rules>` whether the material provided is the complete source or an excerpt. When a verdict can turn on something being absent, provide the complete relevant sections: given an excerpt, Codex reports what the excerpt leaves out as unverifiable or missing. Pass the complete source, or its path for Codex to read, whenever it fits. When an excerpt is unavoidable, confirm before running that every passage the claims under judgment rest on made it into the material provided.

When the consultation concerns an artifact Codex can inspect itself, pass its path and let Codex choose how to inspect it, rather than attaching excerpts or other material extracted from it.

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 question lists options, state in that contract that the pick may be a named alternative outside the list when it is sounder than every listed option.

When the consultation runs unti

Read more
@tobihagemann
Ships withturbo

Reusable workflows for planning, building, reviewing, and shipping with Claude Code and Codex.

Stars on GitHub

Momentum

stars in total
417
Star history of tobihagemann/turbo on GitHub, a chart by star-history.com

Other skills on turbo.

apply-turbo-handoffs

apply-turbo-handoffs

Audit the turbo skill lessons that /self-improve writes into this repo's .turbo/handoff/ from other projects, apply the ones the…

@tobihagemann@tobihagemannInstall Skill
apply-findings

apply-findings

Apply findings by making the suggested code changes. Applies accepted verdicts, escalates ambiguous findings to the user, and…

@tobihagemann@tobihagemannInstall Skill
assess-technical-debt

assess-technical-debt

Assess project-wide structural technical debt: complexity hotspots, deprecated API usage, duplication clusters, architecture rot,…

@tobihagemann@tobihagemannInstall Skill
changelog-rules

changelog-rules

Shared changelog conventions and formatting rules referenced by /create-changelog and /update-changelog. Not typically invoked…

@tobihagemann@tobihagemannInstall Skill
code-style

code-style

Enforce existence, reuse, mirror, and symmetry principles to keep new code minimal and consistent with surrounding code. Use when…

@tobihagemann@tobihagemannInstall Skill
codex-exec

codex-exec

Run autonomous task execution using the codex CLI. Use when the user asks to \"codex exec\", \"run codex exec\", \"execute a task…

@tobihagemann@tobihagemannInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about consult-codex.

Which coding agents can use consult-codex?
consult-codex installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.