codex-consult

codex-consult is a command for Claude Code from Generous-Corp/pulp. It costs 65 tokens per session (754 once invoked), scanned A, original, MIT.

Consult OpenAI Codex (codex exec) for a second opinion on a prompt. Handles the argv-hang, stdin-mode, reasoning-effort, and timeout gotchas so the invocation always works. Accepts $ARGUMENTS as the prompt, or reads from a provided prompt file.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/generous-corp/pulp/codex-consult
Clone the repo
git clone --depth 1 https://github.com/Generous-Corp/pulp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-consult

README.md
[![agentmods](https://agentmods.dev/badge/commands/generous-corp/pulp/codex-consult.svg)](https://agentmods.dev/commands/generous-corp/pulp/codex-consult)
Your own site
<a href="https://agentmods.dev/commands/generous-corp/pulp/codex-consult"><img src="https://agentmods.dev/badge/commands/generous-corp/pulp/codex-consult.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 754 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.00754
Opus 5 $0.00032 $0.00377
Sonnet 5 $0.00013 $0.00151
Haiku 4.5 $0.00006 $0.00075

Measured today against content hash c57320715658, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-consult scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/codex-consult.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Codex Consult

A Pulp-side wrapper around codex exec that always invokes it the right way. Use this instead of calling codex exec ad hoc — the direct CLI silently hangs on anything past a short argv prompt.

When to use

  • You want a second opinion on a plan, review, or design choice
  • You need to sanity-check assumptions about a tool/API before committing to a direction
  • You want Codex to explore the repo independently (it can use the RepoPrompt MCP server from inside its session)

See ~/.claude/skills/codex/SKILL.md for the full flag reference and gotchas.

How to invoke

Agents: build the prompt in a file, then run the invocation below. Never pass a long prompt as a single argv argument to codex exec — it hangs silently with 0% CPU.

# 1. Write the prompt to a temp file (heredoc into `cat > /tmp/codex-prompt.txt <<'EOF' … EOF`).
# 2. Invoke:
cat /tmp/codex-prompt.txt | timeout 480 \
    codex exec -c model_reasoning_effort='"medium"' - \
    > /tmp/codex-answer.txt 2> /tmp/codex-progress.log

# 3. Read the answer:
cat /tmp/codex-answer.txt

Tune the reasoning effort down ("low") for faster answers on simple questions, up ("high", "xhigh") for deep analysis — but expect multi-minute runs at xhigh.

Prompt template

Include this framing in every Codex prompt so it knows to use RepoPrompt instead of raw shell, and knows the repo state:

Tooling preference: use the RepoPrompt MCP server's tools (file_search,
get_file_tree, read_file, get_code_structure) rather than raw shell.
CWD is /Users/danielraffel/Code/pulp on branch <BRANCH> at commit <SHA>.

<your question here>

Please give direct yes/no answers where possible and flag any step in
the plan that is wrong or risky.

Detecting a hung run

If the background invocation isn't returning:

ps -p <codex_pid> -o pid,state,time,%cpu,rss
lsof -p <codex_pid> 2>/dev/null | grep TCP | head -3
tail -20 /tmp/codex-progress.log
  • Thinking: CPU-seconds accumulating, at least one TCP connection, progress log grows with mcp: …started / …completed lines.
  • Wedged: 0% CPU, no TCP, progress log idle. Kill and retry with a shorter prompt / lower reasoning effort.

Read the full file on GitHub · 69 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 69 lines · 65 tokens per session scan A c57320715658

Subscribe to this mod's changes

codex-consult is a command published in the GitHub repository Generous-Corp/pulp (16 stars, last pushed today), licensed MIT. It adds 65 tokens to every session and 754 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.