Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

tavily-dynamic-search — Claude Code skill: what it does & setup

Tavily search skill with context isolation. Saves large web payloads to local disk and filters them before sending snippets into the agent context.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add tavily-ai/skills --skill tavily-dynamic-search -a claude-code
Open on GitHub

What tavily-dynamic-search does

The skill handles heavy web searches via the tvly command-line tool. A standard lookup dumps text directly into the chat context. In contrast, this workflow dumps raw data to local files and inspects snippets first. That keeps the prompt compact when extracting full articles or running multiple queries.

Context isolation is the primary mechanism here. The workflow saves search or extract output with the -o flag, then inspects files with python3 or jq. Keep in mind that --include-domains narrows search candidates but does not prove every returned URL belongs to an allowed host. You must verify hostnames in local filtering scripts when domain restrictions matter.

Search and extraction support capped keyless access. You can start without an API key right away. If the session hits the cap interactively, run tvly login to complete browser OAuth. In non-interactive runs, the tool reports the cap instead of waiting.

What it helps with

  • save raw web payloads to disk before context ingestion
  • filter long web pages locally using Python scripts
  • deduplicate URLs across multiple search queries
  • verify source hostnames against domain allowlists

Example prompts for the agent

  • Use tavily-dynamic-search to find API documentation and save full page dumps to a temp file
  • Search for recent articles on the topic, deduplicate links, and extract only the relevant paragraphs
  • Extract the specified documentation URL to disk and print only the configuration examples

How to install tavily-dynamic-search

1Skills CLI (Vercel)

npx skills add tavily-ai/skills --skill tavily-dynamic-search -a claude-code

2Manually: put the files in place

~/.claude/skills/tavily-dynamic-search/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/tavily-dynamic-search/

From the same set6

The whole set →

Similar

wp-wpcli-and-ops WordPress A skill for WordPress operations through wp: move domains, export the database, install plugins, inspect cron. Useful when the agent has to touch a live site, not just theme files. Claude Code CX Codex Cursor +1 5,400installs managed-deep-agents langchain-ai Guides developers through authoring, testing, and deploying Managed Deep Agents in LangSmith. Useful for setting up code-first agent directories and preparing CLI deployments. Claude Code CX Codex Cursor +1 9,100installs prompt-caching sickn33 Skill for optimizing LLM work through prompt caching, response caching, and Cache Augmented Generation. Reduces latency and API cost on repeated queries with identical context. Claude Code CX Codex Cursor +1 867installs autoresearch Yeachan-Heo Runs one mission through repeated change-and-evaluate cycles, writing each result to JSON and a markdown decision log. Useful when the work needs a long recorded search rather than one attempt. Claude Code CX Codex Cursor +1 575installs modlens liustack A skill that gives text-only models eyes: it sends the image through a CLI and returns JSON with transcribed text, layout regions and semantic notes. Claude Code CX Codex Cursor +1 896installs autopilot nick-vels Turns a dictated idea into a finished app, site, bot or feature in one dialogue: requirements, spec, tickets, subagents and blind acceptance, no per-stage approval. Claude Code CX Codex Cursor +1 5,200installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs

Questions about tavily-dynamic-search

How do I install tavily-dynamic-search in Claude Code?

Run npx skills add tavily-ai/skills --skill tavily-dynamic-search -a claude-code in your terminal.

Why use tavily-dynamic-search instead of basic search?

It keeps full web pages on disk and filters them before sending content to the agent. Regular search dumps entire payloads into context immediately.

What happens when the keyless search quota runs out?

In an interactive terminal, run tvly login to authenticate via browser OAuth. In unattended runs, the command halts and outputs an authentication error.

Source text

SKILL.md · MIT
---
name: tavily-dynamic-search
description: |
  Programmatic Tavily search with context isolation. Use when web search or extraction will return large results that need filtering, deduplication, or multi-step triage before they enter the model context. Use tavily-search for ordinary lookups and tavily-research for end-to-end cited synthesis.
allowed-tools: Bash(tvly *), Bash(python3 *), Bash(uv run *), Bash(jq *)
---

# Tavily Dynamic Search

Keep large raw web payloads on disk and return only the evidence needed for the
task. This is useful when using `--include-raw-content`, combining several
queries, or extracting multiple long pages. Do not use this workflow for a
simple lookup that a normal `tvly search --json` can answer directly.

## Before running

