feat: add --no-native-web flag to skip Parallel AI in Claude Code
When running in Claude Code, the assistant has a built-in WebSearch tool that's free and higher quality than Parallel AI/Brave/OpenRouter. Adding --no-native-web to the SKILL.md invocation defers web search to the assistant, saving API credits. OpenClaw invocations don't pass this flag, so they continue using native web backends. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -165,7 +165,7 @@ if [ -z "${SKILL_ROOT:-}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
python3 "${SKILL_ROOT}/scripts/last30days.py" "$ARGUMENTS" --emit=compact # Add --x-handle=HANDLE if RESOLVED_HANDLE is set
|
||||
python3 "${SKILL_ROOT}/scripts/last30days.py" "$ARGUMENTS" --emit=compact --no-native-web # Add --x-handle=HANDLE if RESOLVED_HANDLE is set
|
||||
```
|
||||
|
||||
Use a **timeout of 300000** (5 minutes) on the Bash call. The script typically takes 1-3 minutes.
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# feat: Skip native web search when running in Claude Code
|
||||
|
||||
**Type:** enhancement
|
||||
**Date:** 2026-03-03
|
||||
**Detail level:** MINIMAL
|
||||
|
||||
## Problem
|
||||
|
||||
When `/last30days` runs in Claude Code, web search happens twice:
|
||||
1. The Python script uses Parallel AI / Brave / OpenRouter (costs API credits)
|
||||
2. SKILL.md tells Claude to run its built-in WebSearch tool (free, better quality)
|
||||
|
||||
This is redundant. Claude's WebSearch is better and free. In OpenClaw, there's no WebSearch tool, so native backends are essential there.
|
||||
|
||||
## Solution
|
||||
|
||||
Add a `--no-native-web` CLI flag to `last30days.py`. When set, the script skips native web search backends even if API keys are configured, and emits the `### WEBSEARCH REQUIRED ###` signal so the assistant handles it.
|
||||
|
||||
Update SKILL.md invocation to include the flag.
|
||||
|
||||
## Changes
|
||||
|
||||
### 1. `scripts/last30days.py`
|
||||
- [ ] Add `--no-native-web` argument to argparse (store_true, default False)
|
||||
- [ ] When `args.no_native_web` is True, force `web_backend = None` regardless of API keys
|
||||
- [ ] This naturally triggers `web_needed = True` → emits `### WEBSEARCH REQUIRED ###` signal
|
||||
- [ ] Update diagnostic banner to show "Web: deferred to assistant" when flag is active
|
||||
|
||||
### 2. `SKILL.md`
|
||||
- [ ] Add `--no-native-web` to the invocation command on line 168:
|
||||
```
|
||||
python3 "${SKILL_ROOT}/scripts/last30days.py" "$ARGUMENTS" --emit=compact --no-native-web
|
||||
```
|
||||
|
||||
### 3. OpenClaw / `--agent` mode
|
||||
- [ ] No changes needed — OpenClaw invocations don't read SKILL.md, they call the script directly without `--no-native-web`, so Parallel AI/Brave/OpenRouter still work
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] Claude Code sessions: script skips Parallel AI, Claude uses WebSearch (no API credits spent)
|
||||
- [ ] OpenClaw sessions: script still uses Parallel AI / Brave / OpenRouter as before
|
||||
- [ ] `--no-native-web` flag can be combined with `--include-web` (flag wins, web deferred)
|
||||
- [ ] Diagnostic output clearly shows web is deferred to assistant
|
||||
+10
-2
@@ -668,6 +668,7 @@ def run_research(
|
||||
resolved_handle: str = None,
|
||||
do_hackernews: bool = True,
|
||||
do_polymarket: bool = True,
|
||||
no_native_web: bool = False,
|
||||
) -> tuple:
|
||||
"""Run the research pipeline.
|
||||
|
||||
@@ -704,7 +705,7 @@ def run_research(
|
||||
|
||||
# Determine web search mode
|
||||
do_web = sources in ("all", "web", "reddit-web", "x-web")
|
||||
web_backend = env.get_web_search_source(config) if do_web else None
|
||||
web_backend = env.get_web_search_source(config) if (do_web and not no_native_web) else None
|
||||
web_needed = do_web and not web_backend
|
||||
|
||||
# Web-only mode
|
||||
@@ -1113,6 +1114,12 @@ def main():
|
||||
"Example: --search reddit,hn (default: all configured sources)"
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-native-web",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Skip native web search backends (Parallel/Brave/OpenRouter). Use when the assistant has its own WebSearch tool.",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -1199,7 +1206,7 @@ def main():
|
||||
"tiktok": has_apify,
|
||||
"hackernews": True,
|
||||
"polymarket": True,
|
||||
"web_search_backend": web_source,
|
||||
"web_search_backend": "deferred to assistant" if args.no_native_web else web_source,
|
||||
}
|
||||
ui.show_diagnostic_banner(diag)
|
||||
|
||||
@@ -1320,6 +1327,7 @@ def main():
|
||||
resolved_handle=args.x_handle,
|
||||
do_hackernews=search_do_hackernews,
|
||||
do_polymarket=search_do_polymarket,
|
||||
no_native_web=args.no_native_web,
|
||||
)
|
||||
|
||||
# Processing phase
|
||||
|
||||
Reference in New Issue
Block a user