ask-the-oracle
Uses high-reasoning models for comprehensive code review and complex problem-solving.
Install
mkdir -p .claude/skills/ask-the-oracle && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16272" && unzip -o skill.zip -d .claude/skills/ask-the-oracle && rm skill.zipInstalls to .claude/skills/ask-the-oracle
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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.Key capabilities
- →Perform architectural analysis or design review.
- →Debug complex, non-obvious issues in codebases.
- →Conduct complete code reviews across multiple files.
- →Provide expert analysis requiring extended reasoning.
- →Automatically handle file selection and code packing with Repomix.
- →Present results with key findings and actionable recommendations.
How it works
This skill captures the user's complex code question, selects relevant files, packs code with Repomix, estimates cost, submits to GPT-5 Pro, and presents the results.
Inputs & outputs
When to use ask-the-oracle
- →Architectural review of codebase
- →Debugging non-obvious issues
- →Deep dives into system design
About this skill
Ask the Oracle
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.
When to Use This Skill
Use this skill when the user:
- Asks for architectural analysis or design review
- Needs debugging help for complex, non-obvious issues
- Requests comprehensive code review across multiple files
- Wants expert analysis beyond my immediate capabilities
- Says things like "deep dive", "expert analysis", "comprehensive review", "consult the Oracle"
- Is willing to wait 10-20 minutes for high-quality results
- Has a question that requires reasoning across large amounts of code
When NOT to Use This Skill
Skip this skill when:
- The question is simple and I can answer it directly
- The user needs an immediate response
- The task is about editing or generating code (not analysis)
- The question is conversational or doesn't require codebase context
Instructions
Phase 1: Understand the Question
-
Capture the user's question
- What specifically do they want to know?
- What problem are they trying to solve?
-
Determine scope
- Which files/directories are relevant?
- Is this about architecture, bugs, performance, security, or best practices?
Phase 2: Select Files
-
Use Glob to identify relevant files
- Search for patterns matching the question scope
- Examples:
**/*.{js,ts}for JavaScript/TypeScript projectssrc/**/*.pyfor Python source code**/*.{go,mod}for Go projects
-
Ask user to confirm or refine file selection using AskUserQuestion
- Present the file count and pattern
- Allow them to add/remove patterns
- Example: "I found 45 JavaScript files in src/. Should I include tests/ as well?"
-
Show estimated token count
- Use Bash to run:
cd <project-root> && node .claude/skills/ask-the-oracle/scripts/oracle.js <patterns> -- "test" 2>&1 | grep "tokens" - This will show the token estimate from Repomix
- Use Bash to run:
Phase 3: Formulate the Question
-
Ask clarifying questions using AskUserQuestion if needed:
- "What specific aspect are you investigating?" (architecture/bugs/performance/etc.)
- "What is the expected behavior or outcome?"
- "Have you tried any debugging steps already?"
-
Format the question clearly
- Start with context: "This is a [type] project with [key characteristics]"
- State the specific question
- Add any constraints or focus areas
- Example:
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
Phase 4: Estimate Cost and Confirm
-
Calculate estimated cost
- Repomix will show token count when packing
- GPT-5 Pro pricing: $15/M input, $120/M output
- Typical costs: $2-10 depending on codebase size
-
Check against limits (from .oraclerc)
- If cost > $5, inform user and ask for confirmation
- If cost > configured limit, don't proceed without explicit approval
-
Confirm with user using AskUserQuestion:
- Show estimated cost
- Confirm they want to proceed
- Remind them it may take 20 minutes
Phase 5: Submit to Oracle
-
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:
- Pack code with Repomix
- Show cost estimate
- Submit to GPT-5 Pro (background mode)
- Poll every 3 seconds for completion
- Display progress updates
- Save response to history
-
Monitor the output
- The script will show status updates
- Wait for completion (don't timeout Claude Code!)
- Typical time: 10-20 minutes
Phase 6: Present Results
-
The oracle script will display:
- Provider and model used
- Time elapsed
- Cost breakdown (input/reasoning/output tokens)
- Full response from GPT-5 Pro
-
Read the history file using Read tool:
- Location:
.claude/oracle-history/oracle-<timestamp>.json - Contains full response and metadata
- Location:
-
Present to user:
- Summarize key findings
- Highlight actionable recommendations
- Show cost and time metrics
- Ask if they have follow-up questions
Error Handling
If .oraclerc not found:
- Inform user they need to set up configuration
- Point them to .oraclerc.example
- Explain they need an OpenAI API key
If API key invalid:
- Check if OPENAI_API_KEY environment variable is set
- Suggest checking their API key configuration
- Remind them they need GPT-5 Pro access
If cost limit exceeded:
- Show the estimated cost
- Ask if they want to proceed anyway
- Suggest ways to reduce cost (fewer files, compression)
If timeout:
- The script has a 25-minute timeout
- If it times out, the request might still be processing
- Response ID is saved, can be retrieved later
If request fails:
- Show the error message from OpenAI
- Suggest checking API status
- Offer to retry
Important Notes
- Cost: Typically $2-10 per request depending on codebase size
- Time: Expect 10-20 minutes for responses (GPT-5 Pro uses extended reasoning)
- API Access: Requires OpenAI API key with GPT-5 Pro access
- Privacy: Code is sent to OpenAI (retained for 30 days per their policy)
- History: All consultations are saved to
.claude/oracle-history/ - Limits: Configurable cost limits in .oraclerc prevent accidental overspending
Example Usage
Example 1: Memory Leak Analysis
User: "I have a memory leak in my Node.js service. Can you do a deep analysis?"
Claude Code:
- Uses Glob to find:
**/*.js,src/**/*.ts - Asks: "I found 42 files. Should I include tests?"
- Asks: "What symptoms are you seeing?" → "Gradual memory growth, crashes at 2GB"
- Asks: "When did this start?" → "After async refactor"
- Shows estimate: ~$3.20 (45K tokens input)
- Confirms: "Proceed?"
- Runs oracle script
- Waits 18 minutes
- Presents detailed analysis with fixes
Example 2: Architecture Review
User: "Review the architecture of my API"
Claude Code:
- Uses Glob:
src/api/**/*.ts,src/models/**/*.ts - Estimates: 80K tokens (~$5.40)
- Asks confirmation (exceeds $5 threshold)
- User confirms
- Runs oracle script
- Waits 22 minutes
- Presents architecture analysis with recommendations
Configuration
Users 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
}
}
Tips for Best Results
- Be specific in questions - the Oracle works best with clear, focused questions
- Select relevant files only - more code = higher cost and longer processing
- Provide context - explain what you've tried and what you're looking for
- Use for complex issues - save simple questions for me directly
- Follow up - you can ask clarifying questions after getting the response
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.
When not to use it
- →When the question is simple and can be answered directly.
- →When the user needs an immediate response.
- →When the task is about editing or generating code, not analysis.
Prerequisites
Limitations
- →The skill requires an OpenAI API key with GPT-5 Pro access.
- →It may take 10-20 minutes for high-quality results.
- →Code is sent to OpenAI and retained for 30 days per their policy.
How it compares
This workflow use a specialized AI model (GPT-5 Pro) for deep, extended reasoning on complex code questions, providing insights beyond immediate capabilities.
Compared to similar skills
ask-the-oracle side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| ask-the-oracle (this skill) | 0 | 5mo | Review | Advanced |
| architect-review | 109 | 4mo | No flags | Advanced |
| solid-principles | 57 | 9mo | No flags | Intermediate |
| codex | 32 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by diegosouzapw
View all by diegosouzapw →You might also like
architect-review
sickn33
Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.
solid-principles
SmidigStorm
Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.
codex
Lucklyric
Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.
error-handling-patterns
wshobson
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
deepwiki-rs
sopaco
AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.
senior-fullstack
davila7
Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.