@taterdoge/pi-remember-model0.1.2
Persist the last selected model to Pi's settings.json and the thinking level to the plugin cache.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@taterdoge/pi-remember-model
Pi extension that persists the last selected model to Pi's global settings.json and the thinking level to the plugin's own cache, so every new session starts where you left off.
Install
pi install npm:@taterdoge/pi-remember-model
Or try without installing:
pi -e npm:@taterdoge/pi-remember-model
How it works
- On model selection, writes
defaultProvideranddefaultModelto the global settings file (~/.pi/agent/settings.json, or$PI_CODING_AGENT_DIR/settings.json) - On thinking level selection, writes a per-model entry in the plugin cache (
~/.pi/agent/extensions/pi-remember-model/thinking-levels.json), keyed"provider/modelId", so a level one model cannot support never leaks into another model and Pi's ownsettings.jsonstays untouched - On model selection, re-applies that model's remembered level with
pi.setThinkingLevel()— the cache is not a Pi setting, so nothing else reads it at boot - Existing settings keys are preserved (read-merge-write); a missing or invalid file is started fresh
- Session-restore events (
source: "restore") are ignored, so merely opening an old session never rewrites your default
Files
Model choice goes into Pi's own global settings — the same keys Pi reads at startup:
{
"defaultProvider": "anthropic",
"defaultModel": "claude-opus-4-6"
}
Thinking levels stay in the plugin directory ($PI_CODING_AGENT_DIR/extensions/pi-remember-model/thinking-levels.json, default ~/.pi/agent/extensions/pi-remember-model/):
{
"anthropic/claude-opus-4-6": "xhigh",
"openai/gpt-5": "low"
}
pi.setThinkingLevel() has existed since Pi 0.76. On any supported Pi the extension remembers the model and re-applies the cached level when you switch back.
Note: Pi ≥ 0.76 already persists model/thinking-level choices natively; this extension is mainly useful on older Pi versions or as an explicit safety net.