AS

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.zip

Installs 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.
411 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

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

You give it
Complex code question, relevant files/directories, and clarifying context
You get back
Deep analysis, debugging help, complete code review, or expert analysis from GPT-5 Pro

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

  1. Capture the user's question

    • What specifically do they want to know?
    • What problem are they trying to solve?
  2. Determine scope

    • Which files/directories are relevant?
    • Is this about architecture, bugs, performance, security, or best practices?

Phase 2: Select Files

  1. Use Glob to identify relevant files

    • Search for patterns matching the question scope
    • Examples:
      • **/*.{js,ts} for JavaScript/TypeScript projects
      • src/**/*.py for Python source code
      • **/*.{go,mod} for Go projects
  2. 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?"
  3. 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

Phase 3: Formulate the Question

  1. 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?"
  2. 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

  1. 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
  2. Check against limits (from .oraclerc)

    • If cost > $5, inform user and ask for confirmation
    • If cost > configured limit, don't proceed without explicit approval
  3. 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

  1. 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."
    
  2. 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
  3. 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

  1. The oracle script will display:

    • Provider and model used
    • Time elapsed
    • Cost breakdown (input/reasoning/output tokens)
    • Full response from GPT-5 Pro
  2. Read the history file using Read tool:

    • Location: .claude/oracle-history/oracle-<timestamp>.json
    • Contains full response and metadata
  3. 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:

  1. Uses Glob to find: **/*.js, src/**/*.ts
  2. Asks: "I found 42 files. Should I include tests?"
  3. Asks: "What symptoms are you seeing?" → "Gradual memory growth, crashes at 2GB"
  4. Asks: "When did this start?" → "After async refactor"
  5. Shows estimate: ~$3.20 (45K tokens input)
  6. Confirms: "Proceed?"
  7. Runs oracle script
  8. Waits 18 minutes
  9. Presents detailed analysis with fixes

Example 2: Architecture Review

User: "Review the architecture of my API"

Claude Code:

  1. Uses Glob: src/api/**/*.ts, src/models/**/*.ts
  2. Estimates: 80K tokens (~$5.40)
  3. Asks confirmation (exceeds $5 threshold)
  4. User confirms
  5. Runs oracle script
  6. Waits 22 minutes
  7. 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

  1. Be specific in questions - the Oracle works best with clear, focused questions
  2. Select relevant files only - more code = higher cost and longer processing
  3. Provide context - explain what you've tried and what you're looking for
  4. Use for complex issues - save simple questions for me directly
  5. 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

OpenAI API key with GPT-5 Pro access

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.

SkillInstallsUpdatedSafetyDifficulty
ask-the-oracle (this skill)05moReviewAdvanced
architect-review1094moNo flagsAdvanced
solid-principles579moNo flagsIntermediate
codex322moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by diegosouzapw

View all by diegosouzapw

helm-chart-scaffolding-v2

diegosouzapw

Helm Chart Scaffolding workflow skill. Use this skill when the user needs Comprehensive guidance for creating, organizing, and managing Helm charts for packaging and deploying Kubernetes applications and the operator should preserve the upstream workflow, copied support files, and provenance before

00

cc-skill-coding-standards-v2

diegosouzapw

Coding Standards & Best Practices workflow skill. Use this skill when the user needs Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development and the operator should preserve the upstream workflow, copied support files, and provenance before

00

worktree-setup

diegosouzapw

Automatically invoked after `git worktree add` to create data/shared symlink and data/local directory. Required before starting work in any new worktree.

00

parsehub-automation

diegosouzapw

Automate Parsehub tasks via Rube MCP (Composio). Always search tools first for current schemas.

00

signalwire-agents-sdk

diegosouzapw

Expert assistance for building SignalWire AI Agents in Python. Automatically activates when working with AgentBase, SWAIG functions, skills, SWML, voice configuration, DataMap, or any signalwire_agents code. Provides patterns, best practices, and complete working examples.

00

agent-sales-engineer

diegosouzapw

Expert sales engineer specializing in technical pre-sales, solution architecture, and proof of concepts. Masters technical demonstrations, competitive positioning, and translating complex technology into business value for prospects and customers.

00

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.

109320

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.

57236

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.

32238

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.

35170

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.

25170

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.

35110

Search skills

Search the agent skills registry