pi-disable-tools

Pi extension to disable tools so the agent can no longer see or call them

Packages

Package details

extension

Install pi-disable-tools from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-disable-tools
Package
pi-disable-tools
Version
1.0.0
Published
Sep 12, 2026
Downloads
126/mo · 126/wk
Author
guokui0205
License
ISC
Types
extension
Size
14 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-disable-tools

English | 简体中文(当前)

把不想让 agent 用的工具直接从 system prompt 移除的 pi 扩展:禁用后模型既看不到该工具,也调不动它。

功能

  • /disable-tools —— 打开交互式开关菜单
  • 菜单里逐项点选即切换:✅ read(启用)/ ⛔ write(禁用)
  • 顶部实时显示当前禁用计数:工具开关(已禁用 2/23)
  • 覆盖全部工具:内置(read/bash/edit/write/grep/find/ls)、扩展注册的工具、以及 MCP 等动态注册的工具
  • 每项标注来源:· 内置 / · 扩展 / · SDK
工具开关(已禁用 1/23)  选中一项即切换
  ✅ bash  · 内置
  ✅ edit  · 内置
  ✅ read  · 内置
  ⛔ write · 内置
  ✅ web_search  · 扩展
  ✳️ 全部启用
  🔙 完成

与「拦截」的区别

pi 有两种管控工具的思路,本扩展用的是第一种:

方式 效果
setActiveTools()(本扩展) 从 system prompt 移除,模型不知道它存在,省 token 且不会被误调用
tool_call 拦截 工具仍对模型可见,只是执行被拒

配置

持久化到 ~/.pi/agent/extensions/pi-disable-tools/config.json全局生效(对所有项目和工作区):

{
  "disabled": ["write", "edit"]
}

生效时机

时机 作用
session_start 套用持久化的配置
before_agent_start 每次提交前再收紧一次
tool_call 兜底拦截,万一被别的扩展重新注册回来也不会真正执行

与其他扩展的叠加

日常同步只做减法

新 active = 当前 active − 禁用表

因此可以正确共存:

  • plan-mode 之类收紧工具的扩展 → 被它移除的工具不会被本扩展重新加回
  • MCP / 工具加载器新增的工具 → 未被禁用的会自动保留

只有菜单里的「全部启用」是显式并集操作,可能覆盖其他扩展的收紧; 这是用户主动要求「全部启用」时的预期行为。

安装

pi install npm:pi-disable-tools

或加入 ~/.pi/agent/settings.json

{
  "packages": ["pi-disable-tools"]
}

许可

ISC