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.
Package details
Install pi-model-pin from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-model-pin- Package
pi-model-pin- Version
1.0.1- Published
- Nov 4, 2026
- Downloads
- 530/mo · 530/wk
- Author
- devmolchy
- License
- MIT
- Types
- extension
- Size
- 11 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-model-pin
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
- A pi coding agent installation
- Node.js ≥ 20 for development
Install
From npm (recommended)
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
| Action | Result |
|---|---|
pi (new terminal) |
configured default model |
/model <provider>/<model> |
switch to that model (becomes "pinned") |
/new |
new session keeps the pinned model |
Ctrl+P cycling |
last non-default model also gets pinned |
/model <default model> |
back on the default → pin cleared |
/pin-status |
shows Pinned: <model> or No model pinned |
/unpin |
drop 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.