Quickly switch thinking modes and cycle favorite modes.
Requires status-bar to be installed and enabled for status indicator rendering.
Ctrl+Alt+Topens a thinking-mode pickerEnter: apply highlighted mode and closeSpace: toggle favorite on highlighted mode and keep picker open↑/↓orj/k: navigateEsc: close
Ctrl+Tcycles through favorite thinking modes (canonical order:off → minimal → low → medium → high → xhigh)- Favorites are persisted globally at:
~/.pi/agent/space.dector-switch-thinking.json
Availability rules:
- Reasoning model: all modes available
- Non-reasoning model: only
offavailable
Ctrl+T is built in as toggleThinking and is non-overridable while mapped.
To make extension cycling work on Ctrl+T, remap toggleThinking in:
~/.pi/agent/keybindings.json
Example:
{
"toggleThinking": ["ctrl+shift+t"]
}Install as a source extension directory (recommended for pi extensions):
- Global: copy this folder to
~/.pi/agent/extensions/switch-thinking/ - Project-local: copy this folder to
.pi/extensions/switch-thinking/
Required files in that folder:
index.tsstate.tsui.ts
Then:
- Run
/reload - (Required for cycling on
Ctrl+T) remaptoggleThinkingas shown above - Run
/hotkeysto verify bindings
- No bundle step is required for normal pi usage.
- pi loads TypeScript extensions directly.
- Keep imports relative (
./state,./ui) so the copied folder works as-is.
This extension still uses a UI-side refresh workaround to keep its emitted status content in sync when thinking level is changed via /settings.
Suggested core improvement in pi:
- Emit an extension event when thinking level changes (for example:
thinking_level_changewith previous/new level).
Why this helps:
- Native footer already reads live session state and updates immediately.
- Extensions emitting status content still need a callback to react to out-of-band thinking-level changes.
- A dedicated event would remove the need for input-timing workarounds.
- Status rendering is emitted via status-bar events (
status-bar:set/status-bar:clearwithid: "switch-thinking") rather than directui.setStatus. - In non-UI modes, picker is skipped safely.
- If favorites are empty or unavailable on current model, the extension shows a warning and does nothing.
- Corrupt favorites JSON falls back to empty favorites.