← Catalog

pi-reuse-model

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

Extension

Install

Install with PiG

pig install npm:pi-reuse-model

Install with Pi

pi install npm:pi-reuse-model
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.1 (README.md). PiG does not review it.

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.