# Ask Codex

> Get an independent opinion from OpenAI Codex CLI (GPT 5.4 model) on a design decision, code review, or debugging hypothesis. Use when you want a second opinion from a different model, need to challenge your own approach, or want to validate a fix before committing. Triggers: "ask codex", "get codex opinion", "what does codex think", "second opinion", or when /ask-council invokes it.

- Skill: `smithery-ai/ask-codex` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add smithery-ai/ask-codex`
- Raw SKILL.md: https://api.skillmd.com/api/skills/smithery-ai/ask-codex/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: smithery-ai (https://skillmd.com/u/smithery-ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/smithery-ai/ask-codex

---


# Ask Codex

Get an independent opinion from the Codex CLI (`codex exec`) which runs OpenAI's GPT 5.4 model.

## When to use

- Validating a fix or design decision before committing
- Getting a contrarian view from a different model
- When `/ask-council` needs an external model's perspective

## How to invoke

```bash
cd <relevant-repo-root> && codex exec --skip-git-repo-check \
  -c 'sandbox_permissions=["disk-full-read-access"]' \
  "<prompt>"
```

### Key flags

| Flag | Purpose |
|------|---------|
| `--skip-git-repo-check` | Run without requiring a git repo (always include) |
| `-c 'sandbox_permissions=["disk-full-read-access"]'` | Let Codex read the codebase (required) |
| `-m <model>` | Override model (default: gpt-5.4) |

### Prompt guidelines

- Tell Codex to **read specific files** — it has disk access and will read them itself
- Be opinionated in framing: "Which would you ship and why?" not "What do you think?"
- Include labeled options (A, B, C...) with brief pros/cons
- Ask for a **ranked recommendation**
- Keep prompt under ~500 words

### Example

```bash
codex exec --skip-git-repo-check -c 'sandbox_permissions=["disk-full-read-access"]' \
  "Read src/lib/keychain.ts and src/lib/lazy-import.ts. I'm deciding between:
   A) bare import() — simple but loses install prompt
   B) { optional: true } flag on lazyImport
   C) split into lazyImport + tryImport
   Which would you ship and why?"
```

### Resuming sessions

Each `codex exec` run prints a `session id: <uuid>` line in its output header. To capture it and resume later:

```bash
# Capture output and extract session ID
OUTPUT=$(codex exec --skip-git-repo-check -c 'sandbox_permissions=["disk-full-read-access"]' "your prompt" 2>&1)
SESSION_ID=$(echo "$OUTPUT" | grep 'session id:' | awk '{print $NF}')
echo "$OUTPUT"

# Resume that session with a follow-up
codex exec resume "$SESSION_ID" --skip-git-repo-check \
  -c 'sandbox_permissions=["disk-full-read-access"]' \
  "Follow-up prompt here"

# Or just resume the most recent session (no ID needed)
codex exec resume --last --skip-git-repo-check \
  -c 'sandbox_permissions=["disk-full-read-access"]' \
  "Follow-up prompt here"
```

In practice, `--last` is the simplest option since Claude typically resumes the session it just ran.

### Caveats

- Codex runs in a sandbox — it can read files but won't modify them
- Allow 2-3 minutes timeout (`timeout: 180000`)
- Use `2>&1 | tail -120` to capture output — Codex prints tool calls before its final opinion
- If not installed: `npm install -g @openai/codex`

