@ogulcancelik/pi-model-thinking

Auto-set thinking levels per model/provider in pi

Packages

Package details

extension

Install @ogulcancelik/pi-model-thinking from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@ogulcancelik/pi-model-thinking
Package
@ogulcancelik/pi-model-thinking
Version
0.1.0
Published
May 13, 2026
Downloads
29/mo · 29/wk
Author
ogulcancelik
License
MIT
Types
extension
Size
12.2 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-model-thinking

Auto-set and remember thinking levels per model in pi.

No more Ctrl+PShift+TabShift+Tab when switching models. This extension remembers what thinking level you set for each model and restores it automatically.

Install

pi install npm:@ogulcancelik/pi-model-thinking

For local development:

pi install ~/Projects/pi-extensions/packages/pi-model-thinking

How it works

The extension uses a single file: ~/.pi/agent/model-thinking.json.

This file is both your initial config and your live state. You can seed it manually, or let it grow organically as you use pi.

If the model is in the file

On model_select (Ctrl+P, /model, session restore), the extension automatically applies the stored thinking level.

If the model is NOT in the file

The extension does nothing. Pi handles thinking natively, exactly as before.

When you manually change thinking (Shift+Tab)

The extension writes the new level into model-thinking.json for that exact model. Next time you use that model — even in a new session — it starts with your chosen level.

If your change matches a provider-level default in the file, the exact model entry is cleaned up automatically.

Config format

~/.pi/agent/model-thinking.json:

{
  "models": {
    "anthropic/claude-sonnet-4-5": "high",
    "openai/gpt-5.2-codex": "medium"
  },
  "providers": {
    "fireworks": "low"
  }
}

Resolution order:

  1. models["provider/modelId"] — exact match
  2. providers["provider"] — provider-wide fallback
  3. Not in file → extension ignores, pi handles natively

You don't need a config file at all. Start without one, and the file will be created the first time you Shift+Tab on a model.

Commands

/model-thinking — shows current resolution and whether the active model is managed.

/model-thinking reset — deletes model-thinking.json, clearing all remembered levels.

Example flow

  1. Start pi with no config file. Use Claude. Thinking is handled by pi natively.
  2. Shift+Tab change thinking to high. Extension silently writes "anthropic/claude-sonnet-4-5": "high".
  3. Quit pi, start a new session, Ctrl+P back to Claude. Thinking is automatically high.
  4. Switch to GPT (not in file). Extension does nothing — pi's native default applies.
  5. Shift+Tab on GPT to medium. Extension adds it to the file.
  6. Switch back to Claude → high. Switch to GPT → medium. No manual tweaking needed.