pi-adaptive-thinking
Pi Adaptive Thinking extension
Package details
Install pi-adaptive-thinking from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-adaptive-thinking- Package
pi-adaptive-thinking- Version
0.1.0- Published
- May 26, 2026
- Downloads
- not available
- Author
- ianpascoe_
- License
- MIT
- Types
- extension
- Size
- 121.8 KB
- Dependencies
- 0 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./dist/index.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-adaptive-thinking
Bring adaptive reasoning-effort control to Pi agents.
pi-adaptive-thinking is a Pi extension that lets the agent change Pi's thinking level through a tool named set_reasoning_effort.
It mirrors the user-facing behavior of opencode-adaptive-thinking while using Pi-native APIs: pi.getThinkingLevel(), pi.setThinkingLevel(), and thinking_level_select.
Installation
pi install npm:pi-adaptive-thinking
For local development:
pnpm install
pnpm build
pi -e ./dist/index.js
Behavior
The extension registers a tool with these parameters:
level: one of the valid Pi thinking levels for the current model.persist: optional boolean, defaultfalse.
Temporary changes:
{ "level": "high", "persist": false }
This changes reasoning effort for the current agent turn and restores the prior/baseline level when the turn ends.
Persistent changes:
{ "level": "low", "persist": true }
This changes the session baseline until another persistent change is made or the user changes thinking level manually.
Configuration
Configuration files are loaded in this order:
- Project:
.pi/adaptive-thinking.json - Global:
~/.pi/agent/adaptive-thinking.json - Built-in defaults
Project configuration takes precedence over global configuration.
{
"enabled": true,
"quiet": false,
"toolName": "set_reasoning_effort",
"toolDescription": "Set your reasoning effort",
"systemPrompt": "You MUST manage reasoning effort actively. Lower it before trivial or routine turns; raise it for ambiguity, debugging, risky changes, or multi-step synthesis. Reassess at turn start, after meaningful new evidence, and when the task shifts. NEVER leave the current level unchanged by inertia, and NEVER reply to a trivial turn before considering a downshift."
}
Development
pnpm install
pnpm format:check
pnpm lint
pnpm typecheck
pnpm test
pnpm build
Run all checks:
pnpm verify