code-yeongyu

Pi Anthropic Web Search — Development skill for Claude Code

Development community

Anthropic native web search policy extension for the pi coding agent.

How to install Pi Anthropic Web Search

This entry records only its repository, not the path inside it, so there is no exact command to give. Open code-yeongyu/pi-anthropic-web-search and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Pi Anthropic Web Search does

Anthropic native web search policy extension for the pi coding agent. Ensures native web_search tools are present on anthropic-messages payloads and appends web search guidance to the system prompt.

Alternatives in Development

  • Check Gitignore — Check and update .gitignore to exclude Plan Cascade temporary files 123 ★
  • Huashu Doubao Search — 豆包搜索 MCP server — 给换了国产模型的 Claude Code 补上联网能力 98 ★
  • Cc Statistics — 270+ Three-in-one Claude Code stats: CLI + Web + native macOS SwiftUI panel 49 ★

README

pi-anthropic-web-search

[![ci](https://github.com/code-yeongyu/pi-anthropic-web-search/actions/workflows/ci.yml/badge.svg)](https://github.com/code-yeongyu/pi-anthropic-web-search/actions/workflows/ci.yml) [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Anthropic native web search extension for the [pi coding agent](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent).

This package is the standalone extraction of senpi's former builtin `anthropic-web-search` extension.

Behavior

The extension does not register a new tool. It intercepts Anthropic requests before they are sent and ensures a native `web_search_*` tool is present for first-party Anthropic `anthropic-messages` payloads.

Case Result
API is anthropic-messages on api.anthropic.com (or compat.supportsWebSearch: true) and no native web_search_* tool exists injects { type: "web_search_20250305", name: "web_search", max_uses: 8 }
Existing native web_search_* tool exists on a supported endpoint preserves it (no duplication)
Function variant named web_search is present on a supported endpoint strips function variant and keeps native variant
Anthropic-compatible endpoint without compat.supportsWebSearch strips native web_search_* tools; leaves function-tool web_search untouched
Non-Anthropic API payload leaves payload unchanged

`max_uses` is hardcoded to `8`, matching Claude Code/free-code's native web search schema. Optional domain filters can be supplied with comma-separated environment variables:

  • PI_ANTHROPIC_WEB_SEARCH_ALLOWED_DOMAINS
  • PI_ANTHROPIC_WEB_SEARCH_BLOCKED_DOMAINS

Set `PI_ANTHROPIC_WEB_SEARCH=0` (or `false` / `off` / `no`) to disable injection on supported endpoints.

It also appends a system-prompt section for supported Anthropic sessions indicating native `web_search` availability.

Installation

The package targets the [`pi`](https://github.com/badlogic/pi