Deep research

From glebis/claude-skills · View interactive version

Deep research is an AI agent skill from the GitHub repository glebis/claude-skills. This skill should be used when conducting comprehensive research on any topic using the OpenAI Deep Research API. It automates prompt enhancement through interactive clarifying questions, saves research parameters, and executes deep research with web search capabilities. Use when the user asks for i

How to use this skill

Skill file

Deep Research Skill

Purpose

This skill enables comprehensive, internet-enabled research on any topic using the OpenAI Responses API with web search (default model gpt-5.6-sol, override with --model or DEEP_RESEARCH_MODEL). o3-deep-research and o4-mini-deep-research were scheduled for shutdown on 2026-07-23 and are no longer the default. It intelligently enhances user research prompts through interactive clarifying questions, ensures research parameters are saved for reproducibility, and executes deep research with full web search capabilities.

When to Use This Skill

Trigger this skill when:

Example user requests:

Workflow Overview

User Input
    ↓
Assessment: Prompt too brief?
    ↓
YES → Ask Enhancement Questions → Collect Answers
    ↓                               ↓
    └───────→ Construct Enhanced Prompt ←──┘
                    ↓
            Save to Timestamped File
                    ↓
            Execute deep_research.py
                    ↓
            Output Report + Sources
                    ↓
            Present to User

How Claude Should Use This Skill

Important for Token Efficiency:

Deep research takes 10-20 minutes or more. The runner uses background mode and polls quietly every 15 s; the command blocks until the run ends, so no status checks are needed from Claude. Claude should:

  1. Start the research
  2. Wait for completion (subprocess blocks automatically)
  3. Present final results once complete

No need for periodic polling or status updates during execution.

Step 1: Accept Research Request

Receive the user's research prompt. This can range from brief ("Latest AI trends") to highly detailed ("Impact of language models on developer productivity with focus on 2024-2025").

Step 2: Execute the Orchestration Script

Run the skill's main orchestration script with the user's research prompt:

python3 scripts/run_deep_research.py "Your research prompt here"

The script is located at scripts/run_deep_research.py within the skill's installation.

Step 3: Script Execution Flow

The script automatically:

  1. Assesses prompt completeness: Checks if prompt is too brief or generic (< 15 words or starts with "what is", "how to", etc.)
  1. Asks clarifying questions (if needed):
  1. Enhances the prompt: Combines original prompt with user's answers into structured research parameters
  1. Saves prompt file: Writes enhanced prompt to research_prompt_YYYYMMDD_HHMMSS.txt for reproducibility
  1. Executes deep research: Runs the core deep_research.py script with:

Step 4: Present Results to User

The script automatically:

Token Efficiency Note: The script blocks while it polls in the background, so Claude waits on one command.

Interrupted runs: the response ID is printed and saved before waiting. Collect a run that is still going, or one whose wait timed out, with python3 assets/deep_research.py --resume <response_id> --output-dir <dir>. This sends no new (paid) request.

Importing into a vault: import the raw JSON, not the Markdown, with the research-runs skill: python3 ~/.claude/skills/research-runs/scripts/research_run.py import research_response_….json --vault <vault> --adapter openai-json --provider openai --surface api --prompt research_prompt_….txt. The JSON keeps citation spans and consulted-but-uncited pages.

Bundled Resources

Scripts

`scripts/run_deep_research.py` (Main Entry Point)

The orchestration script that handles:

Key Features:

Available options:

python3 run_deep_research.py <prompt> [OPTIONS]
  --no-enhance              Skip enhancement questions
  --model <model>           Model to use (default: runner default, gpt-5.6-sol)
  --timeout <seconds>       Maximum wait in seconds (default: 3600)
  --output-dir <path>       Where to save the prompt, request, raw response, and report
`assets/deep_research.py`

Core script that interfaces with OpenAI's Deep Research API. Handles:

New command-line options:

--output-file <path>      Custom output file path
--no-save                 Disable automatic markdown saving

References

`references/workflow.md`

Detailed workflow documentation covering:

Key Behaviors

Smart Prompt Enhancement

The skill intelligently determines whether enhancement is needed:

Research Parameters

Enhanced prompts include:

These parameters help the deep research model deliver more targeted, relevant results.

Reproducibility

Every research execution:

Examples

Brief Prompt with Enhancement

User: "Research the most effective opensource RAG solutions"

Script behavior:

  1. Detects brief prompt (12 words) + technical keywords ("opensource", "RAG")
  2. Asks technical research questions:
  1. Enhances to detailed prompt with parameters
  2. Saves and executes deep research
  3. Returns comprehensive report with comparative benchmarks and source URLs

Detailed Prompt Without Enhancement

User: "Analyze the impact of large language models on software developer productivity in 2024-2025, focusing on code generation tools, pair programming, and productivity metrics."

Script behavior:

  1. Detects detailed prompt (24 words) with specific scope/focus
  2. Skips enhancement questions
  3. Saves and executes deep research immediately
  4. Returns focused analysis aligned with user specifications

Requirements

Token-Efficient Workflow

Long-Running Task Optimization

Deep research queries typically take 10-20 minutes to complete. This skill is optimized to minimize token usage during long waits:

How it works:

  1. Synchronous execution: The script runs as a blocking subprocess (no background polling)
  2. No intermediate checks: Claude waits silently for completion without status updates
  3. Single output: Results are presented once at the end
  4. Automatic saving: Markdown files are saved automatically, no manual intervention needed

Token savings:

Automatic File Management

The skill automatically generates and saves files:

Generated files:

Customization options:

# Custom output location
python3 deep_research.py --prompt-file prompt.txt --output-file my_research.md

# Disable automatic saving (terminal output only)
python3 deep_research.py --prompt-file prompt.txt --no-save

Troubleshooting

Missing OPENAI_API_KEY

Error: "Missing OPENAI_API_KEY"

Solution:

deep_research.py Not Found

Error: "Could not find deep_research.py"

Solution:

Research Timeout

Error: "Still in_progress after …s. Resume later with: --resume <id>"

Solution:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.