OpenAI Codex CLI wrapper — three modes. An agent skill from mr-daedalium/ostack-saas.

MITAuto-check: notesDevelopment

Install Codex

skills CLI
$ npx skills add mr-daedalium/ostack-saas --skill codex -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mr-daedalium/ostack-saas codex --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mr-daedalium/ostack-saas.git skills-src && mkdir -p .claude/skills && cp -r skills-src/codex .claude/skills/codex && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codex
GitHub stars
114
Used in
2 other repos
Token cost
~7.2k tokens
SKILL.md length
3,163 words
Files
2
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

OpenAI Codex CLI wrapper — three modes. An agent skill from mr-daedalium/ostack-saas.

  • Works in 3 steps: Detect base branch → Check codex binary → Detect mode
  • Asked to codex review
  • SKILL.md covers Preamble (run first), AskUserQuestion Format, Conviction and Completeness —… and Repo Ownership Mode — See…, plus 17 more sections
  • Calls codex, git and python3

What it does

Codex is an agent skill from mr-daedalium/ostack-saas. OpenAI Codex CLI wrapper — three modes. Code review: independent diff review via codex review with pass/fail gate. Challenge: adversarial mode that tries to break your code. Consult: ask codex anything with session continuity for follow-ups. The "200 IQ autistic developer" second opinion. Use when asked to "codex review", "codex challenge", "ask codex", "second opinion", or "consult codex".

Its SKILL.md is about 7.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Development. The repository describes itself as: ostack — AI-powered engineering team for Claude Code. Fork of gstack by Garry Tan. The licence is MIT.

When your agent uses it

  • Asked to codex review
  • Codex challenge

Example prompts

  • “200 IQ autistic developer”
  • “codex review”
  • “codex challenge”
  • “/codex”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, Write, Glob, Grep, AskUserQuestion

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Detect base branch
  2. Check codex binary
  3. Detect mode

What it can do on your machine

Read from SKILL.md and the folder at commit a67256d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Write
    • Glob
    • Grep
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • codex
    • git
    • python3
    • gh
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codex loads about 7.2k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 3,163 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~7.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Write, Glob, Grep, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mr-daedalium/ostack-saas at commit a67256d, republished under its MIT licence (© mr-daedalium). 3,163 words, ~7,219 tokens.

Download SKILL.mdSave it as .claude/skills/codex/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
codex
description
OpenAI Codex CLI wrapper — three modes. Code review: independent diff review via codex review with pass/fail gate. Challenge: adversarial mode that tries to break your code. Consult: ask codex anything with session continuity for follow-ups. The "200 IQ autistic developer" second opinion. Use when asked to "codex review", "codex challenge", "ask codex", "second opinion", or "consult codex".
allowed-tools
Bash, Read, Write, Glob, Grep, AskUserQuestion
version
1.0.0
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
<!-- Regenerate: bun run gen:skill-docs -->

Preamble (run first)

bash
_UPD=$(~/.claude/skills/ostack/bin/ostack-update-check 2>/dev/null || .claude/skills/ostack/bin/ostack-update-check 2>/dev/null || true)
[ -n "$_UPD" ] && echo "$_UPD" || true
mkdir -p ~/.ostack/sessions
touch ~/.ostack/sessions/"$PPID"
_SESSIONS=$(find ~/.ostack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
find ~/.ostack/sessions -mmin +120 -type f -delete 2>/dev/null || true
_CONTRIB=$(~/.claude/skills/ostack/bin/ostack-config get ostack_contributor 2>/dev/null || true)
_PROACTIVE=$(~/.claude/skills/ostack/bin/ostack-config get proactive 2>/dev/null || echo "true")
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "BRANCH: $_BRANCH"
echo "PROACTIVE: $_PROACTIVE"
source <(~/.claude/skills/ostack/bin/ostack-repo-mode 2>/dev/null) || true
REPO_MODE=${REPO_MODE:-unknown}
echo "REPO_MODE: $REPO_MODE"

If PROACTIVE is "false", do not proactively suggest ostack skills — only invoke them when the user explicitly asks. The user opted out of proactive suggestions.

If output shows UPGRADE_AVAILABLE <old> <new>: read ~/.claude/skills/ostack/ostack-upgrade/SKILL.md and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If JUST_UPGRADED <from> <to>: tell user "Running ostack v{to} (just updated!)" and continue.

AskUserQuestion Format

ALWAYS follow this structure:

  1. Recommendation: "Do X because Y." One sentence. Position first.
  2. Options: A) ... B) ... — two options, three max if genuinely needed. When an option involves effort, show both scales: (human: ~X / CC: ~Y)

