https://github.com/code-yeongyu/pi-anthropic-tool-search
Anthropic native tool-search policy extension for the pi coding agent. Conditionally injects Anthropic tool-search tools based on PI_ANTHROPIC_TOOL_SEARCH and appends tool-search guidance to the system prompt.
https://github.com/code-yeongyu/pi-anthropic-tool-search
anthropic claude coding-agent pi pi-coding-agent pi-extension pi-mono tool-search typescript
Last synced: 11 days ago
JSON representation
Anthropic native tool-search policy extension for the pi coding agent. Conditionally injects Anthropic tool-search tools based on PI_ANTHROPIC_TOOL_SEARCH and appends tool-search guidance to the system prompt.
- Host: GitHub
- URL: https://github.com/code-yeongyu/pi-anthropic-tool-search
- Owner: code-yeongyu
- License: mit
- Created: 2026-05-12T04:08:39.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2026-05-12T04:14:46.000Z (20 days ago)
- Last Synced: 2026-05-12T06:23:47.814Z (20 days ago)
- Topics: anthropic, claude, coding-agent, pi, pi-coding-agent, pi-extension, pi-mono, tool-search, typescript
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Notice: NOTICE
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome-pi-coding-agent - code-yeongyu-pi-anthropic-tool-search - search policy extension for the pi coding agent. Conditionally injects Anthropic tool-search tools based on PI_ANTHROPIC_TOOL_SEARCH and appends tool-search guidance to the syste | | 14d ago | (Extensions)
README
# pi-anthropic-tool-search
[](https://github.com/code-yeongyu/pi-anthropic-tool-search/actions/workflows/ci.yml) [](LICENSE)
Anthropic native tool-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-tool-search` extension.
## Behavior
The extension does not register new local tools. It intercepts Anthropic requests and conditionally adds native Anthropic tool-search tools based on `PI_ANTHROPIC_TOOL_SEARCH`.
Supported modes:
- `off` (default): no changes
- `regex`: inject `tool_search_tool_regex`
- `bm25`: inject `tool_search_tool_bm25`
- `both`: inject both tools
Function-style variants with the same names are stripped when native types are not used. Invalid env values are treated as `off`; the extension emits one warning notification per session for invalid values.
It also appends a system-prompt section for Anthropic sessions when tool search mode is enabled.
## Installation
The package targets the [`pi`](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) coding agent. Pi loads extensions from `~/.pi/agent/extensions/`, project `.pi/extensions/`, or via the `--extension` / `-e` CLI flag.
```bash
# From npm (once published)
pi install npm:pi-anthropic-tool-search
# From git
pi install git:github.com/code-yeongyu/pi-anthropic-tool-search
# Manual placement
git clone https://github.com/code-yeongyu/pi-anthropic-tool-search ~/.pi/agent/extensions/pi-anthropic-tool-search
cd ~/.pi/agent/extensions/pi-anthropic-tool-search && npm install
# Dev / one-shot test
pi -e /path/to/pi-anthropic-tool-search/src/index.ts
```
After installation, restart pi or run `/reload` inside an interactive session.
## Development
```bash
npm install
npm test
npm run typecheck
npm run check
pi -e ./src/index.ts
```
The test suite uses vitest. TypeScript is strict, Node-only, and uses ESM imports with `.js` suffixes.
## Origin
Ported from `packages/coding-agent/src/core/extensions/builtin/anthropic-tool-search/index.ts` in `code-yeongyu/senpi-mono`.
## License
[MIT](LICENSE).
## Related
- [senpi](https://github.com/code-yeongyu/senpi) — the fork/runtime these extensions are extracted from.
- [Ultraworkers Discord](https://discord.gg/PUwSMR9XNk) — community link from the senpi README.
- [Dori](https://sisyphuslabs.ai) — the product powered by senpi under the hood.