Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

docs: clarify host native search setup

Trevin Chow36d6f2968428
diff --git a/CONFIGURATION.md b/CONFIGURATION.md
index fc696749..b79b7c67 100644
--- a/CONFIGURATION.md
+++ b/CONFIGURATION.md
@@ -251,7 +251,7 @@ When you invoke `/last30days` from Claude Code, Codex, or Gemini, the host model
The search-source preference ladder, strict best-to-floor:
-1. **Host-native search** - Claude Code's `WebSearch`, and the equivalents on Codex / Gemini. Best results; used automatically on hosts that have it. Signalled to the engine via `LAST30DAYS_NATIVE_SEARCH=1` (the skill sets this for you when your host has a native search tool) so the engine does not run a worse search underneath it.
+1. **Host-native search** - Claude Code's deferred `WebSearch` after `ToolSearch select:WebSearch`, or the native equivalents already exposed on Codex / Gemini. Best results; used automatically on hosts that have it. A failed schema lookup is not fatal on hosts such as Codex when another native search tool is already available. Signalled to the engine via `LAST30DAYS_NATIVE_SEARCH=1` (the skill sets this for you when your host has a native search tool) so the engine does not run a worse search underneath it.
2. **Paid engine backend** - one of `BRAVE_API_KEY`, `EXA_API_KEY`, `SERPER_API_KEY`, `PARALLEL_API_KEY`, auto-detected in that order. Override per-run with `--web-backend=<name>`.
3. **Keyless engine floor** - zero-key web search (DuckDuckGo, plus an optional SearXNG instance) and zero-key page fetch (Jina Reader). Runs only when the host has **no** native search **and** no paid key is set, so headless/cron and hosts without a built-in search tool still get general-web coverage. Force it explicitly with `--web-backend=keyless`.
diff --git a/skills/last30days/SKILL.md b/skills/last30days/SKILL.md
index cb15cd7c..3ecb776a 100644
--- a/skills/last30days/SKILL.md
+++ b/skills/last30days/SKILL.md
@@ -222,17 +222,29 @@ End of OUTPUT CONTRACT. The laws above are the contract; everything below is imp
# HOW TO INVOKE THIS SKILL (READ FIRST, FOLLOW EVERY TIME)
-**STEP 0 - LOAD WEBSEARCH FIRST.** Your literal first tool call on every `/last30days` invocation MUST be:
+**STEP 0 - RESOLVE HOST-NATIVE SEARCH FIRST.** Your first action on every `/last30days` invocation is to determine whether this host has a native web-search tool and load it when the host requires a schema-selection step.
-```
-ToolSearch select:WebSearch
-```
+Use this capability matrix:
+
+- **Claude Code with deferred WebSearch:** your literal first tool call MUST be:
+
+ ```text
+ ToolSearch select:WebSearch
+ ```
+
+ WebSearch is a deferred tool in Claude Code v2.1.114. The frontmatter authorizes it (`allowed-tools: ... WebSearch`) but the runtime can list schemas as "not loaded." Calling WebSearch without selecting it first may fail or do nothing.
+
+- **Codex / Gemini / hosts with a native web-search tool already exposed:** use that native web-search tool for Step 0.5 / 0.55 pre-research and Step 2 supplements. Do **not** treat a failed or empty `ToolSearch select:WebSearch` lookup as fatal when a native search tool is already available in the host. On Codex, for example, `tool_search` may not return a `WebSearch` schema even though the session has native web search.
+
+- **Hosts with no native web-search tool:** skip Step 0.55 and Step 0.75, and add `--auto-resolve` to the engine command. The engine will use configured web backends (`BRAVE_API_KEY`, `EXA_API_KEY`, `SERPER_API_KEY`, `PARALLEL_API_KEY`) or the keyless floor when available.
+
+When native search is available, export `LAST30DAYS_NATIVE_SEARCH=1` in the same shell as the engine invocation so the engine does not also run the lower-quality keyless web floor. Leave it unset on hosts without native search.
-WebSearch is a **deferred tool** in Claude Code v2.1.114. The frontmatter of this file authorizes it (`allowed-tools: ... WebSearch`) but the runtime lists it as "schemas are NOT loaded." Calling WebSearch without `ToolSearch select:WebSearch` first will fail or do nothing. That friction is the documented cause of the second-most-common failure mode of this skill: the model sees "WebSearch is there but deferred," takes the low-friction path, skips Step 0.5 and 0.55, and runs the engine bare with only keyword search. The output looks fine but misses founder X timelines, GitHub repo activity, and subreddit-specific threads.
+Resolving this correctly prevents the second-most-common failure mode of this skill: the model skips Step 0.5 / 0.55 and runs the engine bare with only keyword search. The output looks fine but misses founder X timelines, GitHub repo activity, subreddit-specific threads, and current first-party positioning.
-Load WebSearch first. No exceptions. Then run the first-run gate below before anything else.
+After resolving host-native search, run the first-run gate below before anything else.
-**FIRST-RUN GATE — run this Bash command immediately after loading WebSearch, before reading the topic or doing any research:**
+**FIRST-RUN GATE — run this Bash command immediately after resolving host-native search, before reading the topic or doing any research:**
```bash
grep -q "SETUP_COMPLETE=true" ~/.config/last30days/.env 2>/dev/null && echo "1" || echo "FIRST_RUN_DETECTED"
diff --git a/tests/test_codex_host_contract.py b/tests/test_codex_host_contract.py
index 4f021164..1d4fdbe9 100644
--- a/tests/test_codex_host_contract.py
+++ b/tests/test_codex_host_contract.py
@@ -39,3 +39,31 @@ def test_non_modal_completion_mentions_safe_diagnose_and_project_trust():
assert "safe `--diagnose`" in prose
assert "LAST30DAYS_TRUST_PROJECT_CONFIG=1" in prose
assert "Codex desktop" in prose
+
+
+def _step0_search_contract() -> str:
+ text = SKILL_MD.read_text(encoding="utf-8")
+ start_marker = "**STEP 0 - RESOLVE HOST-NATIVE SEARCH FIRST.**"
+ end_marker = "**FIRST-RUN GATE"
+ start = text.find(start_marker)
+ assert start != -1, f"missing section marker: {start_marker}"
+ end = text.find(end_marker, start)
+ assert end != -1, f"missing section marker: {end_marker}"
+ return text[start:end]
+
+
+def test_codex_native_search_does_not_require_deferred_websearch_schema():
+ step0 = _step0_search_contract()
+ assert "Claude Code with deferred WebSearch" in step0
+ assert "ToolSearch select:WebSearch" in step0
+ assert "Codex / Gemini / hosts with a native web-search tool already exposed" in step0
+ assert "Do **not** treat a failed or empty `ToolSearch select:WebSearch` lookup as fatal" in step0
+ assert "Codex" in step0 and "native web search" in step0
+
+
+def test_no_native_search_hosts_use_auto_resolve_and_leave_native_signal_unset():
+ step0 = _step0_search_contract()
+ assert "Hosts with no native web-search tool" in step0
+ assert "--auto-resolve" in step0
+ assert "LAST30DAYS_NATIVE_SEARCH=1" in step0
+ assert "Leave it unset on hosts without native search" in step0