Autonomous agent-based web search fallback for when WebSearch API fails or hits limits
When WebSearch fails or hits limits, this skill uses autonomous agents to guarantee reliable search results through multiple data sources, bypassing broken HTML scraping methods and bot protection.
/plugin marketplace add bejranonda/LLM-Autonomous-Agent-Plugin-for-Claude/plugin install bejranonda-autonomous-agent@bejranonda/LLM-Autonomous-Agent-Plugin-for-ClaudeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
INTEGRATION.mdProvides robust web search capabilities using the autonomous agent approach (Task tool with general-purpose agent) when the built-in WebSearch tool fails, errors, or hits usage limits. This method has been tested and proven to work reliably where HTML scraping fails.
# Use Task tool with general-purpose agent
Task(
subagent_type='general-purpose',
prompt='Research AI 2025 trends and provide comprehensive information about the latest developments, predictions, and key technologies'
)
Why it works:
# Use official WebSearch when not rate-limited
WebSearch("AI trends 2025")
Status: Works but may hit usage limits
DuckDuckGo HTML Scraping - BROKEN
result__a no longer existsBrave Search Scraping - BROKEN
All curl + grep Methods - BROKEN
def search_with_fallback(query):
"""
Reliable search with working fallback.
"""
# Try WebSearch first
try:
result = WebSearch(query)
if result and "Did 0 searches" not in str(result):
return result
except:
pass
# Use autonomous agent as fallback (RELIABLE)
return Task(
subagent_type='general-purpose',
prompt=f'Research the following topic and provide comprehensive information: {query}'
)
# When WebSearch fails, delegate to autonomous agent
fallback_strategy:
primary: WebSearch
fallback: Task with general-purpose agent
reason: HTML scraping is broken, autonomous agents work
# For web search needs
if websearch_failed:
# Don't use HTML scraping - it's broken
# Use autonomous agent instead
result = Task(
subagent_type='general-purpose',
prompt=f'Search for information about: {query}'
)
# This no longer works
curl "https://html.duckduckgo.com/html/?q=query" | grep 'result__a'
# This works reliably
Task(
subagent_type='general-purpose',
prompt='Research: [your query here]'
)
| Method | Status | Success Rate | Why |
|---|---|---|---|
| Autonomous Agent | ✅ WORKS | 95%+ | Multiple data sources, no scraping |
| WebSearch API | ✅ WORKS* | 90% | *When not rate-limited |
| HTML Scraping | ❌ BROKEN | 0% | Bot protection, structure changes |
| curl + grep | ❌ BROKEN | 0% | Modern web protections |
| Issue | Solution |
|---|---|
| "Did 0 searches" | Use autonomous agent |
| HTML parsing fails | Use autonomous agent |
| Rate limit exceeded | Use autonomous agent |
| Bot detection triggered | Use autonomous agent |
The HTML scraping approach is fundamentally broken due to modern web protections. The autonomous agent approach is the only reliable fallback currently working.
# ✅ DO THIS (Works)
Task(subagent_type='general-purpose', prompt='Research: your topic')
# ❌ DON'T DO THIS (Broken)
curl + grep (any HTML scraping)
When this skill is updated, consider:
Current Status: Using autonomous agents as the primary fallback mechanism since HTML scraping is no longer viable.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.