← Catalog

pi-model-pin

Keeps the model you pick with /model across /new sessions in the same pi process, but starts at the default model in a new pi process.

Extension

Install

Install with PiG

pig install npm:pi-model-pin

Install with Pi

pi install npm:pi-model-pin
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": [
    "./index.ts"
  ]
}

README

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

pi-model-pin

License: MIT npm version

A pi coding agent extension that keeps the model you pick with /model across /new sessions within the same running pi process, while a new pi process (like a new terminal tab) always starts on the configured default model — until you pick a different one.

terminal A                                   terminal B (new process)
┌─────────────────────────────────┐          ┌─────────────────────────────┐
│ pi                              │          │ pi                          │
│ /model PROVIDER/MODEL           │          │   (starts on configured      │
│ /new      ← still on that model │          │    default model, as usual)  │
│ /new      ← still on that model │          └─────────────────────────────┘
└─────────────────────────────────┘

Requirements

Install

Install the published package with pi install:

pi install npm:pi-model-pin

This installs the package into pi's package directory (personal install) and activates its extension. Updates are applied with pi update --extensions.

From git

Prefer the npm package, but you can also install directly from this repository:

pi install git:github.com/DevMolchy/pi-model-pin

A git source is cloned and kept in sync with the tracked version; updates are applied on the next start or with pi update --extensions.

Local development

Copy or symlink index.ts into pi's auto-discovery folder:

mkdir -p ~/.pi/agent/extensions
ln -s "$(pwd)/index.ts" ~/.pi/agent/extensions/pi-model-pin.ts

To disable (without uninstalling), remove the symlink. Any edit is picked up by /reload.

Wherever the file lives, make sure you edit the copy in this repository and keep the link pointing here.

Usage

ActionResult
pi (new terminal)configured default model
/model <provider>/<model>switch to that model (becomes "pinned")
/newnew session keeps the pinned model
Ctrl+P cyclinglast non-default model also gets pinned
/model <default model>back on the default → pin cleared
/pin-statusshows Pinned: <model> or No model pinned
/unpindrop the pinned model → next /new uses the default

The footer shows a Pinned model indicator while a non-default model is pinned, and is blank otherwise.

Development

npm install        # fetch dev dependencies (type checking + test harness)
npm test           # run the tests
npm run typecheck  # type-check index.ts with tsc

CI (npm ci && npm run typecheck && npm test) runs on every push with Node 20, 22 and 24.

License

MIT © DevMolchy