/ask-codex
Consult OpenAI Codex for investigation, debugging, or code review. Use when user explicitly asks to "ask codex", "check with codex", "codex review", or as a last resort when stuck after 4+ failed attempts at debugging, investigation, or bug fix and completely out of ideas. Codex
Claude Code
$ npx -y skills add umputun/cc-thingz --skill ask-codex --agent claude-code
Codex
$ npx skills add umputun/cc-thingz --skill ask-codex -a codex -y
Cursor
$ npx skills add umputun/cc-thingz --skill ask-codex -a cursor -y
Gemini CLI
$ npx skills add umputun/cc-thingz --skill ask-codex -a gemini-cli -y
GitHub Copilot
$ npx skills add umputun/cc-thingz --skill ask-codex -a github-copilot -y
OpenCode
$ npx skills add umputun/cc-thingz --skill ask-codex -a opencode -y
Windsurf
$ npx skills add umputun/cc-thingz --skill ask-codex -a windsurf -y
SKILL.md
ask-codex.SKILL.mdname: ask-codex
description: Consult OpenAI Codex for investigation, debugging, or code review. Use when user explicitly asks to "ask codex", "check with codex", "codex review", or as a last resort when stuck after 4+ failed attempts at debugging, investigation, or bug fix and completely out of ideas. Codex is slow (2-5 min), so only escalate when truly stuck. Codex runs in read-only mode with full project access — it analyzes, we implement.
allowed-tools: Bash, Read, Grep, Glob
Ask Codex
Consult OpenAI Codex as a second opinion for investigation, debugging, or review tasks.
Activation Triggers
**Explicit:**
- "ask codex", "check with codex", "codex review"
- "what does codex think", "get codex opinion"
- "consult codex", "run codex on this"
**Automatic (last resort — stuck detection):**
- 4+ failed attempts at the same bug fix or investigation
- completely out of ideas, all reasonable approaches exhausted
- going in circles with no progress despite multiple different strategies
Workflow
Step 1: Check Availability
Run `which codex` to verify the CLI is installed. If not found, inform the user and stop.
Step 2: Build Context
Gather context from the current conversation:
1. **What's the problem/question** — summarize in 2-3 sentences 2. **What we know** — relevant files, error messages, behavior observed 3. **What we tried** — approaches attempted and why they failed (if applicable) 4. **Specific question** — what exactly codex should analyze or answer
Codex does NOT auto-load Claude Code's memory files — it only reads `AGENTS.md`. To give Codex the same project context Claude follows, prepend the memory-load preamble described in Step 3.
Step 3: Construct Prompt
Build a focused prompt. Do NOT dump entire files — codex has full project access and can read them itself. Provide file paths and line references so codex knows where to look.
**Prepend a memory-load preamble.** Codex auto-loads only `AGENTS.md`; it does NOT read Claude Code's memory files (`CLAUDE.md`, `CLAUDE.local.md`, `.claude/rules/`, `~/.claude/CLAUDE.md`), so the project conventions Claude follows are invisible to Codex unless you tell it to read them. Prepend this line to the prompt:
First read these project guidance files if present: <ABS_HOME>/.claude/CLAUDE.md, CLAUDE.md, CLAUDE.local.md, .claude/rules/
- Resolve `<ABS_HOME>` to the **absolute** home path (run `echo $HOME`, e.g. `/home/<user>`) and write the literal path — do NOT leave the string `$HOME` in the prompt. Whether `$HOME` expands depends on how the prompt is passed to Codex, and Codex may open the file with a non-shell tool that never expands it, so only a literal absolute path is reliable.
- No `@` prefix — `@file` is inert in `codex exec` (literal text, not an import).
- The project-relative paths resolve against Codex's working directory; Codex skips any that don't exist.
**Template for investigation/debug:**
# [Investigation/Debug] Request
## Problem
[2-3 sentence description]
## Context
- Files: [path/to/file.go:lineNumber, ...]
- Observed: [what's happening]
- Expected: [what should happen]
## What We Tried
[List approaches and outcomes, or "First consultation" if fresh question]
## Question
[Specific, focused question for codex to answer]
Provide:
1. Root cause analysis (if debugging)
2. Concrete recommendation with file:line references
3. Why previous approaches failed (if applicable)
Keep response focused and actionable.
**Template for code review (adversarial):**
When asked for a code review, use this adversarial prompt that requires structured JSON output:
<role>
You are performing an adversarial code review.
Your job is to break confidence in the change, not to validate it.
</role>
<task>
Review the provided changes as if you are trying to find the strongest reasons
this change should not ship yet.
Scope: [files and changes to review — paths, branch diff, or description]
Focus: [specific area if user specified one, otherwise "general"]
</task>
<operating_stance>
Default to skepticism.
Assume the change can fail in subtle, high-cost, or user-visible ways until
the evidence says otherwise. Do not give credit for good intent or partial fixes.
If something only works on the happy path, treat that as a real weakness.
</operating_stance>
<attack_surfaces>
Prioritize failures that are expensive, dangerous, or hard to detect:
- auth, permissions, tenant isolation, and trust boundaries
- data loss, corruption, duplication, and irreversible state changes
- rollback safety, retries, partial failure, and idempotency gaps
- race conditions, ordering assumptions, stale state, and re-entrancy
- empty-state, nil, timeout, and degraded dependency behavior
- version skew, schema drift, migration hazards, and compatibility regressions
- observability gaps that would hide failure or make recovery harder
</attack_surfaces>
<finding_bar>
Report only material findings. No style feedback, naming nitpicks, or speculative
concerns without evidence. Each finding must answer:
1. What can go wrong?
2. Why is this code path vulnerable?
3. What is the likely impact?
4. What concrete change would reduce the risk?
Prefer one strong finding over several weak ones.
</finding_bar>
<grounding_rules>
Every finding must be defensible from actual code you can see.
Do not invent files, lines, code paths, or runtime behavior you cannot support.
If a conclusion depends on an inference, state that explicitly and keep the
confidence score honest.
</grounding_rules>
<structured_output>
Return ONLY valid JSON. Example with concrete values:
{
"verdict": "needs-attention",
"summary": "auth middleware skips token validation on retry paths",
"findings": [
{
"severity": "high",
"title": "token validation bypassed on retry",
"body": "retryHandler re-enters serveHTTP without revalidating the bearer token, allowing expired tokens through on transient failures",
"file": "internal/auth/mRead more
name: ask-codex description: Consult OpenAI Codex for investigation, debugging, or code review. Use when user explicitly asks to "ask codex", "check with codex", "codex review", or as a last resort when stuck after 4+ failed attempts at debugging, investigation, or bug fix and completely out of ideas. Codex is slow (2-5 min), so only escalate when truly stuck. Codex runs in read-only mode with full project access — it analyzes, we implement. allowed-tools: Bash, Read, Grep, Glob
Ask Codex
Consult OpenAI Codex as a second opinion for investigation, debugging, or review tasks.
Activation Triggers
**Explicit:**
- "ask codex", "check with codex", "codex review"
- "what does codex think", "get codex opinion"
- "consult codex", "run codex on this"
**Automatic (last resort — stuck detection):**
- 4+ failed attempts at the same bug fix or investigation
- completely out of ideas, all reasonable approaches exhausted
- going in circles with no progress despite multiple different strategies
Workflow
Step 1: Check Availability
Run `which codex` to verify the CLI is installed. If not found, inform the user and stop.
Step 2: Build Context
Gather context from the current conversation:
1. **What's the problem/question** — summarize in 2-3 sentences 2. **What we know** — relevant files, error messages, behavior observed 3. **What we tried** — approaches attempted and why they failed (if applicable) 4. **Specific question** — what exactly codex should analyze or answer
Codex does NOT auto-load Claude Code's memory files — it only reads `AGENTS.md`. To give Codex the same project context Claude follows, prepend the memory-load preamble described in Step 3.
Step 3: Construct Prompt
Build a focused prompt. Do NOT dump entire files — codex has full project access and can read them itself. Provide file paths and line references so codex knows where to look.
**Prepend a memory-load preamble.** Codex auto-loads only `AGENTS.md`; it does NOT read Claude Code's memory files (`CLAUDE.md`, `CLAUDE.local.md`, `.claude/rules/`, `~/.claude/CLAUDE.md`), so the project conventions Claude follows are invisible to Codex unless you tell it to read them. Prepend this line to the prompt:
First read these project guidance files if present: <ABS_HOME>/.claude/CLAUDE.md, CLAUDE.md, CLAUDE.local.md, .claude/rules/
- Resolve `<ABS_HOME>` to the **absolute** home path (run `echo $HOME`, e.g. `/home/<user>`) and write the literal path — do NOT leave the string `$HOME` in the prompt. Whether `$HOME` expands depends on how the prompt is passed to Codex, and Codex may open the file with a non-shell tool that never expands it, so only a literal absolute path is reliable.
- No `@` prefix — `@file` is inert in `codex exec` (literal text, not an import).
- The project-relative paths resolve against Codex's working directory; Codex skips any that don't exist.
**Template for investigation/debug:**
# [Investigation/Debug] Request ## Problem [2-3 sentence description] ## Context - Files: [path/to/file.go:lineNumber, ...] - Observed: [what's happening] - Expected: [what should happen] ## What We Tried [List approaches and outcomes, or "First consultation" if fresh question] ## Question [Specific, focused question for codex to answer] Provide: 1. Root cause analysis (if debugging) 2. Concrete recommendation with file:line references 3. Why previous approaches failed (if applicable) Keep response focused and actionable.
**Template for code review (adversarial):**
When asked for a code review, use this adversarial prompt that requires structured JSON output:
<role>
You are performing an adversarial code review.
Your job is to break confidence in the change, not to validate it.
</role>
<task>
Review the provided changes as if you are trying to find the strongest reasons
this change should not ship yet.
Scope: [files and changes to review — paths, branch diff, or description]
Focus: [specific area if user specified one, otherwise "general"]
</task>
<operating_stance>
Default to skepticism.
Assume the change can fail in subtle, high-cost, or user-visible ways until
the evidence says otherwise. Do not give credit for good intent or partial fixes.
If something only works on the happy path, treat that as a real weakness.
</operating_stance>
<attack_surfaces>
Prioritize failures that are expensive, dangerous, or hard to detect:
- auth, permissions, tenant isolation, and trust boundaries
- data loss, corruption, duplication, and irreversible state changes
- rollback safety, retries, partial failure, and idempotency gaps
- race conditions, ordering assumptions, stale state, and re-entrancy
- empty-state, nil, timeout, and degraded dependency behavior
- version skew, schema drift, migration hazards, and compatibility regressions
- observability gaps that would hide failure or make recovery harder
</attack_surfaces>
<finding_bar>
Report only material findings. No style feedback, naming nitpicks, or speculative
concerns without evidence. Each finding must answer:
1. What can go wrong?
2. Why is this code path vulnerable?
3. What is the likely impact?
4. What concrete change would reduce the risk?
Prefer one strong finding over several weak ones.
</finding_bar>
<grounding_rules>
Every finding must be defensible from actual code you can see.
Do not invent files, lines, code paths, or runtime behavior you cannot support.
If a conclusion depends on an inference, state that explicitly and keep the
confidence score honest.
</grounding_rules>
<structured_output>
Return ONLY valid JSON. Example with concrete values:
{
"verdict": "needs-attention",
"summary": "auth middleware skips token validation on retry paths",
"findings": [
{
"severity": "high",
"title": "token validation bypassed on retry",
"body": "retryHandler re-enters serveHTTP without revalidating the bearer token, allowing expired tokens through on transient failures",
"file": "internal/auth/mThings to make Claude Code even better — hooks, skills, and commands, organized as a marketplace of independent plugins. This is an unapologetically opinionated set.
Other skills on cc-thingz.
More skills from other plugins.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Questions about ask-codex.
- Which coding agents can use ask-codex?
- ask-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.

