pi-reuse-model

pi coding agent extension: start every fresh session on the model and thinking level last used in this workspace

Packages

Package details

extension

Install pi-reuse-model from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-reuse-model
Package
pi-reuse-model
Version
0.1.1
Published
Nov 5, 2026
Downloads
289/mo · 231/wk
Author
absolutex
License
MIT
Types
extension
Size
12.1 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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 (startup or new) the recorded model is restored through pi.setModel(), then the recorded thinking level through pi.setThinkingLevel(). resume/fork already 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.