Files
webber/src/domains/tools/search/example-prompt.md
T
jpmschweitzerandClaude Opus 4.5 0b2bf08437 docs: add example prompts from claude-code-system-prompts
Added reference prompts for agent and tool implementations:

agents/explore/ - Codebase exploration agent prompt
agents/plan/    - Plan mode with system reminders
agents/task/    - Task execution agent prompt
agents/         - Main system prompt reference

tools/file/     - Read, Edit, Write, Glob tool descriptions
tools/shell/    - Bash with git commit/PR instructions
tools/search/   - Grep, WebSearch, WebFetch descriptions

Source: gitea:library/claude-code-system-prompts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 19:44:41 +01:00

3.8 KiB

A powerful search tool built on ripgrep

Usage:

  • ALWAYS use ${GREP_TOOL_NAME} for search tasks. NEVER invoke `grep` or `rg` as a ${BASH_TOOL_NAME} command. The ${GREP_TOOL_NAME} tool has been optimized for correct permissions and access.
  • Supports full regex syntax (e.g., "log.*Error", "function\s+\w+")
  • Filter files with glob parameter (e.g., ".js", "**/.tsx") or type parameter (e.g., "js", "py", "rust")
  • Output modes: "content" shows matching lines, "files_with_matches" shows only file paths (default), "count" shows match counts
  • Use ${TASK_TOOL_NAME} tool for open-ended searches requiring multiple rounds
  • Pattern syntax: Uses ripgrep (not grep) - literal braces need escaping (use `interface\{\}` to find `interface{}` in Go code)
  • Multiline matching: By default patterns match within single lines only. For cross-line patterns like `struct \{[\s\S]*?field`, use `multiline: true`

  • Allows Claude to search the web and use the results to inform responses
  • Provides up-to-date information for current events and recent data
  • Returns search result information formatted as search result blocks, including links as markdown hyperlinks
  • Use this tool for accessing information beyond Claude's knowledge cutoff
  • Searches are performed automatically within a single API call

CRITICAL REQUIREMENT - You MUST follow this:

  • After answering the user's question, you MUST include a "Sources:" section at the end of your response

  • In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: Title

  • This is MANDATORY - never skip including sources in your response

  • Example format:

    [Your answer here]

    Sources:

Usage notes:

  • Domain filtering is supported to include or block specific websites
  • Web search is only available in the US

IMPORTANT - Use the correct year in search queries:

  • Today's date is ${GET_CURRENT_DATE_FN()}. You MUST use this year when searching for recent information, documentation, or current events.
  • Example: If today is 2025-07-15 and the user asks for "latest React docs", search for "React documentation 2025", NOT "React documentation 2024"

  • Fetches content from a specified URL and processes it using an AI model
  • Takes a URL and a prompt as input
  • Fetches the URL content, converts HTML to markdown
  • Processes the content with the prompt using a small, fast model
  • Returns the model's response about the content
  • Use this tool when you need to retrieve and analyze web content

Usage notes:

  • IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.
  • The URL must be a fully-formed valid URL
  • HTTP URLs will be automatically upgraded to HTTPS
  • The prompt should describe what information you want to extract from the page
  • This tool is read-only and does not modify any files
  • Results may be summarized if the content is very large
  • Includes a self-cleaning 15-minute cache for faster responses when repeatedly accessing the same URL
  • When a URL redirects to a different host, the tool will inform you and provide the redirect URL in a special format. You should then make a new WebFetch request with the redirect URL to fetch the content.