// Submit complex code questions to OpenAI GPT-5 Pro for deep analysis when you have 20 minutes. Use when the user asks for architectural analysis, comprehensive code review, debugging complex issues, or requests expert analysis of their codebase that requires extended reasoning. Automatically handles file selection, code packing with Repomix, cost estimation, long-running API requests, and result presentation.
| name | ask-the-oracle |
| description | Submit complex code questions to OpenAI GPT-5 Pro for deep analysis when you have 20 minutes. Use when the user asks for architectural analysis, comprehensive code review, debugging complex issues, or requests expert analysis of their codebase that requires extended reasoning. Automatically handles file selection, code packing with Repomix, cost estimation, long-running API requests, and result presentation. |
| allowed-tools | Read, Write, Grep, Glob, Bash, AskUserQuestion |
Inspired by Andrej Karpathy's approach of consulting GPT-5 Pro as an "Oracle" for complex code questions that require 20+ minutes of deep reasoning.
Use this skill when the user:
Skip this skill when:
Capture the user's question
Determine scope
Use Glob to identify relevant files
**/*.{js,ts} for JavaScript/TypeScript projectssrc/**/*.py for Python source code**/*.{go,mod} for Go projectsAsk user to confirm or refine file selection using AskUserQuestion
Show estimated token count
cd <project-root> && node .claude/skills/ask-the-oracle/scripts/oracle.js <patterns> -- "test" 2>&1 | grep "tokens"Ask clarifying questions using AskUserQuestion if needed:
Format the question clearly
This is a Node.js Express API with TypeScript. The codebase handles user authentication
and data processing. I'm experiencing memory leaks that occur after several hours of
operation, particularly related to request handlers. Please analyze the code and:
1. Identify potential memory leak sources
2. Explain why the async refactor may have triggered this
3. Suggest specific fixes with code examples
Calculate estimated cost
Check against limits (from .oraclerc)
Confirm with user using AskUserQuestion:
Run the oracle script using Bash:
cd <project-root> && node .claude/skills/ask-the-oracle/scripts/oracle.js <patterns> -- "<question>"
Example:
cd /Users/robgruhl/Projects/my-app && \
node .claude/skills/ask-the-oracle/scripts/oracle.js \
"src/**/*.ts" "lib/**/*.ts" -- \
"Analyze this codebase for memory leaks. Focus on async handlers and event listeners."
The script will:
Monitor the output
The oracle script will display:
Read the history file using Read tool:
.claude/oracle-history/oracle-<timestamp>.jsonPresent to user:
If .oraclerc not found:
If API key invalid:
If cost limit exceeded:
If timeout:
If request fails:
.claude/oracle-history/User: "I have a memory leak in my Node.js service. Can you do a deep analysis?"
Claude Code:
**/*.js, src/**/*.tsUser: "Review the architecture of my API"
Claude Code:
src/api/**/*.ts, src/models/**/*.tsUsers must have .oraclerc in project root:
{
"defaultProvider": "openai",
"providers": {
"openai": {
"apiKey": "$OPENAI_API_KEY",
"model": "gpt-5-pro",
"enabled": true
}
},
"limits": {
"maxCostPerRequest": 10.00,
"warnCostThreshold": 5.00
}
}
Remember: This skill makes external API calls that cost money and take time. Always confirm with the user before submitting, and set clear expectations about the 20-minute wait time.