Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Autonomous agent-based web search fallback for when WebSearch API fails or hits limits
.claude/skills/majiayu000-web-search-fallback/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -22% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 4% | 0% |
Provides 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.
python# 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:
python# Use official WebSearch when not rate-limited WebSearch("AI trends 2025")
Status: Works but may hit usage limits
result__a no longer existspythondef 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}' )
yaml# 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
python# 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}' )
bash# This no longer works curl "https://html.duckduckgo.com/html/?q=query" | grep 'result__a'
python# 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.
python# ✅ 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.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | fail→pass | 17,842 | 10,398 | -42% | 1 | 1 | 0% | 1,999 | 2,105 | +5% | 0 | 0 | — |
case-01 | fail→pass | 14,103 | 19,538 | +39% | 1 | 1 | 0% | 2,635 | 3,964 | +50% | 0 | 0 | — |
case-02 | fail→pass | 18,672 | 19,676 | +5% | 1 | 1 | 0% | 3,446 | 4,114 | +19% | 0 | 0 | — |
case-03 | fail→pass | 25,582 | 11,551 | -55% | 1 | 1 | 0% | 4,117 | 3,225 | -22% | 0 | 0 | — |
case-04 | pass→pass | 19,611 | 20,519 | +5% | 1 | 1 | 0% | 3,770 | 4,811 | +28% | 0 | 0 | — |
case-10 | fail→fail | 15,130 | 12,440 | -18% | 1 | 1 | 0% | 2,586 | 2,519 | -3% | 0 | 0 | — |
case-05 | pass→pass | 20,251 | 19,144 | -5% | 1 | 1 | 0% | 2,596 | 4,174 | +61% | 0 | 0 | — |
case-06 | pass→pass | 10,059 | 11,011 | +9% | 1 | 1 | 0% | 1,952 | 3,384 | +73% | 0 | 0 | — |
case-07 | fail→fail | 28,636 | 21,540 | -25% | 1 | 1 | 0% | 3,919 | 4,258 | +9% | 0 | 0 | — |
case-08 | fail→pass | 17,782 | 13,856 | -22% | 1 | 1 | 0% | 2,679 | 2,794 | +4% | 0 | 0 | — |
case-11 | fail→fail | 9,939 | 5,482 | -45% | 1 | 1 | 0% | 1,837 | 2,225 | +21% | 0 | 0 | — |
case-12 | fail→pass | 19,692 | 7,474 | -62% | 1 | 1 | 0% | 2,291 | 2,545 | +11% | 0 | 0 | — |
case-13 | fail→pass | 17,970 | 17,367 | -3% | 1 | 1 | 0% | 2,716 | 2,881 | +6% | 0 | 0 | — |
case-14 | fail→pass | 27,814 | 19,759 | -29% | 1 | 1 | 0% | 3,659 | 3,690 | +1% | 0 | 0 | — |
case-15 | fail→pass | 17,036 | 6,978 | -59% | 1 | 1 | 0% | 2,801 | 2,446 | -13% | 0 | 0 | — |
case-16 | fail→pass | 22,415 | 11,851 | -47% | 1 | 1 | 0% | 3,468 | 2,620 | -24% | 0 | 0 | — |
case-17 | fail→pass | 21,223 | 12,293 | -42% | 1 | 1 | 0% | 3,827 | 3,472 | -9% | 0 | 0 | — |
case-18 | fail→pass | 19,624 | 16,030 | -18% | 1 | 1 | 0% | 2,313 | 3,061 | +32% | 0 | 0 | — |
case-19 | fail→pass | 16,655 | 14,523 | -13% | 1 | 1 | 0% | 2,500 | 2,850 | +14% | 0 | 0 | — |
case-20 | fail→pass | 22,050 | 16,491 | -25% | 1 | 1 | 0% | 2,786 | 3,220 | +16% | 0 | 0 | — |
case-21 | fail→pass | 16,811 | 15,599 | -7% | 1 | 1 | 0% | 1,847 | 3,044 | +65% | 0 | 0 | — |
case-22 | fail→pass | 26,459 | 16,843 | -36% | 1 | 1 | 0% | 3,441 | 3,364 | -2% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +73 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.