Consult Claude for questions, feedback, reviews, or discussions. Use when Codex needs a second opinion, wants to validate an approach, or the user explicitly calls /ask-claude.
Consult Claude for questions, feedback, reviews, or discussions. The conversation iterates until Claude signals completion (e.g., "LGTM" for reviews, or a complete answer for questions) or until 10 rounds are reached.
| Mode | When to use | Input source |
|---|---|---|
| Question | Need an answer or explanation | User question + context |
| Discussion | Explore ideas or trade-offs | Topic + relevant context |
| Plan review | Validate a plan before execution | Plan file (plan-*.md) or text |
| Change review | Validate code changes | git diff + untracked files |
| Custom | Any time | User-specified content |
Determine the consultation mode
~/.codex/plans/plan-*.md exists, default to plan review (even if there are uncommitted changes).git status --porcelain is non-empty), default to change review.Collect the content
~/.codex/plans/plan-*.md (use the most recently modified if multiple exist) or ask the user for the plan.# Tracked changes (staged + unstaged)
# Use fallback for repos without commits
if git rev-parse --verify HEAD >/dev/null 2>&1; then
git diff HEAD
else
git diff --cached
git diff
fi
# Untracked files - safe handling for special characters
# Skip binary files and files larger than 100KB
git ls-files -z --others --exclude-standard | while IFS= read -r -d '' f; do
# Skip binary files (use -- to handle filenames starting with -)
if file -- "$f" | grep -q 'text'; then
# Skip files larger than 100KB
size=$(stat -f%z -- "$f" 2>/dev/null || stat -c%s -- "$f" 2>/dev/null)
if [ "$size" -lt 102400 ]; then
echo "=== New file: $f ==="
cat -- "$f"
else
echo "=== New file: $f (skipped: >100KB) ==="
fi
else
echo "=== New file: $f (skipped: binary) ==="
fi
done
Prepare the plans directory
mkdir -p ~/.codex/plans to ensure the directory exists.Write the consultation input file
~/.codex/plans/consultation-input.md with this format:
## Original Request
<original user prompt>
## Consultation Mode
<question | discussion | plan review | change review | custom>
## Content
<question, topic, plan, diff + untracked files, or custom content>
## Task
<varies by mode>
- Question: Answer the question. When complete, output "ANSWERED" on its own line.
- Discussion: Explore the topic. When a conclusion or actionable insight is reached, output "CONCLUDED" on its own line.
- Plan review / Change review: Review the content. If there are problems, describe them. If OK, output "LGTM" on its own line.
- Custom: Address the request. When complete, output "DONE" on its own line.
Run Claude
cat ~/.codex/plans/consultation-input.md | claude -p - --output-format textParse the result
Evaluate the response (questioner's perspective)
Iteration loop
Finish
This skill is automatically invoked when:
Note: For ad-hoc consultations at any point, use /ask-claude manually.
# Basic invocation with piped input
cat ~/.codex/plans/consultation-input.md | claude -p - --output-format text
# Alternative: direct prompt (for shorter content)
claude -p "<prompt>" --output-format text
--dangerously-skip-permissions for safety.--output-format text to get plain text output for parsing.plan-*.md to distinguish from consultation-input.md.~/.codex/plans/consultation-input.md persists for debugging and history.git diff and untracked file contents are collected to ensure complete coverage.