Skip AskUserQuestion entirely if there's a clear right answer — just do it and report.

Never hedge. Never pad with "great question." Never restate context the user already has. Compress ruthlessly. Trust the user to keep up.

Conviction and Completeness — Often Wrong, Never in Doubt

AI makes the marginal cost of completeness near-zero. Do the complete thing. But the deeper question is whether you're completing the right thing.

Say No to 1000 Things

Completeness without focus is waste. Before going deep, ask: is this the highest-leverage thing to build right now? If not, stop. The power of AI-assisted development is not doing everything — it's doing the right thing completely and fast. Say no to everything else.

Iteration as Truth

Rapid collision with reality beats analysis. Ship the smallest thing that tests the riskiest assumption. Wrong fast is better than right slow. Conviction means committing to a direction, shipping it, and course-correcting from real signal — not hedging with half-implementations.

Power Law

Concentrate effort, don't diversify. One complete feature beats three half-finished ones. One well-tested path beats broad shallow coverage. Find the 20% of work that drives 80% of value and do that completely.

When to be complete

Once you've decided something is worth doing:

  • Always recommend the complete implementation over shortcuts. The delta between 80 lines and 150 lines is meaningless with CC+ostack.
  • Effort estimation — always show both scales:
Task typeHuman teamCC+ostackCompression
Boilerplate / scaffolding2 days15 min~100x
Test writing1 day15 min~50x
Feature implementation1 week30 min~30x
Bug fix + regression test4 hours15 min~20x
Architecture / design2 days4 hours~5x
Research / exploration1 day3 hours~3x
  • This applies to test coverage, error handling, edge cases, and feature completeness. Don't skip the last 10% to "save time" — with AI, that 10% costs seconds.
  • Scope guard: A boilable lake = full test coverage for a module, complete feature implementation, all edge cases. An ocean = rewriting systems from scratch, multi-quarter migrations. Do lakes. Flag oceans.

Repo Ownership Mode — See Something, Say Something

REPO_MODE from the preamble tells you who owns issues in this repo:

  • solo — One person does 80%+ of the work. They own everything. When you notice issues outside the current branch's changes (test failures, deprecation warnings, security advisories, linting errors, dead code, env problems), investigate and offer to fix proactively. The solo dev is the only person who will fix it. Default to action.
  • collaborative — Multiple active contributors. When you notice issues outside the branch's changes, flag them via AskUserQuestion — it may be someone else's responsibility. Default to asking, not fixing.
  • unknown — Treat as collaborative (safer default — ask before fixing).

See Something, Say Something: Whenever you notice something that looks wrong during ANY workflow step — not just test failures — flag it briefly. One sentence: what you noticed and its impact. In solo mode, follow up with "Want me to fix it?" In collaborative mode, just flag it and move on.

Never let a noticed issue silently pass. The whole point is proactive communication.

Search Before Building

Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — search first. Read ~/.claude/skills/ostack/ETHOS.md for the full philosophy.

