pi-reuse-model0.1.1
pi coding agent extension: start every fresh session on the model and thinking level last used in this workspace
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
pi-reuse-model
A pi extension that starts every fresh session (/new, reopening a workspace) on the model and thinking level you last used in this workspace, instead of the configured defaults.
Part of the my-pi-plugins monorepo.
Install
pi install npm:pi-reuse-model
Or load it with --extension ./src/index.ts, like any pi extension.
Behavior
- Changing the model or thinking level records the selection in
~/.pi/agent/pi-reuse-model.json, keyed by workspace directory. - On
session_start(startupornew) the recorded model is restored throughpi.setModel(), then the recorded thinking level throughpi.setThinkingLevel().resume/forkalready restore from the session transcript and are left alone. - Restore is skipped when the command line pins a model (
--model,--models,--provider) or the session already runs the recorded model or level. A model missing from the registry or lacking provider auth falls back to the resolved default while the thinking level still restores; an unknown recorded level is dropped.
Similar extensions
pi-remember-model and pi-remember-last-model keep a single global slot; this one remembers per workspace.
Development
From the repository root:
pnpm install
pnpm verify # fmt + lint + typecheck + test (all packages)
For local development, run pi install ./packages/pi-reuse-model from the repository root.