Search and extract support capped keyless access. Run them directly when `tvly`
is available. If `tvly` is missing, follow the
[tavily-cli setup](../tavily-cli/SKILL.md#setup). Do not look for an API key or
authenticate before the first request. If the keyless cap is reached in an
interactive session, run `tvly login` to open browser OAuth, then retry the
blocked request once. In an unattended environment, report the cap and
authentication options instead of starting an interactive flow.

## Workflow

1. Search broadly without raw content and inspect titles, URLs, scores, and
   snippets.
2. Fetch full content only for the best sources.
3. When raw output could be large, save it with `-o` and filter the file before
   printing anything to the model context.
4. Preserve source URLs beside every extracted fact.

When the user restricts evidence to official or named domains, validate the
hostname of every selected URL during local filtering. `--include-domains`
narrows the search but is not proof that every returned result belongs to an
allowed host. If full-page extraction is unavailable, label conclusions as
search-snippet evidence instead of implying that the page body was verified.

Keep the process in one turn when the relevant sources and filters are already
known. Use another turn only when the first search changes what should be
extracted.

Create a unique temporary task directory before saving evidence so concurrent
agents do not overwrite one another. Python's `tempfile.mkdtemp()` is available
when `mktemp` is not permitted. Reuse that directory for all raw and filtered
artifacts from the task.

## Small result: filter a direct JSON response

For a small search response, a pipe is enough:

```bash
tvly search "query" --max-results 5 --json | python3 -c '
import json, sys
data = json.load(sys.stdin)
for result in data.get("results", []):
    score = result.get("score") or 0
    title = result.get("title") or ""
    print(f"[{score:.2f}] {title}")
    print(result.get("url", ""))
    print(result.get("content", "")[:300])
'
```

Do not discard stderr. Authentication failures, keyless-cap messages, and API
errors are actionable and must remain visible.

## Large result: save first, then filter

Use the CLI's file output so raw page content does not pass through the tool
response:

```bash
tvly search "query" \
  --include-raw-content markdown \
  --max-results 8 \
  --json \
  -o /tmp/tavily-search-results.json
```

Then print only bounded evidence:

```bash
python3 -c '
import json
from pathlib import Path

data = json.loads(Path("/tmp/tavily-search-results.json").read_text())
for result in data.get("results", []):
    title = result.get("title") or ""
    url = result.get("url") or ""
    print(f"## {title}")
    print(f"URL: {url}")
    print((result.get("raw_content") or result.get("content") or "")[:1200])
    print()
'
```

Adjust the filtering logic to the question. Prefer relevant paragraphs or
fields over fixed character slices when the target information is known. Aim
for roughly 150-600 tokens per source unless a table or code block genuinely
requires more.

## Targeted extraction

When search identifies the right URLs, extract only those pages:

```bash
tvly extract "https://example.com/article" \
  --json \
  -o /tmp/tavily-extract-results.json
```

For topic-focused pages, let Tavily reduce the response before local filtering:

```bash
tvly extract "https://example.com/docs" \
  --query "authentication API" \
  --chunks-per-source 3 \
  --json \
  -o /tmp/tavily-extract-results.json
```

## Multiple queries

For multi-angle research, run a small set of focused searches, deduplicate by
URL, and rank before extracting. Use `subprocess.run(..., capture_output=True,
text=True)` when orchestrating commands in Python. Check `returncode`; if a
command fails, surface its stderr and stop or retry deliberately. Never use a
blanket `except Exception: continue` that hides missing evidence.

## Response shapes

`tvly search --json` returns `query`, optional `answer`, `results`, and
`response_time`. Each result commonly contains `url`, `title`, `content`,
`score`, and optional `raw_content`.

`tvly extract --json` returns `results`, `failed_results`, and
`response_time`. Each successful result commonly contains `url`,
`raw_content`, and optional images.

Treat fields as optional and use `.get()` while filtering. Inspect
`failed_results` instead of assuming every requested URL succeeded.

## Useful options

| Option | Purpose |
|--------|---------|
| `--max-results` | Bound the search result count; default 5, maximum 20 |
| `--depth` | Choose `ultra-fast`, `fast`, `basic`, or `advanced` |
| `--time-range` | Restrict results to `day`, `week`, `month`, or `year` |
| `--include-domains` | Restrict results to a comma-separated list of trusted domains |
| `--exclude-domains` | Exclude a comma-separated list of domains |
| `--include-raw-content` | Include full content as `markdown` or `text` |
| `-o, --output` | Save the complete response to a file |

Use `jq` only for short filters when Python is unavailable:

```bash
tvly search "query" --json | jq '[.results[] | {title, url, score, content}]'
```

© tavily-ai · MIT · tavily-ai/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor