web-search

A command that searches Markdown files collected from websites and shows useful text around the best matches. It can search all collected sources or one named source.

In plain words
What is it for?
Use it to find information in Markdown fetched by the project's web-add or document-fetching tools, using a regular-expression search pattern.
Why use it?
A list of matching files or lines may not provide enough context to answer a question. This command reads the surrounding passages so the result is easier to use and verify.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/raintree-technology/docpull/web-search
Clone the repo
git clone --depth 1 https://github.com/raintree-technology/docpull
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.00651
Opus 5 $0.00012 $0.00326
Sonnet 5 $0.00005 $0.00130
Haiku 4.5 $0.00002 $0.00065

Measured yesterday against content hash 8ce54b741ef0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

web-search scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/commands/web-search.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Search fetched web-source Markdown

The user wants to search Markdown that has already been pulled by /web-add (or ensure_docs). This composes two MCP tools: grep_docs finds matching files; read_doc pulls more context around the top hits so the answer is grounded, not just a list of file:line references.

User input: $ARGUMENTS

How to handle the input

Parse $ARGUMENTS as:

  • First whitespace-separated token = pattern (regex; can be quoted to include spaces).
  • Optional second token = source alias to restrict the search to one fetched source. Pass it as the library argument when calling grep_docs.

If empty: reply Usage: /web-search <pattern> [source]. Run /web-list to see what's cached. and stop.

Workflow

  1. Find candidates. Call grep_docs(pattern=<pattern>, library=<source if given>, limit=10, context=2). The tool returns the top files ranked by match density with two lines of context above and below each hit.

  2. Read deeper context for the top 2-3 files. For each of the top files in the grep result (max 3), call read_doc(library=<lib>, path=<path>, line_start=<top-hit-line - 30>, line_end=<top-hit-line + 30>) to pull a ~60-line window. Skip this step if the user's pattern is very narrow (a literal symbol name) and the grep context already answers the question.

  3. If grep returns nothing:

    • If a source was specified, run list_indexed() to confirm the source is actually cached. If it isn't, suggest /web-add <source> and stop.
    • If no library was specified, broaden the pattern once (e.g. add common prefixes/suffixes, drop word boundaries) and retry. If still nothing, surface the gap to the user.
  4. If grep_docs says "search timed out": the pattern is likely catastrophic. Suggest a tighter pattern (no nested quantifiers, anchor with \b).

Output

  • Lead with the synthesized answer to the user's likely question, grounded in what you read.
  • Cite each source as source/path.md:line so the user can verify.
  • Don't dump the full grep output unless the user asked for it - the goal is an answer, not a search log.

Read the full file on GitHub · 45 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 45 lines · 24 tokens per session scan A 8ce54b741ef0

Subscribe to this mod's changes

web-search is a command published in the GitHub repository raintree-technology/docpull (25 stars, last pushed 5d ago), licensed MIT. It adds 24 tokens to every session and 651 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.