ask-claude
Ask Claude
Use this skill when the user wants Codex to send a question or task to Claude, regardless of the exact verb, including phrasings like ask Claude, check with Claude, run this by sonnet, see what haiku says, get Claude's take, or have Claude explain this, including follow-up requests that continue the same Claude conversation.
Quick start
- Determine the requested model from the user's wording.
- Default to
ASK_CLAUDE_DEFAULT_MODELwhen it is set, otherwiseopus, when the user saysClaudeor does not name a model. - Build a compact prompt that includes only the needed context.
- Default to a persistent Claude session within the current Codex conversation.
- Resolve the helper path from this skill directory, then run
"$SKILL_DIR/scripts/ask-claude.sh" [model] [session flags]and pass the prompt on stdin. - Remember the Claude session ID in the conversation and reuse it for later Claude follow-ups unless the user asks for a fresh or stateless call.
- Report Claude's answer clearly as Claude's answer, then add any brief commentary of your own only if useful.
Model mapping
Claude->opusopus->opussonnet->sonnethaiku->haiku
If the user names an unsupported Claude model alias, say so briefly and fall back to opus unless they asked for strict refusal.
The helper also supports ASK_CLAUDE_DEFAULT_MODEL for the default selected model. Supported values are opus, sonnet, and haiku. An explicit model in the user request still takes precedence.
Session handling
Use Claude sessions as the default baseline.
- On the first Claude consult in a Codex conversation, generate a UUID with
uuidgen, start Claude with--session-id <uuid>, and remember that session ID in the conversation. - On later Claude follow-ups in the same Codex conversation, reuse that session with
--resume <session-id>. - If the user explicitly asks to continue the most recent Claude session in this directory rather than the remembered conversation session, use
--continue. - If the user explicitly wants a one-off question, or the new Claude query is clearly unrelated and prior context would be harmful, call
scripts/ask-claude.sh <model>without any session flag. - If the user wants to branch from an existing Claude session without overwriting the original thread, add
--fork-sessiontogether with--resumeor--continue.
Prefer explicit --resume <session-id> once a conversation-scoped Claude session exists. Use --continue only when "most recent Claude session in this directory" is the intended behavior.
Prompt construction
Keep the forwarded prompt minimal and explicit:
- Start with the concrete question.
- Include only the context Claude needs to answer well.
- Prefer short labeled sections such as
Question:andContext:. - If you need a constrained output shape, state it directly.
Template:
Question:
<user question>
Context:
<only the necessary facts, code snippets, or constraints>
Instructions:
Answer briefly and directly.
Tooling rules
- Use the bundled script at the skill-relative path
scripts/ask-claude.sh. - Resolve that path relative to this
SKILL.mdfile before invoking it from the shell. Do not assume the current working directory is the skill directory and do not waste time searching the project for the script. - Keep Claude tools disabled by default. This makes the call read-only and predictable.
- Only change that default if the user explicitly asks Claude itself to inspect files or use tools.
- Prefer non-interactive
claude -pusage so the result is easy to capture and quote back. - The helper checks authentication before sending the prompt. If Claude is not ready for non-interactive use, tell the user to run
claude auth loginor configureCLAUDE_CODE_OAUTH_TOKENviaclaude setup-token. - The helper supports
--continue,--resume <session-id>,--session-id <uuid>, and--fork-session. - Do not add extra files or external storage for Claude session tracking. Keep the active session ID in conversation context.
Reporting back
- Attribute the answer clearly, for example
Claude (sonnet) said:. - By default, reproduce Claude's answer directly rather than paraphrasing or reinterpreting it.
- Prefer a quote block or fenced block for Claude's exact response so it is visually separate from your own text.
- If you add your own commentary, label it separately after Claude's answer.
- Only summarize or reinterpret Claude's answer if the user explicitly asks for that, or if Claude's raw answer is too long to be practical to quote in full.
- When starting a new Claude session, mention the session ID once and then reuse it silently in later follow-ups unless the user asks about it.
- If Claude fails due to rate limits or auth, say that directly and summarize the command behavior.
- Do not present Claude's output as your own judgment.
Verification
When editing this skill or its script, verify with a real non-interactive CLI call such as:
SKILL_DIR="<directory containing this SKILL.md>"
printf '%s' 'Reply with exactly: ok-opus' | "$SKILL_DIR/scripts/ask-claude.sh" opus
For persistent sessions, verify with a two-step exchange:
SKILL_DIR="<directory containing this SKILL.md>"
uuid=$(uuidgen)
printf '%s' 'Remember BANANA. Reply with exactly: remembered.' | "$SKILL_DIR/scripts/ask-claude.sh" haiku --session-id "$uuid"
printf '%s' 'What word did I ask you to remember? Reply with only the word.' | "$SKILL_DIR/scripts/ask-claude.sh" haiku --resume "$uuid"