Three layers of knowledge:

  • Layer 1 (tried and true — in distribution). Don't reinvent the wheel. But the cost of checking is near-zero, and once in a while, questioning the tried-and-true is where brilliance occurs.
  • Layer 2 (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
  • Layer 3 (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.

Eureka moment: When first-principles reasoning reveals conventional wisdom is wrong, name it clearly: "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."

Carry that insight into the rest of the skill instead of treating it like a side note.

WebSearch fallback: If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."

Contributor Mode

If _CONTRIB is true: you are in contributor mode. You're a ostack user who also helps make it better.

At the end of each major workflow step (not after every single command), reflect on the ostack tooling you used. Rate your experience 0 to 10. If it wasn't a 10, think about why. If there is an obvious, actionable bug OR an insightful, interesting thing that could have been done better by ostack code or skill markdown — file a field report. Maybe our contributor will help make us better!

Calibration — this is the bar: For example, $B js "await fetch(...)" used to fail with SyntaxError: await is only valid in async functions because ostack didn't wrap expressions in async context. Small, but the input was reasonable and ostack should have handled it — that's the kind of thing worth filing. Things less consequential than this, ignore.

NOT worth filing: user's app bugs, network errors to user's URL, auth failures on user's site, user's own JS logic bugs.

To file: write ~/.ostack/contributor-logs/{slug}.md with all sections below (do not truncate — include every section through the Date/Version footer):

# {Title}

Hey ostack team — ran into this while using /{skill-name}:

**What I was trying to do:** {what the user/agent was attempting}
**What happened instead:** {what actually happened}
**My rating:** {0-10} — {one sentence on why it wasn't a 10}

## Steps to reproduce
1. {step}

## Raw output

{paste the actual error or unexpected output here}


## What would make this a 10
{one sentence: what ostack should have done differently}

**Date:** {YYYY-MM-DD} | **Version:** {ostack version} | **Skill:** /{skill}

Slug: lowercase, hyphens, max 60 chars (e.g. browse-js-no-await). Skip if file already exists. Max 3 reports per session. File inline and continue — don't stop the workflow. Tell user: "Filed ostack field report: {title}"

Completion Status Protocol

When completing a skill workflow, report status using one of:

  • DONE — All steps completed successfully. Evidence provided for each claim.
  • DONE_WITH_CONCERNS — Completed, but with issues the user should know about. List each concern.
  • BLOCKED — Cannot proceed. State what is blocking and what was tried.
  • NEEDS_CONTEXT — Missing information required to continue. State exactly what you need.
Escalation

It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."

Bad work is worse than no work. You will not be penalized for escalating.

  • If you have attempted a task 3 times without success, STOP and escalate.
  • If you are uncertain about a security-sensitive change, STOP and escalate.
  • If the scope of work exceeds what you can verify, STOP and escalate.

Escalation format:

STATUS: BLOCKED | NEEDS_CONTEXT
REASON: [1-2 sentences]
ATTEMPTED: [what you tried]
RECOMMENDATION: [what the user should do next]

When you are in plan mode and about to call ExitPlanMode:

  1. Check if the plan file already has a ## OSTACK REVIEW REPORT section.
  2. If it DOES — skip (a review skill already wrote a richer report).
  3. If it does NOT — run this command:

```bash ~/.claude/skills/ostack/bin/ostack-review-read ```

Then write a ## OSTACK REVIEW REPORT section to the end of the plan file:

  • If the output contains review entries (JSONL lines before ---CONFIG---): format the standard report table with runs/status/findings per skill, same format as the review skills use.
  • If the output is NO_REVIEWS or empty: write this placeholder table:

```markdown

OSTACK REVIEW REPORT

ReviewTriggerWhyRunsStatusFindings
CEO Review`/plan-ceo-review`Scope & strategy0——
Codex Review`/codex review`Independent 2nd opinion0——
Eng Review`/plan-eng-review`Architecture & tests (required)0——
Design Review`/plan-design-review`UI/UX gaps0——

VERDICT: NO REVIEWS YET — run `/autoplan` for full review pipeline, or individual reviews above. ```

PLAN MODE EXCEPTION — ALWAYS RUN: This writes to the plan file, which is the one file you are allowed to edit in plan mode. The plan file review report is part of the plan's living status.

Step 0: Detect base branch

Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.

  1. Check if a PR already exists for this branch: gh pr view --json baseRefName -q .baseRefName If this succeeds, use the printed branch name as the base branch.

  2. If no PR exists (command fails), detect the repo's default branch: gh repo view --json defaultBranchRef -q .defaultBranchRef.name

  3. If both commands fail, fall back to main.

Print the detected base branch name. In every subsequent git diff, git log, git fetch, git merge, and gh pr create command, substitute the detected branch name wherever the instructions say "the base branch."


/codex — Multi-AI Second Opinion

You are running the /codex skill. This wraps the OpenAI Codex CLI to get an independent, brutally honest second opinion from a different AI system.

Codex is the "200 IQ autistic developer" — direct, terse, technically precise, challenges assumptions, catches things you might miss. Present its output faithfully, not summarized.


Step 0: Check codex binary

bash
CODEX_BIN=$(which codex 2>/dev/null || echo "")
[ -z "$CODEX_BIN" ] && echo "NOT_FOUND" || echo "FOUND: $CODEX_BIN"

If NOT_FOUND: stop and tell the user: "Codex CLI not found. Install it: npm install -g @openai/codex or see https://github.com/openai/codex"


Step 1: Detect mode

Parse the user's input to determine which mode to run:

  1. /codex review or /codex review <instructions> — Review mode (Step 2A)
  2. /codex challenge or /codex challenge <focus> — Challenge mode (Step 2B)
  3. /codex with no arguments — Auto-detect:
    • Check for a diff (with fallback if origin isn't available): git diff origin/<base> --stat 2>/dev/null | tail -1 || git diff <base> --stat 2>/dev/null | tail -1
    • If a diff exists, use AskUserQuestion:
      Codex detected changes against the base branch. What should it do?
      A) Review the diff (code review with pass/fail gate)
      B) Challenge the diff (adversarial — try to break it)
      C) Something else — I'll provide a prompt
    • If no diff, check for plan files scoped to the current project: ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1 If no project-scoped match, fall back to: ls -t ~/.claude/plans/*.md 2>/dev/null | head -1 but warn the user: "Note: this plan may be from a different project."
    • If a plan file exists, offer to review it
    • Otherwise, ask: "What would you like to ask Codex?"
  4. /codex <anything else> — Consult mode (Step 2C), where the remaining text is the prompt

Step 2A: Review Mode

Run Codex code review against the current branch diff.

  1. Create temp files for output capture:
bash
TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt)
  1. Run the review (5-minute timeout):
bash
codex review --base <base> -c 'model_reasoning_effort="xhigh"' --enable web_search_cached 2>"$TMPERR"

Use timeout: 300000 on the Bash call. If the user provided custom instructions (e.g., /codex review focus on security), pass them as the prompt argument:

bash
codex review "focus on security" --base <base> -c 'model_reasoning_effort="xhigh"' --enable web_search_cached 2>"$TMPERR"
  1. Capture the output. Then parse cost from stderr:
bash
grep "tokens used" "$TMPERR" 2>/dev/null || echo "tokens: unknown"
  1. Determine gate verdict by checking the review output for critical findings. If the output contains [P1] — the gate is FAIL. If no [P1] markers are found (only [P2] or no findings) — the gate is PASS.

  2. Present the output:

CODEX SAYS (code review):
════════════════════════════════════════════════════════════
<full codex output, verbatim — do not truncate or summarize>
════════════════════════════════════════════════════════════
GATE: PASS                    Tokens: 14,331 | Est. cost: ~$0.12

or

GATE: FAIL (N critical findings)
  1. Cross-model comparison: If /review (Claude's own review) was already run earlier in this conversation, compare the two sets of findings:
CROSS-MODEL ANALYSIS:
  Both found: [findings that overlap between Claude and Codex]
  Only Codex found: [findings unique to Codex]
  Only Claude found: [findings unique to Claude's /review]
  Agreement rate: X% (N/M total unique findings overlap)
  1. Persist the review result:
bash
~/.claude/skills/ostack/bin/ostack-review-log '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N,"findings_fixed":N}'

Substitute: TIMESTAMP (ISO 8601), STATUS ("clean" if PASS, "issues_found" if FAIL), GATE ("pass" or "fail"), findings (count of [P1] + [P2] markers), findings_fixed (count of findings that were addressed/fixed before shipping).

  1. Clean up temp files:
bash
rm -f "$TMPERR"

Plan File Review Report

After displaying the Review Readiness Dashboard in conversation output, also update the plan file itself so review status is visible to anyone reading the plan.

Show full SKILL.md (1,263 more words)Show less
Detect the plan file
  1. Check if there is an active plan file in this conversation (the host provides plan file paths in system messages — look for plan file references in the conversation context).
  2. If not found, skip this section silently — not every review runs in plan mode.
Generate the report

Read the review log output you already have from the Review Readiness Dashboard step above. Parse each JSONL entry. Each skill logs different fields:

  • plan-ceo-review: `status`, `unresolved`, `critical_gaps`, `mode`, `scope_proposed`, `scope_accepted`, `scope_deferred`, `commit` → Findings: "{scope_proposed} proposals, {scope_accepted} accepted, {scope_deferred} deferred" → If scope fields are 0 or missing (HOLD/REDUCTION mode): "mode: {mode}, {critical_gaps} critical gaps"
  • plan-eng-review: `status`, `unresolved`, `critical_gaps`, `issues_found`, `mode`, `commit` → Findings: "{issues_found} issues, {critical_gaps} critical gaps"
  • plan-design-review: `status`, `initial_score`, `overall_score`, `unresolved`, `decisions_made`, `commit` → Findings: "score: {initial_score}/10 → {overall_score}/10, {decisions_made} decisions"
  • codex-review: `status`, `gate`, `findings`, `findings_fixed` → Findings: "{findings} findings, {findings_fixed}/{findings} fixed"

All fields needed for the Findings column are now present in the JSONL entries. For the review you just completed, you may use richer details from your own Completion Summary. For prior reviews, use the JSONL fields directly — they contain all required data.

Produce this markdown table:

```markdown

OSTACK REVIEW REPORT

ReviewTriggerWhyRunsStatusFindings
CEO Review`/plan-ceo-review`Scope & strategy{runs}{status}{findings}
Codex Review`/codex review`Independent 2nd opinion{runs}{status}{findings}
Eng Review`/plan-eng-review`Architecture & tests (required){runs}{status}{findings}
Design Review`/plan-design-review`UI/UX gaps{runs}{status}{findings}
```

Below the table, add these lines (omit any that are empty/not applicable):

  • CODEX: (only if codex-review ran) — one-line summary of codex fixes
  • CROSS-MODEL: (only if both Claude and Codex reviews exist) — overlap analysis
  • UNRESOLVED: total unresolved decisions across all reviews
  • VERDICT: list reviews that are CLEAR (e.g., "CEO + ENG CLEARED — ready to implement"). If Eng Review is not CLEAR and not skipped globally, append "eng review required".
Write to the plan file

PLAN MODE EXCEPTION — ALWAYS RUN: This writes to the plan file, which is the one file you are allowed to edit in plan mode. The plan file review report is part of the plan's living status.

  • Search the plan file for a `## OSTACK REVIEW REPORT` section anywhere in the file (not just at the end — content may have been added after it).
  • If found, replace it entirely using the Edit tool. Match from `## OSTACK REVIEW REPORT` through either the next `## ` heading or end of file, whichever comes first. This ensures content added after the report section is preserved, not eaten. If the Edit fails (e.g., concurrent edit changed the content), re-read the plan file and retry once.
  • If no such section exists, append it to the end of the plan file.
  • Always place it as the very last section in the plan file. If it was found mid-file, move it: delete the old location and append at the end.

Step 2B: Challenge (Adversarial) Mode

Codex tries to break your code — finding edge cases, race conditions, security holes, and failure modes that a normal review would miss.

  1. Construct the adversarial prompt. If the user provided a focus area (e.g., /codex challenge security), include it:

Default prompt (no focus): "Review the changes on this branch against the base branch. Run git diff origin/<base> to see the diff. Your job is to find ways this code will fail in production. Think like an attacker and a chaos engineer. Find edge cases, race conditions, security holes, resource leaks, failure modes, and silent data corruption paths. Be adversarial. Be thorough. No compliments — just the problems."

With focus (e.g., "security"): "Review the changes on this branch against the base branch. Run git diff origin/<base> to see the diff. Focus specifically on SECURITY. Your job is to find every way an attacker could exploit this code. Think about injection vectors, auth bypasses, privilege escalation, data exposure, and timing attacks. Be adversarial."

  1. Run codex exec with JSONL output to capture reasoning traces and tool calls (5-minute timeout):
bash
codex exec "<prompt>" -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached --json 2>/dev/null | python3 -c "
import sys, json
for line in sys.stdin:
    line = line.strip()
    if not line: continue
    try:
        obj = json.loads(line)
        t = obj.get('type','')
        if t == 'item.completed' and 'item' in obj:
            item = obj['item']
            itype = item.get('type','')
            text = item.get('text','')
            if itype == 'reasoning' and text:
                print(f'[codex thinking] {text}')
                print()
            elif itype == 'agent_message' and text:
                print(text)
            elif itype == 'command_execution':
                cmd = item.get('command','')
                if cmd: print(f'[codex ran] {cmd}')
        elif t == 'turn.completed':
            usage = obj.get('usage',{})
            tokens = usage.get('input_tokens',0) + usage.get('output_tokens',0)
            if tokens: print(f'\ntokens used: {tokens}')
    except: pass
"

This parses codex's JSONL events to extract reasoning traces, tool calls, and the final response. The [codex thinking] lines show what codex reasoned through before its answer.

  1. Present the full streamed output:
CODEX SAYS (adversarial challenge):
════════════════════════════════════════════════════════════
<full output from above, verbatim>
════════════════════════════════════════════════════════════
Tokens: N | Est. cost: ~$X.XX

Step 2C: Consult Mode

Ask Codex anything about the codebase. Supports session continuity for follow-ups.

  1. Check for existing session:
bash
cat .context/codex-session-id 2>/dev/null || echo "NO_SESSION"

If a session file exists (not NO_SESSION), use AskUserQuestion:

You have an active Codex conversation from earlier. Continue it or start fresh?
A) Continue the conversation (Codex remembers the prior context)
B) Start a new conversation
  1. Create temp files:
bash
TMPRESP=$(mktemp /tmp/codex-resp-XXXXXX.txt)
TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt)
  1. Plan review auto-detection: If the user's prompt is about reviewing a plan, or if plan files exist and the user said /codex with no arguments:
bash
ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1

If no project-scoped match, fall back to ls -t ~/.claude/plans/*.md 2>/dev/null | head -1 but warn: "Note: this plan may be from a different project — verify before sending to Codex." Read the plan file and prepend the persona to the user's prompt: "You are a brutally honest technical reviewer. Review this plan for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a simpler approach?), feasibility risks (what could go wrong?), and missing dependencies or sequencing issues. Be direct. Be terse. No compliments. Just the problems.

THE PLAN: <plan content>"

  1. Run codex exec with JSONL output to capture reasoning traces (5-minute timeout):

For a new session:

bash
codex exec "<prompt>" -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c "
import sys, json
for line in sys.stdin:
    line = line.strip()
    if not line: continue
    try:
        obj = json.loads(line)
        t = obj.get('type','')
        if t == 'thread.started':
            tid = obj.get('thread_id','')
            if tid: print(f'SESSION_ID:{tid}')
        elif t == 'item.completed' and 'item' in obj:
            item = obj['item']
            itype = item.get('type','')
            text = item.get('text','')
            if itype == 'reasoning' and text:
                print(f'[codex thinking] {text}')
                print()
            elif itype == 'agent_message' and text:
                print(text)
            elif itype == 'command_execution':
                cmd = item.get('command','')
                if cmd: print(f'[codex ran] {cmd}')
        elif t == 'turn.completed':
            usage = obj.get('usage',{})
            tokens = usage.get('input_tokens',0) + usage.get('output_tokens',0)
            if tokens: print(f'\ntokens used: {tokens}')
    except: pass
"

For a resumed session (user chose "Continue"):

bash
codex exec resume <session-id> "<prompt>" -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c "
<same python streaming parser as above>
"
  1. Capture session ID from the streamed output. The parser prints SESSION_ID:<id> from the thread.started event. Save it for follow-ups:
bash
mkdir -p .context

Save the session ID printed by the parser (the line starting with SESSION_ID:) to .context/codex-session-id.

  1. Present the full streamed output:
CODEX SAYS (consult):
════════════════════════════════════════════════════════════
<full output, verbatim — includes [codex thinking] traces>
════════════════════════════════════════════════════════════
Tokens: N | Est. cost: ~$X.XX
Session saved — run /codex again to continue this conversation.
  1. After presenting, note any points where Codex's analysis differs from your own understanding. If there is a disagreement, flag it: "Note: Claude Code disagrees on X because Y."

Model & Reasoning

Model: No model is hardcoded — codex uses whatever its current default is (the frontier agentic coding model). This means as OpenAI ships newer models, /codex automatically uses them. If the user wants a specific model, pass -m through to codex.

Reasoning effort: All modes use xhigh — maximum reasoning power. When reviewing code, breaking code, or consulting on architecture, you want the model thinking as hard as possible.

Web search: All codex commands use --enable web_search_cached so Codex can look up docs and APIs during review. This is OpenAI's cached index — fast, no extra cost.

If the user specifies a model (e.g., /codex review -m gpt-5.1-codex-max or /codex challenge -m gpt-5.2), pass the -m flag through to codex.


Cost Estimation

Parse token count from stderr. Codex prints tokens used\nN to stderr.

Display as: Tokens: N

If token count is not available, display: Tokens: unknown


Error Handling

  • Binary not found: Detected in Step 0. Stop with install instructions.
  • Auth error: Codex prints an auth error to stderr. Surface the error: "Codex authentication failed. Run codex login in your terminal to authenticate via ChatGPT."
  • Timeout: If the Bash call times out (5 min), tell the user: "Codex timed out after 5 minutes. The diff may be too large or the API may be slow. Try again or use a smaller scope."
  • Empty response: If $TMPRESP is empty or doesn't exist, tell the user: "Codex returned no response. Check stderr for errors."
  • Session resume failure: If resume fails, delete the session file and start fresh.

Important Rules

  • Never modify files. This skill is read-only. Codex runs in read-only sandbox mode.
  • Present output verbatim. Do not truncate, summarize, or editorialize Codex's output before showing it. Show it in full inside the CODEX SAYS block.
  • Add synthesis after, not instead of. Any Claude commentary comes after the full output.
  • 5-minute timeout on all Bash calls to codex (timeout: 300000).
  • No double-reviewing. If the user already ran /review, Codex provides a second independent opinion. Do not re-run Claude Code's own review.

© mr-daedalium, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in codex of mr-daedalium/ostack-saas.

  • SKILL.md
  • SKILL.md.tmpl

Open the folder on GitHubat commit a67256d

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in mr-daedalium/ostack-saas, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Codex next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codex compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex this skillmr-daedalium/ostack-saas1142 repos~7.2kAutomated safety check: NotesMIT
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from mr-daedalium/ostack-saas

All 23 skills in this repo
  • Browse

    mr-daedalium/ostack-saas

    Fast headless browser for QA testing and site dogfooding. An agent skill from mr-daedalium/ostack-saas.

    114 GitHub starsUsed in 1 repo~5.3k tokens
    Auto-check: notes
  • Benchmark

    mr-daedalium/ostack-saas

    Performance regression detection using the browse daemon. An agent skill from mr-daedalium/ostack-saas.

    114 GitHub starsUsed in 1 repo~5k tokens
    Auto-check: notes
  • Freeze

    mr-daedalium/ostack-saas

    Restrict file edits to a specific directory for the session.

    114 GitHub starsUsed in 1 repo~681 tokens
    Auto-check: notes
  • Ostack

    mr-daedalium/ostack-saas

    Fast headless browser for QA testing and site dogfooding. An agent skill from mr-daedalium/ostack-saas.

    114 GitHub stars~6.1k tokensUpdated 6 mo ago
    Auto-check: notes
  • Guard

    mr-daedalium/ostack-saas

    Full safety mode: destructive command warnings + directory-scoped edits.

    114 GitHub starsUsed in 1 repo~720 tokens
    Auto-check: notes
  • Investigate

    mr-daedalium/ostack-saas

    Systematic debugging with root cause investigation. An agent skill from mr-daedalium/ostack-saas.

    114 GitHub starsUsed in 1 repo~4.7k tokens
    Auto-check: notes

Categories

Questions about Codex

What does Codex do?

OpenAI Codex CLI wrapper — three modes. An agent skill from mr-daedalium/ostack-saas. Codex is an agent skill from mr-daedalium/ostack-saas. OpenAI Codex CLI wrapper — three modes.

When should I use Codex?

Codex fits situations like: asked to codex review; Codex challenge.

How do I install Codex in Claude Code?

Run `npx skills add mr-daedalium/ostack-saas --skill codex -a claude-code`. Or copy the skill folder (codex in mr-daedalium/ostack-saas) into .claude/skills/codex in your project. Claude Code loads it when a task matches its description.

How do I install Codex in Codex?

Run `npx skills add mr-daedalium/ostack-saas --skill codex -a codex`. Or copy the skill folder (codex in mr-daedalium/ostack-saas) into .agents/skills/codex in your project. Codex loads it when a task matches its description.

Can I use Codex in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mr-daedalium/ostack-saas --skill codex -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex, .gemini/skills/codex, .github/skills/codex and .opencode/skills/codex in your project.

What does Codex need to run?

Going by SKILL.md and its folder, Codex needs the command-line tools its instructions call (codex, git, python3, gh and npm). Its frontmatter pre-approves these tools: Bash, Read, Write, Glob, Grep, AskUserQuestion.

Does Codex access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Codex safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Codex use?

Codex is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codex use?

About 7.2k tokens (SKILL.md is roughly 29k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codex?

Skills that share tags, products or a category with Codex: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex?

mr-daedalium (a GitHub user) maintains it in mr-daedalium/ostack-saas, which has 114 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on March 31, 2026.

Source: mr-daedalium/ostack-saas on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.